#include <sg_path.hxx>
Public Member Functions | |
| SGPath () | |
| Default constructor. | |
| SGPath (const string &p) | |
| Construct a path based on the starting path provided. | |
| ~SGPath () | |
| Destructor. | |
| void | set (const string &p) |
| Set path to a new value. | |
| SGPath & | operator= (const char *p) |
| void | append (const string &p) |
| Append another piece to the existing path. | |
| void | add (const string &p) |
| Append a new piece to the existing path. | |
| void | concat (const string &p) |
| Concatenate a string to the end of the path without inserting a path separator. | |
| string | file () const |
| Get the file part of the path (everything after the last path sep). | |
| string | dir () const |
| Get the directory part of the path. | |
| string | base () const |
| Get the base part of the path (everything but the extension. | |
| string | extension () const |
| Get the extention part of the path (everything after the final "."). | |
| string | str () const |
| Get the path string. | |
| const char * | c_str () |
| Get the path string. | |
| bool | exists () const |
| Determine if file exists by attempting to fopen it. | |
| void | create_dir (mode_t mode) |
| Create the designated directory. | |
Paths can be input in any platform format and will be converted automatically to the proper format.
Definition at line 52 of file sg_path.hxx.
| SGPath::SGPath | ( | const string & | p | ) |
Construct a path based on the starting path provided.
| p | initial path |
| void SGPath::set | ( | const string & | p | ) |
Set path to a new value.
| p | new path |
Definition at line 100 of file sg_path.cxx.
Referenced by SGNewCloud::loadTextures(), operator=(), SGCloudLayer::rebuild(), and SGTime::updateLocal().
| void SGPath::append | ( | const string & | p | ) |
Append another piece to the existing path.
Inserts a path separator between the existing component and the new component.
| p | additional path component |
Definition at line 107 of file sg_path.cxx.
Referenced by add(), SGSun::build(), SGMoon::build(), SGStarData::load(), SGSoundSample::load_file(), SGNewCloud::loadTextures(), SGCloudLayer::rebuild(), SGMaterialAnimation::SGMaterialAnimation(), SGSoundSample::SGSoundSample(), PropsVisitor::startElement(), SGMaterialAnimation::update(), and SGTime::updateLocal().
| void SGPath::add | ( | const string & | p | ) |
Append a new piece to the existing path.
Inserts a search path separator to the existing path and the new patch component.
| p | additional path component |
Definition at line 120 of file sg_path.cxx.
References append().
| void SGPath::concat | ( | const string & | p | ) |
Concatenate a string to the end of the path without inserting a path separator.
| p | addtional path suffix |
Definition at line 127 of file sg_path.cxx.
| string SGPath::file | ( | ) | const |
Get the file part of the path (everything after the last path sep).
Definition at line 138 of file sg_path.cxx.
| string SGPath::dir | ( | ) | const |
Get the directory part of the path.
Definition at line 149 of file sg_path.cxx.
Referenced by create_dir().
| string SGPath::base | ( | ) | const |
Get the base part of the path (everything but the extension.
)
Definition at line 159 of file sg_path.cxx.
| string SGPath::extension | ( | ) | const |
Get the extention part of the path (everything after the final ".").
Definition at line 171 of file sg_path.cxx.
| string SGPath::str | ( | ) | const [inline] |
Get the path string.
Definition at line 126 of file sg_path.hxx.
Referenced by SGBucket::gen_base_path(), SGStarData::load(), SGSoundSample::load_file(), SGNewCloud::loadTextures(), SGCloudLayer::rebuild(), SGSoundSample::SGSoundSample(), PropsVisitor::startElement(), SGTime::updateLocal(), SGBinObject::write_ascii(), and SGBinObject::write_bin().
| const char* SGPath::c_str | ( | ) | [inline] |
Get the path string.
Definition at line 132 of file sg_path.hxx.
Referenced by SGSun::build(), SGMoon::build(), SGSoundSample::load_file(), SGSoundSample::SGSoundSample(), SGTime::updateLocal(), SGBinObject::write_ascii(), and SGBinObject::write_bin().
| bool SGPath::exists | ( | ) | const |
Determine if file exists by attempting to fopen it.
Definition at line 180 of file sg_path.cxx.
1.5.1