Parses a categorized path string into type and list of components.

def ParseCategorizedPath(path):
  """Parses a categorized path string into type and list of components."""
  components = tuple(component for component in path.split("/") if component)
  if components[0:2] == ("fs", "os"):
    return PathInfo.PathType.OS, components[2:]
  elif components[0:2] == ("fs", "tsk"):
    return PathInfo.PathType.TSK, components[2:]
  elif components[0:1] == ("registry",):
    return PathInfo.PathType.REGISTRY, components[1:]
  elif components[0:1] == ("temp",):
    return PathInfo.PathType.TEMP, components[1:]
  else:
    raise ValueError("Incorrect path: '%s'" % path)