FilenameCl
is used to maintain filenames with all of its (operating system specific) constituents: drive, path, base name and extension.
???
Public Member Functions | |
Constructors | |
Filename (void) | |
create an empty filename | |
Filename (const char *filename) | |
create a filename based on a filename given as a C string | |
Filename (const char *cpszPath, const char *cpszFilename, const char *cpszExtension=0) | |
create a filename based on a path, a filename and an optional extension, all given as C strings | |
Filename (const Filename &filename) | |
copy constructor | |
~Filename (void) | |
destructor | |
Assignment operations | |
Filename & | operator= (const Filename &filename) |
assign new complete filename | |
Properties | |
bool | isExistent (void) const |
determine whether a file exists for filename on file system | |
bool | isAbsolute (void) const |
determine whether path has an absolute path specification | |
unsigned long | getFileSize (void) const |
return the size of this file in bytes. | |
Parts | |
const char * | getAsCString (void) const |
return full filename as a C string pointer | |
operator const char * (void) const | |
const char * | getName (void) const |
return the name part of this filename without the path but with the extension. | |
const char * | getExtension (void) const |
return the extension only, starting with the dot (e.g. | |
size_t | getLength (void) const |
return the length of the complete filename | |
void | setNew (const char *cpszPath, const char *cpszName=0, const char *cpszExtension=0) |
assign a new entry from a path, optional filename and optional extension. | |
void | setNewName (const char *cpszName) |
assign a new filename - keep current path. | |
void | setNewExtension (const char *cpszExtension) |
assign a new extension - keep current path and filename. | |
void | normalizeAbsolute (void) |
convert to an absolute name in native format with appropriate directory separators. | |
void | normalize (void) |
convert to a name in native format with appropriate directory separators. | |
void | extractPath (char *pszPath) const |
copy path value to buffer pointed to by pszPath . | |
void | extractBaseName (char *pszBaseName) const |
copy base name (without path or extension) to buffer pointed to by pszBaseName . | |
bool | matchesBase (const Filename &crclFilename) const |
return TRUE if base names match (basic name part witout extension) | |
bool | determinePath (const char *searchPaths) |
search for file in a list of search paths and return TRUE if found |
uima::util::Filename::Filename | ( | void | ) | [inline] |
create an empty filename
uima::util::Filename::Filename | ( | const char * | filename | ) | [inline] |
create a filename based on a filename given as a C string
uima::util::Filename::Filename | ( | const char * | cpszPath, | |
const char * | cpszFilename, | |||
const char * | cpszExtension = 0 | |||
) | [inline] |
create a filename based on a path, a filename and an optional extension, all given as C strings
uima::util::Filename::Filename | ( | const Filename & | filename | ) | [inline] |
uima::util::Filename::~Filename | ( | void | ) | [inline] |
destructor
bool uima::util::Filename::isExistent | ( | void | ) | const [inline] |
determine whether a file exists for filename on file system
Referenced by determinePath(), uima::util::DllProcLoaderFile::DllProcLoaderFile(), and uima::util::DllProcLoaderFile::isExistent().
bool uima::util::Filename::isAbsolute | ( | void | ) | const [inline] |
determine whether path has an absolute path specification
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile().
unsigned long uima::util::Filename::getFileSize | ( | void | ) | const [inline] |
return the size of this file in bytes.
const char* uima::util::Filename::getAsCString | ( | void | ) | const [inline] |
return full filename as a C string pointer
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile(), Filename(), and operator=().
uima::util::Filename::operator const char * | ( | void | ) | const [inline] |
const char * uima::util::Filename::getName | ( | void | ) | const [inline] |
return the name part of this filename without the path but with the extension.
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile(), and matchesBase().
const char * uima::util::Filename::getExtension | ( | void | ) | const [inline] |
return the extension only, starting with the dot (e.g.
".so")
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile().
size_t uima::util::Filename::getLength | ( | void | ) | const [inline] |
return the length of the complete filename
void uima::util::Filename::setNew | ( | const char * | cpszPath, | |
const char * | cpszName = 0 , |
|||
const char * | cpszExtension = 0 | |||
) | [inline] |
assign a new entry from a path, optional filename and optional extension.
void uima::util::Filename::setNewName | ( | const char * | cpszName | ) | [inline] |
assign a new filename - keep current path.
filename may include extension or not
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile().
void uima::util::Filename::setNewExtension | ( | const char * | cpszExtension | ) | [inline] |
assign a new extension - keep current path and filename.
Specified extension must include the extension dot (".")
References CONST_CAST.
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile().
void uima::util::Filename::normalizeAbsolute | ( | void | ) | [inline] |
convert to an absolute name in native format with appropriate directory separators.
void uima::util::Filename::normalize | ( | void | ) | [inline] |
convert to a name in native format with appropriate directory separators.
void uima::util::Filename::extractPath | ( | char * | pszPath | ) | const [inline] |
copy path value to buffer pointed to by pszPath
.
If a path does not exist for this object, pszPath
is set to the empty string. The path is returned with a terminating path separator character.
void uima::util::Filename::extractBaseName | ( | char * | pszBaseName | ) | const [inline] |
copy base name (without path or extension) to buffer pointed to by pszBaseName
.
bool uima::util::Filename::matchesBase | ( | const Filename & | crclFilename | ) | const [inline] |
bool uima::util::Filename::determinePath | ( | const char * | searchPaths | ) | [inline] |
search for file in a list of search paths and return TRUE if found
References isExistent().
Referenced by uima::util::DllProcLoaderFile::DllProcLoaderFile().