diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 95e2a505..f21a523c 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -112,6 +112,11 @@ void SGPath::append( const string& p ) { fix(); } +//add a new path component to the existing path string +void SGPath::add( const string& p ) { + append( sgSearchPathSep+p ); +} + // concatenate a string to the end of the path without inserting a // path separator diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index bdb45e01..5e3c5cb2 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -79,6 +79,12 @@ public: * @param p additional path component */ void append( 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. + * @param p additional path component */ + void add( const string& p ); + /** * Concatenate a string to the end of the path without inserting a * path separator.