[Box Backup-commit] COMMIT r1325 - box/chris/general/lib/common
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sat, 03 Mar 2007 21:55:53 +0000
Author: chris
Date: 2007-03-03 21:55:53 +0000 (Sat, 03 Mar 2007)
New Revision: 1325
Added:
box/chris/general/lib/common/PathUtils.cpp
box/chris/general/lib/common/PathUtils.h
Log:
Moved MakeFullPath out of BackupClientDirectoryRecord since other
modules need it too (from chris/merge)
Added: box/chris/general/lib/common/PathUtils.cpp
===================================================================
--- box/chris/general/lib/common/PathUtils.cpp (rev 0)
+++ box/chris/general/lib/common/PathUtils.cpp 2007-03-03 21:55:53 UTC (rev 1325)
@@ -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;
+}
Added: box/chris/general/lib/common/PathUtils.h
===================================================================
--- box/chris/general/lib/common/PathUtils.h (rev 0)
+++ box/chris/general/lib/common/PathUtils.h 2007-03-03 21:55:53 UTC (rev 1325)
@@ -0,0 +1,26 @@
+// --------------------------------------------------------------------------
+//
+// File
+// Name: PathUtils.h
+// Purpose: Platform-independent path manipulation
+// Created: 2007/01/17
+//
+// --------------------------------------------------------------------------
+
+#ifndef PATHUTILS_H
+#define PATHUTILS_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);
+
+#endif // !PATHUTILS_H