/** Default constructor */
SGPath();
+ /** Copy contructor */
SGPath(const SGPath& p);
SGPath& operator=(const SGPath& p);
*/
SGPath( const std::string& p );
+ /**
+ * Construct a path based on the starting path provided and a relative subpath
+ * @param p initial path
+ * @param r relative subpath
+ */
+ SGPath( const SGPath& p, const std::string& r );
+
/** Destructor */
~SGPath();
* Get the path string
* @return path in "C" string (ptr to char array) form.
*/
- const char* c_str() { return path.c_str(); }
+ const char* c_str() const { return path.c_str(); }
+
+ /**
+ * Get the path string in OS native form
+ */
+ std::string str_native() const;
/**
* Determine if file exists by attempting to fopen it.
bool isFile() const;
bool isDir() const;
+
+ /**
+ * Opposite sense to isAbsolute
+ */
+ bool isRelative() const { return !isAbsolute(); }
+
+ /**
+ * Is this an absolute path?
+ * I.e starts with a directory seperator, or a single character + colon
+ */
+ bool isAbsolute() const;
+
+ /**
+ * check for default constructed path
+ */
+ bool isNull() const;
private:
void fix();