diff --git a/XML/include/Poco/XML/XMLStreamParserException.h b/XML/include/Poco/XML/XMLStreamParserException.h index 4584ff29e..e2cfd460b 100644 --- a/XML/include/Poco/XML/XMLStreamParserException.h +++ b/XML/include/Poco/XML/XMLStreamParserException.h @@ -1,14 +1,21 @@ -/// -/// \package metamodel -/// \file XMLStreamException.h -/// -/// \author Marian Krivos -/// \date Aug 21, 2015 - 6:52:24 PM -/// \brief definicia typu -/// -/// (C) Copyright 2015 R-SYS,s.r.o -/// All rights reserved. -/// +// +// XMLStreamParserException.h +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: XMLStreamParserException +// +// Definition of the XMLStreamParserException class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + #ifndef POCO_XML_XMLSTREAMPARSEREXCEPTION_H_ #define POCO_XML_XMLSTREAMPARSEREXCEPTION_H_ @@ -26,9 +33,7 @@ public Poco::XML::XMLException { public: XMLStreamParserException(const std::string& name, Poco::UInt64 line, Poco::UInt64 column, const std::string& description); - XMLStreamParserException(const XMLStreamParser&, const std::string& description); - virtual ~XMLStreamParserException() throw (); const char* name() const throw(); diff --git a/XML/include/Poco/XML/XMLStreamSerializer.h b/XML/include/Poco/XML/XMLStreamSerializer.h index 3fd3b1205..9a93f157f 100644 --- a/XML/include/Poco/XML/XMLStreamSerializer.h +++ b/XML/include/Poco/XML/XMLStreamSerializer.h @@ -1,13 +1,13 @@ // -// XMLStreamParser.h +// XMLStreamSerializer.h // // $Id$ // // Library: XML // Package: XML -// Module: XMLStreamParser +// Module: XMLStreamSerializer // -// Definition of the XMLStreamParser class. +// Definition of the XMLStreamSerializer class. // // Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. // and Contributors. @@ -17,8 +17,8 @@ // license : MIT; see accompanying LICENSE file -#ifndef POCO_XML_XMLSERIALIZER_H -#define POCO_XML_XMLSERIALIZER_H +#ifndef POCO_XML_XMLSERIALIZER_Included +#define POCO_XML_XMLSERIALIZER_Included #include "QName.h" @@ -119,8 +119,8 @@ private: void handleError(genxStatus); std::ostream& _outputStream; - std::ostream::iostate _osState_;// Original exception state. - const std::string _oname; + std::ostream::iostate _lastStreamState;// Original exception state. + const std::string _outputName; genxWriter _writer; genxSender _sender; diff --git a/XML/include/Poco/XML/XMLStreamSerializerException.h b/XML/include/Poco/XML/XMLStreamSerializerException.h index 8287765fb..d0321af88 100644 --- a/XML/include/Poco/XML/XMLStreamSerializerException.h +++ b/XML/include/Poco/XML/XMLStreamSerializerException.h @@ -1,14 +1,21 @@ -/// -/// \package metamodel -/// \file XMLStreamException.h -/// -/// \author Marian Krivos -/// \date Aug 21, 2015 - 6:52:24 PM -/// \brief definicia typu -/// -/// (C) Copyright 2015 R-SYS,s.r.o -/// All rights reserved. -/// +// +// XMLStreamSerializerException.h +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: XMLStreamSerializerException +// +// Definition of the XMLStreamSerializerException class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + #ifndef POCO_XML_XMLSTREAMSERIALIZEREXCEPTION_H_ #define POCO_XML_XMLSTREAMSERIALIZEREXCEPTION_H_ @@ -24,10 +31,9 @@ class XMLStreamSerializer; struct XML_API XMLStreamSerializerException: public Poco::XML::XMLException { - virtual ~XMLStreamSerializerException() throw (); - XMLStreamSerializerException(const std::string& name, const std::string& description); XMLStreamSerializerException(const XMLStreamSerializer&, const std::string& description); + virtual ~XMLStreamSerializerException() throw (); const char* name() const throw (); const std::string& description() const; diff --git a/XML/src/XMLStreamParserException.cpp b/XML/src/XMLStreamParserException.cpp index 37557bf62..9a7b55288 100644 --- a/XML/src/XMLStreamParserException.cpp +++ b/XML/src/XMLStreamParserException.cpp @@ -1,14 +1,21 @@ -/// -/// \package metamodel -/// \file XMLStreamException.cpp -/// -/// \author Marian Krivos -/// \date Aug 21, 2015 - 6:52:24 PM -/// \brief definicia typu -/// -/// (C) Copyright 2015 R-SYS,s.r.o -/// All rights reserved. -/// +// +// XMLStreamParserException.cpp +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: XMLStreamParserException +// +// Definition of the XMLStreamParserException class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + #include "Poco/XML/XMLStreamParserException.h" #include "Poco/XML/XMLStreamParser.h" diff --git a/XML/src/XMLStreamSerializer.cpp b/XML/src/XMLStreamSerializer.cpp index 659ebbbc1..f0fe9a6db 100644 --- a/XML/src/XMLStreamSerializer.cpp +++ b/XML/src/XMLStreamSerializer.cpp @@ -1,20 +1,37 @@ -// file : xml/XMLStreamSerializer.cxx +// +// XMLStreamSerializer.cpp +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: XMLStreamSerializer +// +// Definition of the XMLStreamSerializer class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file + #include "Poco/XML/XMLStreamSerializer.h" #include "Poco/XML/XMLStreamSerializerException.h" - #include // std::bad_alloc #include // std::strlen + using namespace std; + namespace Poco { namespace XML { + extern "C" genxStatus genx_write(void* p, constUtf8 us) { // It would have been easier to throw the exception directly, @@ -52,8 +69,11 @@ XMLStreamSerializer::~XMLStreamSerializer() } -XMLStreamSerializer::XMLStreamSerializer(ostream& os, const string& oname, unsigned short ind) - : _outputStream(os), _osState_(os.exceptions()), _oname(oname), _depth(0) +XMLStreamSerializer::XMLStreamSerializer(ostream& os, const string& oname, unsigned short ind) : + _outputStream(os), + _lastStreamState(os.exceptions()), + _outputName(oname), + _depth(0) { // Temporarily disable exceptions on the stream. // @@ -97,10 +117,10 @@ void XMLStreamSerializer::handleError(genxStatus e) // configure the stream to throw), then fall back to the // serialiation exception. // - _outputStream.exceptions(_osState_); + _outputStream.exceptions(_lastStreamState); // Fall through. default: - throw XMLStreamSerializerException(_oname, genxGetErrorMessage(_writer, e)); + throw XMLStreamSerializerException(_outputName, genxGetErrorMessage(_writer, e)); } } @@ -128,7 +148,7 @@ void XMLStreamSerializer::endElement() // Also restore the original exception state on the stream. // - _outputStream.exceptions(_osState_); + _outputStream.exceptions(_lastStreamState); } } @@ -149,7 +169,7 @@ void XMLStreamSerializer::startAttribute(const string& ns, const string& name) const std::string& XMLStreamSerializer::outputName() const { - return _oname; + return _outputName; } @@ -208,5 +228,6 @@ bool XMLStreamSerializer::lookupNamespacePrefix(const string& ns, string& p) return true; } + } } diff --git a/XML/src/XMLStreamSerializerException.cpp b/XML/src/XMLStreamSerializerException.cpp index ee5ff19a6..f31411ca3 100644 --- a/XML/src/XMLStreamSerializerException.cpp +++ b/XML/src/XMLStreamSerializerException.cpp @@ -1,14 +1,21 @@ -/// -/// \package metamodel -/// \file XMLStreamException.cpp -/// -/// \author Marian Krivos -/// \date Aug 21, 2015 - 6:52:24 PM -/// \brief definicia typu -/// -/// (C) Copyright 2015 R-SYS,s.r.o -/// All rights reserved. -/// +// +// XMLStreamSerializerException.cpp +// +// $Id$ +// +// Library: XML +// Package: XML +// Module: XMLStreamSerializerException +// +// Definition of the XMLStreamSerializerException class. +// +// Copyright (c) 2004-2015, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + #include "Poco/XML/XMLStreamParserException.h" #include "Poco/XML/XMLStreamSerializer.h"