diff --git a/XML/include/Poco/XML/Content.h b/XML/include/Poco/XML/Content.h index 2dde448c0..6a5630304 100644 --- a/XML/include/Poco/XML/Content.h +++ b/XML/include/Poco/XML/Content.h @@ -1,15 +1,32 @@ -// file : xml/content -*- C++ -*- -// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// +// Content.h +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: Content +// +// Definition of the Content enum. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file + #ifndef POCO_XML_CONTENT #define POCO_XML_CONTENT + namespace Poco { namespace XML { + /// XML content model. C++11 enum class emulated for C++98. struct Content { diff --git a/XML/include/Poco/XML/QName.h b/XML/include/Poco/XML/QName.h index 2e332800b..881957c3a 100644 --- a/XML/include/Poco/XML/QName.h +++ b/XML/include/Poco/XML/QName.h @@ -1,4 +1,18 @@ -// file : cutl/xml/QName.hxx +// +// QName.h +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: QName +// +// Definition of the QName class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file @@ -28,31 +42,12 @@ public: QName(const std::string& ns, const std::string& name); QName(const std::string& ns, const std::string& name, const std::string& prefix); - const std::string& namespace_() const - { - return _ns; - } - const std::string& name() const - { - return _name; - } - const std::string& prefix() const - { - return _prefix; - } - - std::string& namespace_() - { - return _ns; - } - std::string& name() - { - return _name; - } - std::string& prefix() - { - return _prefix; - } + const std::string& namespace_() const; + const std::string& name() const; + const std::string& prefix() const; + std::string& namespace_(); + std::string& name(); + std::string& prefix(); // Printable representation in the [#] form. // @@ -82,7 +77,45 @@ private: std::string _prefix; }; + +inline const std::string& QName::namespace_() const +{ + return _ns; +} + + +inline const std::string& QName::name() const +{ + return _name; +} + + +inline const std::string& QName::prefix() const +{ + return _prefix; +} + + +inline std::string& QName::namespace_() +{ + return _ns; +} + + +inline std::string& QName::name() +{ + return _name; +} + + +inline std::string& QName::prefix() +{ + return _prefix; +} + + XML_API std::ostream& operator<<(std::ostream&, const QName&); + } } diff --git a/XML/include/Poco/XML/ValueTraits.h b/XML/include/Poco/XML/ValueTraits.h index 18088dbae..fba860192 100644 --- a/XML/include/Poco/XML/ValueTraits.h +++ b/XML/include/Poco/XML/ValueTraits.h @@ -1,25 +1,43 @@ -// file : cutl/xml/value-traits.hxx +// +// ValueTraits.h +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: ValueTraits +// +// Definition of the ValueTraits templates. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file + #ifndef POCO_XML_VALUE_TRAITS_HXX #define POCO_XML_VALUE_TRAITS_HXX + +#include "XMLStreamParserException.h" +#include "XMLStreamSerializerException.h" #include #include // std::size_t #include #include -#include "XMLStreamParserException.h" -#include "XMLStreamSerializerException.h" - namespace Poco { namespace XML { + + class XMLStreamParser; class XMLStreamSerializer; + template struct default_value_traits { @@ -30,6 +48,7 @@ struct default_value_traits serialize(const T&, const XMLStreamSerializer&); }; + template<> struct XML_API default_value_traits { @@ -42,6 +61,7 @@ struct XML_API default_value_traits } }; + template<> struct XML_API default_value_traits { @@ -56,16 +76,19 @@ struct XML_API default_value_traits } }; + template struct ValueTraits: default_value_traits { }; + template struct ValueTraits : default_value_traits { }; + template T default_value_traits::parse(std::string s, const XMLStreamParser& p) { @@ -76,6 +99,7 @@ T default_value_traits::parse(std::string s, const XMLStreamParser& p) return r; } + template std::string default_value_traits::serialize(const T& v, const XMLStreamSerializer& s) { @@ -84,6 +108,8 @@ std::string default_value_traits::serialize(const T& v, const XMLStreamSerial throw XMLStreamSerializerException(s, "invalid value"); return os.str(); } + + } } diff --git a/XML/src/QName.cpp b/XML/src/QName.cpp index 198413a76..5cbd5da3f 100644 --- a/XML/src/QName.cpp +++ b/XML/src/QName.cpp @@ -1,4 +1,18 @@ -// file : cutl/xml/QName.cxx +// +// QName.cpp +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: QName +// +// Definition of the QName class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file diff --git a/XML/src/ValueTraits.cpp b/XML/src/ValueTraits.cpp index 69cd41c0b..f11c33b5a 100644 --- a/XML/src/ValueTraits.cpp +++ b/XML/src/ValueTraits.cpp @@ -1,17 +1,35 @@ -// file : cutl/xml/value-traits.cxx +// +// ValueTraits.cpp +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: ValueTraits +// +// Definition of the ValueTraits templates. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file + #include "Poco/XML/XMLStreamParser.h" #include "Poco/XML/XMLStreamParserException.h" + using namespace std; + namespace Poco { namespace XML { + bool default_value_traits::parse(string s, const XMLStreamParser& p) { if (s == "true" || s == "1" || s == "True" || s == "TRUE") @@ -22,5 +40,6 @@ bool default_value_traits::parse(string s, const XMLStreamParser& p) throw XMLStreamParserException(p, "invalid bool value '" + s + "'"); } + } }