Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

PathString Class Reference
[Files]

Processing of the path to file. More...

#include <gmlpathstring.h>

Inheritance diagram for PathString:

String List of all members.

Public Member Functions

Constructors
 PathString (const string &rhs)
 PathString (const string &rhs, size_type pos, size_type n)
 PathString (const char *s, size_type n)
 PathString (const char *s)
 PathString (size_type n, char c)
 PathString (const_iterator first, const_iterator last)
 PathString (const string &path, const string &filename, const string &extension=string())
 Constructs an object from path+filename+extension.

Path handling
string Path () const
 Returns extracted path from full path to the file.

string Filename () const
 Returns full name of the file (with extension).

string Basename () const
 Returns base name of the file (without extension).

string Extension () const
 Returns extension of the file (dot is not included).

void Split (string *path, string *filename, string *extension=NULL) const
 Splits path name into path, base filename and extension.

bool MakeFullPath (const PathString &relative_to=PathString())
File or directory handling
bool IsFile () const
 Check: 'this' string is the name of the real plain file.

bool IsDir () const
 Check: 'this' string is the name of the directory.

bool CurDir ()
 Get current working directory to 'this' pathname.

bool ChDir () const
 Change current working directory to 'this' pathname.

bool MkDir () const
 Create directory with name specified by 'this' pathname.

bool RmDir () const
 Remove directory with name specified by 'this' pathname.

bool ExePath ()
 Get full path to the current program.

bool ListFileName (list< PathString > &filelist, PathString *mask) const

Static Public Attributes

const char PATH_SEPARATOR = '\\'
 char path separator for currents OS

const string PATH_SEPARATOR_STR = string("\\")
 string path separator for current OS


Protected Member Functions

bool CheckMask (const PathString &mask) const
void CorrectSeparators ()

Detailed Description

Processing of the path to file.


Constructor & Destructor Documentation

PathString const string &  path,
const string &  filename,
const string &  extension = string()
 

Constructs an object from path+filename+extension.

The path separator will be added if string path does not end by path separator. The dot will be added between filename and extension if extension does not begin by dot.

Note:
If parameter extension is absent then filename contains the full name of the file.


Member Function Documentation

string Path  )  const
 

Returns extracted path from full path to the file.

Note:
In case if path cannot be extracted, an empty string will be returned.

string Filename  )  const
 

Returns full name of the file (with extension).

Note:
If full name is not extracted, an empty string will be returned.

string Basename  )  const
 

Returns base name of the file (without extension).

Note:
If base name is not extracted, an empty string will be returned.

string Extension  )  const
 

Returns extension of the file (dot is not included).

Note:
If extension is not extracted, an empty string will be returned.

void Split string *  path,
string *  filename,
string *  extension = NULL
const
 

Splits path name into path, base filename and extension.

Note:
If parameter extension is absent then filename will contain file name with extension.

bool MakeFullPath const PathString relative_to = PathString()  ) 
 

Expand current path to full path relative to 'relative_to' argument.

Warning:
relative_to must be a full path or NULL if to work with current directory

bool RmDir  )  const
 

Remove directory with name specified by 'this' pathname.

Note:
Directory must be empty

bool ListFileName list< PathString > &  filelist,
PathString mask
const
 

Non-obligatory parameter mask defines mask for the filtration.


The documentation for this class was generated from the following files:
Generated on Tue Jan 13 21:12:03 2004 for Graphics and Media Lab CSL by doxygen 1.3.4