From 076498028ff511afd88d93e7b0bf1d1a81093b3d Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 13 Nov 2018 06:58:56 -0500 Subject: 10.6 --- zenXml/zenxml/parser.h | 2 +- zenXml/zenxml/xml.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'zenXml/zenxml') 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)); + pos_ = std::find_if_not(pos_, stream_.end(), isWhiteSpace); 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(name)); + log_.ref().notifyMissingAttribute(getNameFormatted(), utfTo(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 getErrorsAs() const { std::vector 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(str); }); return output; } private: - XmlIn(const std::vector& siblingList, const std::string& elementNameFmt, const std::shared_ptr& sharedlog) : + XmlIn(const std::vector& siblingList, const std::string& elementNameFmt, const SharedRef& sharedlog) : refList_(siblingList), formattedName_(elementNameFmt), log_(sharedlog) { assert((!siblingList.empty() && elementNameFmt.empty()) || (siblingList.empty() && !elementNameFmt.empty())); } @@ -423,7 +423,7 @@ private: std::vector 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 log_{ std::make_shared() }; //always bound + mutable SharedRef log_ = makeSharedRef(); }; -- cgit