class_docstr: Reader for Mac OS resource forks.
  
  Parses a resource fork and returns resources according to their type.
  If run on OS X, this will open the resource fork in the filesystem.
  Otherwise, it will open the file itself and attempt to read it as
  though it were a resource fork.
  
  The returned object can be indexed by type and iterated over,
  returning in each case a list of py:class:`Resource` objects
  representing all the resources of a certain type.
class_docstr_tok: ["Reader","for","Mac","OS","resource","forks",".","Parses","a","resource","fork","and","returns","resources","according","to","their","type",".","If","run","on","OS","X",",","this","will","open","the","resource","fork","in","the","filesystem",".","Otherwise",",","it","will","open","the","file","itself","and","attempt","to","read","it","as","though","it","were","a","resource","fork",".","The","returned","object","can","be","indexed","by","type","and","iterated","over",",","returning","in","each","case","a","list","of","py",":","class",":","`","Resource","`","objects","representing","all","the","resources","of","a","certain","type","."]
docstr: Return the number of resources of a given type.
docstr_tok: ["Return","the","number","of","resources","of","a","given","type","."]
code: def countResources(self, resType):
      """Return the number of resources of a given type."""
      try:
          return len(self[resType])
      except KeyError:
          return 0
  
imports: from io import BytesIO
  import struct
  from fontTools.misc import sstruct
  from fontTools.misc.textTools import bytesjoin, tostr
  from collections import OrderedDict
  from collections.abc import MutableMapping
label_desc: Use image node_id 16 for calling the ResourceReader obj's underlying member method code with example usage: obj.countResources(resType) and returns: len, int