diff options
| -rw-r--r-- | include/tag_string.h | 2 | ||||
| -rw-r--r-- | src/tag_string.cpp | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/tag_string.h b/include/tag_string.h index f4476993e3..846650e507 100644 --- a/include/tag_string.h +++ b/include/tag_string.h @@ -35,6 +35,7 @@ public: tag_string(const std::string& str); tag_string(std::string&& str = ""); + tag_string(const char* str); operator std::string&(); operator const std::string&() const; @@ -42,6 +43,7 @@ public: tag_string& operator=(const std::string& str); tag_string& operator=(std::string&& str); + tag_string& operator=(const char* str); void set(const std::string& str); void set(std::string&& str); diff --git a/src/tag_string.cpp b/src/tag_string.cpp index 6bd1465e84..e4f714d0b3 100644 --- a/src/tag_string.cpp +++ b/src/tag_string.cpp @@ -30,6 +30,10 @@ tag_string::tag_string(std::string&& str): value(std::move(str)) {} +tag_string::tag_string(const char* str): + value(std::string(str)) +{} + tag_string::operator std::string&() { return value; @@ -57,6 +61,12 @@ tag_string& tag_string::operator=(std::string&& str) return *this; } +tag_string& tag_string::operator=(const char* str) +{ + value = std::string(str); + return *this; +} + void tag_string::set(const std::string& str) { value = str; |
