diff options
author | B Stack <bgstack15@gmail.com> | 2021-01-04 13:48:35 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-01-04 13:48:35 +0000 |
commit | edb1c4482c0a0d91bddfee6e1f9fce234e59840a (patch) | |
tree | 494f9fc32eeee34c6c46611ae0137c25a79517a4 /zenXml/zenxml/dom.h | |
parent | Merge branch '11.4' into 'master' (diff) | |
parent | add upstream 11.5 (diff) | |
download | FreeFileSync-edb1c4482c0a0d91bddfee6e1f9fce234e59840a.tar.gz FreeFileSync-edb1c4482c0a0d91bddfee6e1f9fce234e59840a.tar.bz2 FreeFileSync-edb1c4482c0a0d91bddfee6e1f9fce234e59840a.zip |
Merge branch '11.5' into 'master'11.5
add upstream 11.5
See merge request opensource-tracking/FreeFileSync!29
Diffstat (limited to 'zenXml/zenxml/dom.h')
-rw-r--r-- | zenXml/zenxml/dom.h | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/zenXml/zenxml/dom.h b/zenXml/zenxml/dom.h index b49db90c..cfbd14c9 100644 --- a/zenXml/zenxml/dom.h +++ b/zenXml/zenxml/dom.h @@ -29,11 +29,9 @@ public: ///Retrieve the name of this XML element. /** - \tparam String Arbitrary string class: e.g. std::string, std::wstring, wxString, MyStringClass, ... \returns Name of the XML element. */ - template <class String> - String getNameAs() const { return utfTo<String>(name_); } + const std::string& getName() const { return name_; } ///Get the value of this element as a user type. /** @@ -50,6 +48,8 @@ public: template <class T> void setValue(const T& value) { writeStruc(value, *this); } + void setValue(std::string&& value) { value_ = std::move(value); } //perf + ///Retrieve an attribute by name. /** \tparam String Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... @@ -299,46 +299,22 @@ public: XmlElement& root() { return root_; } ///Get the version used in the XML declaration. - /** - \tparam String Arbitrary string class: e.g. std::string, std::wstring, wxString, MyStringClass, ... - */ - template <class String> - String getVersionAs() const { return utfTo<String>(version_); } + const std::string& getVersion() const { return version_; } ///Set the version used in the XML declaration. - /** - \tparam String Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... - */ - template <class String> - void setVersion(const String& version) { version_ = utfTo<std::string>(version); } + void setVersion(const std::string& version) { version_ = version; } ///Get the encoding used in the XML declaration. - /** - \tparam String Arbitrary string class: e.g. std::string, std::wstring, wxString, MyStringClass, ... - */ - template <class String> - String getEncodingAs() const { return utfTo<String>(encoding_); } + const std::string& getEncoding() const { return encoding_; } ///Set the encoding used in the XML declaration. - /** - \tparam String Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... - */ - template <class String> - void setEncoding(const String& encoding) { encoding_ = utfTo<std::string>(encoding); } + void setEncoding(const std::string& encoding) { encoding_ = encoding; } ///Get the standalone string used in the XML declaration. - /** - \tparam String Arbitrary string class: e.g. std::string, std::wstring, wxString, MyStringClass, ... - */ - template <class String> - String getStandaloneAs() const { return utfTo<String>(standalone_); } + const std::string& getStandalone() const { return standalone_; } ///Set the standalone string used in the XML declaration. - /** - \tparam String Arbitrary string-like type: e.g. std::string, wchar_t*, char[], wchar_t, wxString, MyStringClass, ... - */ - template <class String> - void setStandalone(const String& standalone) { standalone_ = utfTo<std::string>(standalone); } + void setStandalone(const std::string& standalone) { standalone_ = standalone; } //Transactionally swap two elements. -> disabled documentation extraction void swap(XmlDoc& other) noexcept |