From 8390df37ca3d7d24cbc6ecb858e007ed4c755520 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 7 Jun 2004 09:50:32 +0000 Subject: [PATCH] Add an 'add(str)' function that adds a search path separator and appends the str. --- simgear/misc/sg_path.cxx | 5 +++++ simgear/misc/sg_path.hxx | 6 ++++++ 2 files changed, 11 insertions(+) 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. -- 2.39.5