diff options
author | B Stack <bgstack15@gmail.com> | 2018-11-13 06:58:56 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-11-13 06:58:56 -0500 |
commit | 076498028ff511afd88d93e7b0bf1d1a81093b3d (patch) | |
tree | 30bf08d782d58174a0ca212b2e4b172fabd9c42c /zenXml | |
parent | Merge branch '10.5' into 'master' (diff) | |
download | FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.gz FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.tar.bz2 FreeFileSync-076498028ff511afd88d93e7b0bf1d1a81093b3d.zip |
10.6
Diffstat (limited to 'zenXml')
-rwxr-xr-x | zenXml/zenxml/parser.h | 2 | ||||
-rwxr-xr-x | zenXml/zenxml/xml.h | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/zenXml/zenxml/parser.h b/zenXml/zenxml/parser.h index a90d163a..70bf6654 100755 --- a/zenXml/zenxml/parser.h +++ b/zenXml/zenxml/parser.h @@ -316,7 +316,7 @@ public: Token getNextToken() //throw XmlParsingError { //skip whitespace - pos_ = std::find_if(pos_, stream_.end(), std::not_fn(isWhiteSpace<char>)); + pos_ = std::find_if_not(pos_, stream_.end(), isWhiteSpace<char>); if (pos_ == stream_.end()) return Token::TK_END; diff --git a/zenXml/zenxml/xml.h b/zenXml/zenxml/xml.h index 5eddc462..15d635bd 100755 --- a/zenXml/zenxml/xml.h +++ b/zenXml/zenxml/xml.h @@ -277,12 +277,12 @@ public: { bool success = readStruc(*refList_[refIndex_], value); if (!success) - log_->notifyConversionError(getNameFormatted()); + log_.ref().notifyConversionError(getNameFormatted()); return success; } else { - log_->notifyMissingElement(getNameFormatted()); + log_.ref().notifyMissingElement(getNameFormatted()); return false; } } @@ -312,12 +312,12 @@ public: { bool success = refList_[refIndex_]->getAttribute(name, value); if (!success) - log_->notifyMissingAttribute(getNameFormatted(), utfTo<std::string>(name)); + log_.ref().notifyMissingAttribute(getNameFormatted(), utfTo<std::string>(name)); return success; } else { - log_->notifyMissingElement(getNameFormatted()); + log_.ref().notifyMissingElement(getNameFormatted()); return false; } } @@ -357,7 +357,7 @@ public: However be aware that the chain of connected proxy instances will be broken once you call XmlIn::get() to retrieve the underlying pointer. Errors that occur when working with this pointer are not logged by the original set of related instances. */ - bool haveErrors() const { return !log_->elementList().empty(); } + bool haveErrors() const { return !log_.ref().elementList().empty(); } ///Get a list of XML element and attribute names which failed to convert to user data. /** @@ -368,13 +368,13 @@ public: std::vector<String> getErrorsAs() const { std::vector<String> output; - const auto& elements = log_->elementList(); + const auto& elements = log_.ref().elementList(); std::transform(elements.begin(), elements.end(), std::back_inserter(output), [](const std::string& str) { return utfTo<String>(str); }); return output; } private: - XmlIn(const std::vector<const XmlElement*>& siblingList, const std::string& elementNameFmt, const std::shared_ptr<ErrorLog>& sharedlog) : + XmlIn(const std::vector<const XmlElement*>& siblingList, const std::string& elementNameFmt, const SharedRef<ErrorLog>& sharedlog) : refList_(siblingList), formattedName_(elementNameFmt), log_(sharedlog) { assert((!siblingList.empty() && elementNameFmt.empty()) || (siblingList.empty() && !elementNameFmt.empty())); } @@ -423,7 +423,7 @@ private: std::vector<const XmlElement*> refList_; //all sibling elements with same name (all pointers bound!) size_t refIndex_ = 0; //this sibling's index in refList_ std::string formattedName_; //contains full and formatted element name if (and only if) refList_ is empty - std::shared_ptr<ErrorLog> log_{ std::make_shared<ErrorLog>() }; //always bound + mutable SharedRef<ErrorLog> log_ = makeSharedRef<ErrorLog>(); }; |