/// @brief Make the current path name unique in the file system.
bool makeUnique( bool reuse_current /*= true*/, std::string* ErrMsg );
+ /// The current Path name is made absolute by prepending the
+ /// current working directory if necessary.
+ void makeAbsolute();
+
/// @}
/// @name Disk Mutators
/// @{
return false;
}
+void Path::makeAbsolute() {
+ if (isAbsolute())
+ return;
+
+ Path CWD = Path::GetCurrentDirectory();
+ assert(CWD.isAbsolute() && "GetCurrentDirectory returned relative path!");
+
+ CWD.appendComponent(path);
+
+ path = CWD.toString();
+}
+
static void getPathList(const char*path, std::vector<Path>& Paths) {
const char* at = path;
const char* delim = strchr(at, PathSeparator);