OpendTect
7.0
|
Public Types | |
enum | Style { Local , Unix , Windows } |
Public Member Functions | |
FilePath (const char *fullinp=0) | |
FilePath (const char *p1, const char *p2, const char *p3=0, const char *p4=0, const char *p5=0) | |
FilePath (const FilePath &, const char *p2, const char *p3=0, const char *p4=0, const char *p5=0) | |
FilePath (const FilePath &fp) | |
FilePath & | add (const char *) |
at end More... | |
BufferString | baseName () const |
return name of file w/o path & ext More... | |
const OD::String & | dir (int nr=-1) const |
nr < 0 returns last dir name More... | |
const char * | dirSep () const |
BufferString | dirUpTo (int) const |
nr < 0 returns last dir, including prefix More... | |
const char * | domain () const |
bool | exists () const |
const char * | extension () const |
may return null More... | |
BufferString | fileFrom (int level) const |
const OD::String & | fileName () const |
BufferString | fullPath (Style s=Local, bool cleanup=true) const |
FilePath & | insert (const char *) |
after prefix at start More... | |
bool | isAbsolute () const |
bool | isEmpty () const |
bool | isSubDirOf (const FilePath &, FilePath *reldir=0) const |
bool | isURI () const |
bool | makeAbsolute (const FilePath &) |
bool | makeCanonical () |
bool | makeRelativeTo (const FilePath &) |
int | nrLevels () const |
bool | operator!= (const char *fnm) const |
bool | operator!= (const FilePath &) const |
FilePath & | operator= (const char *fullinp) |
FilePath & | operator= (const FilePath &) |
bool | operator== (const char *fnm) const |
bool | operator== (const FilePath &) const |
BufferString | partitionName () const |
BufferString | pathOnly (Style s=Local) const |
const char * | postfix () const |
const char * | prefix () const |
BufferString | rootPath () const |
FilePath & | set (const char *fullinp) |
void | setDomain (const char *) |
FilePath & | setExtension (const char *, bool replace=true) |
!replace => add More... | |
FilePath & | setFileName (const char *) |
pass null to remove level More... | |
FilePath & | setPath (const char *) |
including prefix More... | |
BufferString | winDrive () const |
Static Public Member Functions | |
static const char * | dirSep (Style) |
static BufferString | getFullLongPath (const FilePath &) |
static BufferString | getLongPath (const char *shortpath, BufferString *error=nullptr) |
static BufferString | getShortPath (const char *longpath, BufferString *error=nullptr) |
static BufferString | getTempDir () |
static BufferString | getTempFileName (const char *typ, const char *ext) |
static BufferString | getTempFullPath (const char *typ, const char *ext) |
static BufferString | getTempName (const char *ext=0) |
static BufferString | getTimeStampFileName (const char *ext) |
static BufferString | mkCleanPath (const char *path, Style fmt) |
static const char * | uriProtocolSeparator () |
Static Public Attributes | |
static const char * | sPrefSep |
Protected Member Functions | |
void | addPart (const char *) |
void | compress (int sl=0) |
void | trueDirIfLink () |
Protected Attributes | |
BufferString | domain_ |
bool | isabs_ |
BufferStringSet | lvls_ |
BufferString | postfix_ |
after '?' More... | |
BufferString | prefix_ |
File pathname tools.
This class splits a full filename (with path) into the separate parts: directories and possibly a filename (the last part does not have to be a file name). That makes it easy to change the file name, or the path only, or the extension, add directories, etc.
To get the result after manipulation, use the fullPath().
fileName() returns the last part, pathOnly() returns all but the last part. setFileName() replaces the last part, setPath() replaces all but the last part.
<>
enum FilePath::Style |
FilePath::FilePath | ( | const char * | fullinp = 0 | ) |
FilePath::FilePath | ( | const char * | p1, |
const char * | p2, | ||
const char * | p3 = 0 , |
||
const char * | p4 = 0 , |
||
const char * | p5 = 0 |
||
) |
|
inline |
FilePath::FilePath | ( | const FilePath & | , |
const char * | p2, | ||
const char * | p3 = 0 , |
||
const char * | p4 = 0 , |
||
const char * | p5 = 0 |
||
) |
FilePath& FilePath::add | ( | const char * | ) |
at end
|
protected |
BufferString FilePath::baseName | ( | ) | const |
return name of file w/o path & ext
|
protected |
const OD::String& FilePath::dir | ( | int | nr = -1 | ) | const |
nr < 0 returns last dir name
const char* FilePath::dirSep | ( | ) | const |
|
static |
BufferString FilePath::dirUpTo | ( | int | ) | const |
nr < 0 returns last dir, including prefix
const char* FilePath::domain | ( | ) | const |
bool FilePath::exists | ( | ) | const |
const char* FilePath::extension | ( | ) | const |
may return null
BufferString FilePath::fileFrom | ( | int | level | ) | const |
const OD::String& FilePath::fileName | ( | ) | const |
BufferString FilePath::fullPath | ( | Style | s = Local , |
bool | cleanup = true |
||
) | const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
FilePath& FilePath::insert | ( | const char * | ) |
after prefix at start
bool FilePath::isAbsolute | ( | ) | const |
bool FilePath::isEmpty | ( | ) | const |
If reldir is set, it will be filled with the relative path.
bool FilePath::isURI | ( | ) | const |
bool FilePath::makeAbsolute | ( | const FilePath & | ) |
bool FilePath::makeCanonical | ( | ) |
bool FilePath::makeRelativeTo | ( | const FilePath & | ) |
|
static |
int FilePath::nrLevels | ( | ) | const |
bool FilePath::operator!= | ( | const char * | fnm | ) | const |
bool FilePath::operator!= | ( | const FilePath & | ) | const |
FilePath& FilePath::operator= | ( | const char * | fullinp | ) |
bool FilePath::operator== | ( | const char * | fnm | ) | const |
bool FilePath::operator== | ( | const FilePath & | ) | const |
BufferString FilePath::partitionName | ( | ) | const |
BufferString FilePath::pathOnly | ( | Style | s = Local | ) | const |
const char* FilePath::postfix | ( | ) | const |
const char* FilePath::prefix | ( | ) | const |
BufferString FilePath::rootPath | ( | ) | const |
FilePath& FilePath::set | ( | const char * | fullinp | ) |
void FilePath::setDomain | ( | const char * | ) |
FilePath& FilePath::setExtension | ( | const char * | , |
bool | replace = true |
||
) |
!replace => add
FilePath& FilePath::setFileName | ( | const char * | ) |
pass null to remove level
FilePath& FilePath::setPath | ( | const char * | ) |
including prefix
|
protected |
|
inlinestatic |
BufferString FilePath::winDrive | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
after '?'
|
protected |
|
static |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024