source: box/trunk/lib/common/PathUtils.cpp @ 1265

Revision 1265, 899 bytes checked in by chris, 5 years ago (diff)

Moved MakeFullPath? into its own library file so that we can share it
(BackupQueries? needs it too) (refs #3)

Line 
1// --------------------------------------------------------------------------
2//
3// File
4//              Name:    PathUtils.cpp
5//              Purpose: Platform-independent path manipulation
6//              Created: 2007/01/17
7//
8// --------------------------------------------------------------------------
9
10#include "Box.h"
11#include <string>
12
13// --------------------------------------------------------------------------
14//
15// Function
16//              Name:    MakeFullPath(const std::string& rDir, const std::string& rFile)
17//              Purpose: Combine directory and file name
18//              Created: 2006/08/10
19//
20// --------------------------------------------------------------------------
21std::string MakeFullPath(const std::string& rDir, const std::string& rEntry)
22{
23        std::string result(rDir);
24
25        if (result.size() > 0 && 
26                result[result.size()-1] != DIRECTORY_SEPARATOR_ASCHAR)
27        {
28                result += DIRECTORY_SEPARATOR;
29        }
30
31        result += rEntry;
32
33        return result;
34}
Note: See TracBrowser for help on using the repository browser.