![]() |
OpendTect
6.3
|
Public Types | |
| enum | Style { Local, Unix, Windows } |
Public Member Functions | |
| Path (const char *fullinp=0) | |
| Path (const char *p1, const char *p2, const char *p3=0, const char *p4=0, const char *p5=0) | |
| Path (const Path &fp) | |
| Path (const Path &, const char *p2, const char *p3=0, const char *p4=0, const char *p5=0) | |
| Path & | operator= (const Path &) |
| Path & | operator= (const char *fullinp) |
| bool | operator== (const Path &) const |
| bool | operator== (const char *fnm) const |
| bool | operator!= (const Path &) const |
| bool | operator!= (const char *fnm) const |
| bool | isEmpty () const |
| Path & | set (const char *fullinp) |
| Path & | add (const char *) |
| at end More... | |
| Path & | insert (const char *) |
| after prefix at start More... | |
| Path & | setFileName (const char *) |
| pass null to remove level More... | |
| Path & | setPath (const char *) |
| including prefix More... | |
| Path & | setExtension (const char *, bool replace=true) |
| !replace => bluntly add More... | |
| bool | isAbsolute () const |
| bool | isSubDirOf (const Path &, Path *reldir=0) const |
| bool | makeRelativeTo (const Path &) |
| bool | makeCanonical () |
| BufferString | fullPath (Style s=Local, bool cleanup=true) const |
| const char * | prefix () const |
| const char * | postfix () const |
| int | nrLevels () const |
| const char * | extension () const |
| may return null More... | |
| const OD::String & | fileName () const |
| BufferString | baseName () const |
| name of file w/o path or ext More... | |
| BufferString | pathOnly () const |
| BufferString | winDrive () const |
| const OD::String & | dir (int nr=-1) const |
| nr < 0 returns last dir name More... | |
| BufferString | dirUpTo (int) const |
| nr < 0 returns last dir, including prefix More... | |
| const char * | dirSep () const |
Static Public Member Functions | |
| static BufferString | getTempDir () |
| static BufferString | getTempName (const char *ext=0) |
| static BufferString | mkCleanPath (const char *path, Style fmt) |
| static BufferString | getTimeStampFileName (const char *ext=0) |
| static const char * | dirSep (Style) |
Static Public Attributes | |
| static const char * | sPrefSep |
Protected Member Functions | |
| void | addPart (const char *) |
| void | compress (int sl=0) |
| void | conv2TrueDirIfLink () |
Protected Attributes | |
| bool | isuri_ |
| bool | isabs_ |
| BufferString | prefix_ |
| BufferString | postfix_ |
| after '?' More... | |
| BufferStringSet | lvls_ |
File pathname tools.
This class splits a file or directory name 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 File::Path::Style |
| File::Path::Path | ( | const char * | fullinp = 0 | ) |
| File::Path::Path | ( | const char * | p1, |
| const char * | p2, | ||
| const char * | p3 = 0, |
||
| const char * | p4 = 0, |
||
| const char * | p5 = 0 |
||
| ) |
|
inline |
| File::Path::Path | ( | const Path & | , |
| const char * | p2, | ||
| const char * | p3 = 0, |
||
| const char * | p4 = 0, |
||
| const char * | p5 = 0 |
||
| ) |
| Path& File::Path::add | ( | const char * | ) |
at end
|
protected |
| BufferString File::Path::baseName | ( | ) | const |
name of file w/o path or ext
|
protected |
|
protected |
| const OD::String& File::Path::dir | ( | int | nr = -1 | ) | const |
nr < 0 returns last dir name
| const char* File::Path::dirSep | ( | ) | const |
|
static |
| BufferString File::Path::dirUpTo | ( | int | ) | const |
nr < 0 returns last dir, including prefix
| const char* File::Path::extension | ( | ) | const |
may return null
| const OD::String& File::Path::fileName | ( | ) | const |
| BufferString File::Path::fullPath | ( | Style | s = Local, |
| bool | cleanup = true |
||
| ) | const |
|
static |
|
static |
|
static |
| Path& File::Path::insert | ( | const char * | ) |
after prefix at start
| bool File::Path::isAbsolute | ( | ) | const |
|
inline |
If reldir is set, it will be filled with the relative path.
| bool File::Path::makeCanonical | ( | ) |
| bool File::Path::makeRelativeTo | ( | const Path & | ) |
|
static |
| int File::Path::nrLevels | ( | ) | const |
| bool File::Path::operator!= | ( | const Path & | ) | const |
| bool File::Path::operator!= | ( | const char * | fnm | ) | const |
| Path& File::Path::operator= | ( | const char * | fullinp | ) |
| bool File::Path::operator== | ( | const Path & | ) | const |
| bool File::Path::operator== | ( | const char * | fnm | ) | const |
| BufferString File::Path::pathOnly | ( | ) | const |
| const char* File::Path::postfix | ( | ) | const |
| const char* File::Path::prefix | ( | ) | const |
| Path& File::Path::set | ( | const char * | fullinp | ) |
| Path& File::Path::setExtension | ( | const char * | , |
| bool | replace = true |
||
| ) |
!replace => bluntly add
| Path& File::Path::setFileName | ( | const char * | ) |
pass null to remove level
| Path& File::Path::setPath | ( | const char * | ) |
including prefix
| BufferString File::Path::winDrive | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
after '?'
|
protected |
|
static |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017