class documentation

class FileInfo(object):

Constructor: FileInfo(filename)

View In Hierarchy

Provides utility functions for filenames.

FileInfo provides easy access to the components of a file's path relative to the project root.

Method __init__ Undocumented
Method BaseName File base name - text after the final slash, before the final period.
Method Extension File extension - text following the final period.
Method FullName Make Windows paths like Unix.
Method IsSource File has a source file extension.
Method NoExtension File has no source file extension.
Method RepositoryName FullName after removing the local path to the repository.
Method Split Splits the file into the directory, basename, and extension.
Instance Variable _filename Undocumented
def __init__(self, filename):

Undocumented

def BaseName(self):

File base name - text after the final slash, before the final period.

def Extension(self):

File extension - text following the final period.

def FullName(self):

Make Windows paths like Unix.

def IsSource(self):

File has a source file extension.

def NoExtension(self):

File has no source file extension.

def RepositoryName(self):

FullName after removing the local path to the repository.

If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things like "C:Documents and Settings..." or "/home/username/..." in them and thus people on different computers who have checked the source out to different locations won't see bogus errors.

def Split(self):

Splits the file into the directory, basename, and extension.

For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc')

Returns:
A tuple of (directory, basename, extension).
_filename =

Undocumented