diff options
| author | 2025-04-06 11:44:13 +0200 | |
|---|---|---|
| committer | 2025-04-06 11:44:13 +0200 | |
| commit | 31f1a810e5264ef970bab17d517692ef906470e1 (patch) | |
| tree | 672bd841e21fb43fe8e7f8c7ddf9333d687c5a6d | |
| parent | 8e310421adfa157a0a62c903b0bcd83cf27c3f46 (diff) | |
| download | libplist-31f1a810e5264ef970bab17d517692ef906470e1.tar.gz libplist-31f1a810e5264ef970bab17d517692ef906470e1.tar.bz2 | |
C++: Add const char* constructor to String class
| -rw-r--r-- | include/plist/String.h | 1 | ||||
| -rw-r--r-- | src/String.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/plist/String.h b/include/plist/String.h index 4392482..7e8a6e4 100644 --- a/include/plist/String.h +++ b/include/plist/String.h | |||
| @@ -37,6 +37,7 @@ public : | |||
| 37 | String& operator=(const String& s); | 37 | String& operator=(const String& s); |
| 38 | String& operator=(const char* s); | 38 | String& operator=(const char* s); |
| 39 | String(const std::string& s); | 39 | String(const std::string& s); |
| 40 | String(const char *s); | ||
| 40 | virtual ~String(); | 41 | virtual ~String(); |
| 41 | 42 | ||
| 42 | Node* Clone() const; | 43 | Node* Clone() const; |
diff --git a/src/String.cpp b/src/String.cpp index 326aa7f..5bae804 100644 --- a/src/String.cpp +++ b/src/String.cpp | |||
| @@ -57,6 +57,11 @@ String::String(const std::string& s) : Node(PLIST_STRING) | |||
| 57 | plist_set_string_val(_node, s.c_str()); | 57 | plist_set_string_val(_node, s.c_str()); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | String::String(const char *s) : Node(PLIST_STRING) | ||
| 61 | { | ||
| 62 | plist_set_string_val(_node, s); | ||
| 63 | } | ||
| 64 | |||
| 60 | String::~String() | 65 | String::~String() |
| 61 | { | 66 | { |
| 62 | } | 67 | } |
