// Get the file part of the path (everything after the last path sep)
-string SGPath::file() {
+string SGPath::file() const {
int index = path.rfind(SG_PATH_SEP);
if (index >= 0) {
return path.substr(index + 1);
// get the directory part of the path.
-string SGPath::dir() {
+string SGPath::dir() const {
int index = path.rfind(SG_PATH_SEP);
if (index >= 0) {
return path.substr(0, index);
}
// get the base part of the path (everything but the extension.)
-string SGPath::base() {
+string SGPath::base() const {
int index = path.rfind(".");
if (index >= 0) {
return path.substr(0, index);
}
// get the extention (everything after the final ".")
-string SGPath::extension() {
+string SGPath::extension() const {
int index = path.rfind(".");
if (index >= 0) {
return path.substr(index + 1);
* Get the file part of the path (everything after the last path sep)
* @return file string
*/
- string file();
+ string file() const;
/**
* Get the directory part of the path.
* @return directory string
*/
- string dir();
+ string dir() const;
/**
* Get the base part of the path (everything but the extension.)
* @return the base string
*/
- string base();
+ string base() const;
/**
* Get the extention part of the path (everything after the final ".")
* @return the extention string
*/
- string extension();
+ string extension() const;
/** Get the path string
* @return path string