diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/XML/src/Name.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/XML/src/Name.cpp')
-rw-r--r-- | contrib/libs/poco/XML/src/Name.cpp | 338 |
1 files changed, 169 insertions, 169 deletions
diff --git a/contrib/libs/poco/XML/src/Name.cpp b/contrib/libs/poco/XML/src/Name.cpp index 832afec8df..89e23dbef4 100644 --- a/contrib/libs/poco/XML/src/Name.cpp +++ b/contrib/libs/poco/XML/src/Name.cpp @@ -1,170 +1,170 @@ -// -// Name.cpp -// -// Library: XML -// Package: XML -// Module: Name -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/XML/Name.h" -#include <algorithm> - - -namespace Poco { -namespace XML { - - -const XMLString Name::EMPTY_NAME; - - -Name::Name() -{ -} - - -Name::Name(const XMLString& qname): - _qname(qname) -{ -} - - -Name::Name(const XMLString& qname, const XMLString& namespaceURI): - _qname(qname), - _namespaceURI(namespaceURI), - _localName(localName(qname)) -{ -} - - -Name::Name(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName): - _qname(qname), - _namespaceURI(namespaceURI), - _localName(localName) -{ -} - - -Name::Name(const Name& name): - _qname(name._qname), - _namespaceURI(name._namespaceURI), - _localName(name._localName) -{ -} - - -Name::~Name() -{ -} - - -Name& Name::operator = (const Name& name) -{ - if (this != &name) - { - _qname = name._qname; - _namespaceURI = name._namespaceURI; - _localName = name._localName; - } - return *this; -} - - -void Name::swap(Name& name) -{ - std::swap(_qname, name._qname); - std::swap(_namespaceURI, name._namespaceURI); - std::swap(_localName, name._localName); -} - - -void Name::assign(const XMLString& qname) -{ - _qname = qname; - _namespaceURI.clear(); - _localName.clear(); -} - - -void Name::assign(const XMLString& qname, const XMLString& namespaceURI) -{ - _qname = qname; - _namespaceURI = namespaceURI; - _localName = localName(qname); -} - - -void Name::assign(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) -{ - _qname = qname; - _namespaceURI = namespaceURI; - _localName = localName; -} - - -bool Name::equals(const Name& name) const -{ - return name._namespaceURI == _namespaceURI && name._localName == _localName && name._qname == _qname; -} - - -bool Name::equals(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const -{ - return _namespaceURI == namespaceURI && _localName == localName && _qname == qname; -} - - -bool Name::equalsWeakly(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const -{ - return (_qname == qname && !qname.empty()) || (_namespaceURI == namespaceURI && _localName == localName && !_localName.empty()); -} - - -XMLString Name::prefix() const -{ - return prefix(_qname); -} - - -void Name::split(const XMLString& qname, XMLString& prefix, XMLString& localName) -{ - XMLString::size_type pos = qname.find(':'); - if (pos != XMLString::npos) - { - prefix.assign(qname, 0, pos); - localName.assign(qname, pos + 1, qname.size() - pos - 1); - } - else - { - prefix.clear(); - localName.assign(qname); - } -} - - -XMLString Name::localName(const XMLString& qname) -{ - XMLString::size_type pos = qname.find(':'); +// +// Name.cpp +// +// Library: XML +// Package: XML +// Module: Name +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/XML/Name.h" +#include <algorithm> + + +namespace Poco { +namespace XML { + + +const XMLString Name::EMPTY_NAME; + + +Name::Name() +{ +} + + +Name::Name(const XMLString& qname): + _qname(qname) +{ +} + + +Name::Name(const XMLString& qname, const XMLString& namespaceURI): + _qname(qname), + _namespaceURI(namespaceURI), + _localName(localName(qname)) +{ +} + + +Name::Name(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName): + _qname(qname), + _namespaceURI(namespaceURI), + _localName(localName) +{ +} + + +Name::Name(const Name& name): + _qname(name._qname), + _namespaceURI(name._namespaceURI), + _localName(name._localName) +{ +} + + +Name::~Name() +{ +} + + +Name& Name::operator = (const Name& name) +{ + if (this != &name) + { + _qname = name._qname; + _namespaceURI = name._namespaceURI; + _localName = name._localName; + } + return *this; +} + + +void Name::swap(Name& name) +{ + std::swap(_qname, name._qname); + std::swap(_namespaceURI, name._namespaceURI); + std::swap(_localName, name._localName); +} + + +void Name::assign(const XMLString& qname) +{ + _qname = qname; + _namespaceURI.clear(); + _localName.clear(); +} + + +void Name::assign(const XMLString& qname, const XMLString& namespaceURI) +{ + _qname = qname; + _namespaceURI = namespaceURI; + _localName = localName(qname); +} + + +void Name::assign(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) +{ + _qname = qname; + _namespaceURI = namespaceURI; + _localName = localName; +} + + +bool Name::equals(const Name& name) const +{ + return name._namespaceURI == _namespaceURI && name._localName == _localName && name._qname == _qname; +} + + +bool Name::equals(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const +{ + return _namespaceURI == namespaceURI && _localName == localName && _qname == qname; +} + + +bool Name::equalsWeakly(const XMLString& qname, const XMLString& namespaceURI, const XMLString& localName) const +{ + return (_qname == qname && !qname.empty()) || (_namespaceURI == namespaceURI && _localName == localName && !_localName.empty()); +} + + +XMLString Name::prefix() const +{ + return prefix(_qname); +} + + +void Name::split(const XMLString& qname, XMLString& prefix, XMLString& localName) +{ + XMLString::size_type pos = qname.find(':'); if (pos != XMLString::npos) - return XMLString(qname, pos + 1, qname.size() - pos - 1); - else - return qname; -} - - -XMLString Name::prefix(const XMLString& qname) -{ - XMLString::size_type pos = qname.find(':'); - if (pos != XMLString::npos) - return XMLString(qname, 0, pos); - else - return EMPTY_NAME; -} - - -} } // namespace Poco::XML + { + prefix.assign(qname, 0, pos); + localName.assign(qname, pos + 1, qname.size() - pos - 1); + } + else + { + prefix.clear(); + localName.assign(qname); + } +} + + +XMLString Name::localName(const XMLString& qname) +{ + XMLString::size_type pos = qname.find(':'); + if (pos != XMLString::npos) + return XMLString(qname, pos + 1, qname.size() - pos - 1); + else + return qname; +} + + +XMLString Name::prefix(const XMLString& qname) +{ + XMLString::size_type pos = qname.find(':'); + if (pos != XMLString::npos) + return XMLString(qname, 0, pos); + else + return EMPTY_NAME; +} + + +} } // namespace Poco::XML |