diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-01-17 21:59:13 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-01-17 21:59:13 +0000 |
commit | 5035fdfe9be9ce82d3f6c6affa310e8763d7b102 (patch) | |
tree | 1fdc8af2ee79fc45c452767aa5a9c812fac4c7bc /lib/common/PathUtils.cpp | |
parent | 3dc6cc0f31914aecc0900583dff6c80b00987611 (diff) |
Moved MakeFullPath into its own library file so that we can share it
(BackupQueries needs it too) (refs #3)
Diffstat (limited to 'lib/common/PathUtils.cpp')
-rw-r--r-- | lib/common/PathUtils.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/common/PathUtils.cpp b/lib/common/PathUtils.cpp new file mode 100644 index 00000000..924d47d2 --- /dev/null +++ b/lib/common/PathUtils.cpp @@ -0,0 +1,34 @@ +// -------------------------------------------------------------------------- +// +// File +// Name: PathUtils.cpp +// Purpose: Platform-independent path manipulation +// Created: 2007/01/17 +// +// -------------------------------------------------------------------------- + +#include "Box.h" +#include <string> + +// -------------------------------------------------------------------------- +// +// Function +// Name: MakeFullPath(const std::string& rDir, const std::string& rFile) +// Purpose: Combine directory and file name +// Created: 2006/08/10 +// +// -------------------------------------------------------------------------- +std::string MakeFullPath(const std::string& rDir, const std::string& rEntry) +{ + std::string result(rDir); + + if (result.size() > 0 && + result[result.size()-1] != DIRECTORY_SEPARATOR_ASCHAR) + { + result += DIRECTORY_SEPARATOR; + } + + result += rEntry; + + return result; +} |