webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | List of all members
webkitpy.style.checkers.cpp.FileInfo Class Reference

Public Member Functions

def __init__ (self, filename)
 
def full_name (self)
 
def repository_name (self)
 
def split (self)
 
def base_name (self)
 
def extension (self)
 
def no_extension (self)
 
def is_source (self)
 

Detailed Description

Provides utility functions for filenames.

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

Constructor & Destructor Documentation

◆ __init__()

def webkitpy.style.checkers.cpp.FileInfo.__init__ (   self,
  filename 
)

Member Function Documentation

◆ base_name()

def webkitpy.style.checkers.cpp.FileInfo.base_name (   self)
File base name - text after the final slash, before the final period.

◆ extension()

def webkitpy.style.checkers.cpp.FileInfo.extension (   self)
File extension - text following the final period.

◆ full_name()

def webkitpy.style.checkers.cpp.FileInfo.full_name (   self)
Make Windows paths like Unix.

◆ is_source()

def webkitpy.style.checkers.cpp.FileInfo.is_source (   self)
File has a source file extension.

◆ no_extension()

def webkitpy.style.checkers.cpp.FileInfo.no_extension (   self)
File has no source file extension.

◆ repository_name()

def webkitpy.style.checkers.cpp.FileInfo.repository_name (   self)
Full name 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.

◆ split()

def webkitpy.style.checkers.cpp.FileInfo.split (   self)
Splits the file into the directory, basename, and extension.

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

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

The documentation for this class was generated from the following file: