Parcourir la source

Added FilePath join.

Branimir Karadžić il y a 8 ans
Parent
commit
a29a296800
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  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 join(const StringView& _str);
+
 		///
 		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
 	{
 		return m_filePath;