From a29a296800d2470e4b57a04ef467761e79811a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 15 Jul 2017 21:21:14 -0700 Subject: [PATCH] Added FilePath join. --- include/bx/filepath.h | 3 +++ src/filepath.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/bx/filepath.h b/include/bx/filepath.h index fffae92..5029d9c 100644 --- a/include/bx/filepath.h +++ b/include/bx/filepath.h @@ -46,6 +46,9 @@ namespace bx /// void set(const StringView& _str); + /// + void join(const StringView& _str); + /// const char* get() const; diff --git a/src/filepath.cpp b/src/filepath.cpp index 0771b82..da7654e 100644 --- a/src/filepath.cpp +++ b/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;