Browse Source

Added FilePath join.

Branimir Karadžić 8 years ago
parent
commit
a29a296800
2 changed files with 12 additions and 0 deletions
  1. 3 0
      include/bx/filepath.h
  2. 9 0
      src/filepath.cpp

+ 3 - 0
include/bx/filepath.h

@@ -46,6 +46,9 @@ namespace bx
 		///
 		///
 		void set(const StringView& _str);
 		void set(const StringView& _str);
 
 
+		///
+		void join(const StringView& _str);
+
 		///
 		///
 		const char* get() const;
 		const char* get() const;
 
 

+ 9 - 0
src/filepath.cpp

@@ -223,6 +223,15 @@ namespace bx
 			);
 			);
 	}
 	}
 
 
+	void FilePath::join(const StringView& _str)
+	{
+		char tmp[kMaxFilePath];
+		strCopy(tmp, BX_COUNTOF(tmp), m_filePath);
+		strCat(tmp, BX_COUNTOF(tmp), "/");
+		strCat(tmp, BX_COUNTOF(tmp), _str);
+		set(tmp);
+	}
+
 	const char* FilePath::get() const
 	const char* FilePath::get() const
 	{
 	{
 		return m_filePath;
 		return m_filePath;