Add a convenience constructeur to SGPath

This commit is contained in:
Frederic Bouvier
2010-08-22 09:33:56 +02:00
parent c3133f020d
commit 510543e14b
2 changed files with 17 additions and 0 deletions

View File

@@ -86,6 +86,15 @@ SGPath::SGPath( const std::string& p )
fix();
}
// create a path based on "path" and a "subpath"
SGPath::SGPath( const SGPath& p, const std::string& r )
: path(p.path),
_cached(false)
{
append(r);
fix();
}
SGPath::SGPath(const SGPath& p) :
path(p.path),
_cached(p._cached),

View File

@@ -58,6 +58,7 @@ public:
/** Default constructor */
SGPath();
/** Copy contructor */
SGPath(const SGPath& p);
SGPath& operator=(const SGPath& p);
@@ -68,6 +69,13 @@ public:
*/
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();