summaryrefslogtreecommitdiffstats
path: root/contrib/libs/poco/XML/src/XMLStreamParserException.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <[email protected]>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/libs/poco/XML/src/XMLStreamParserException.cpp
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/libs/poco/XML/src/XMLStreamParserException.cpp')
-rw-r--r--contrib/libs/poco/XML/src/XMLStreamParserException.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/contrib/libs/poco/XML/src/XMLStreamParserException.cpp b/contrib/libs/poco/XML/src/XMLStreamParserException.cpp
new file mode 100644
index 00000000000..d7b01690edd
--- /dev/null
+++ b/contrib/libs/poco/XML/src/XMLStreamParserException.cpp
@@ -0,0 +1,88 @@
+//
+// XMLStreamParserException.cpp
+//
+// Library: XML
+// Package: XML
+// Module: XMLStreamParserException
+//
+// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
+// and Contributors.
+//
+// SPDX-License-Identifier: BSL-1.0
+//
+
+
+#include "Poco/XML/XMLStreamParserException.h"
+#include "Poco/XML/XMLStreamParser.h"
+
+
+namespace Poco {
+namespace XML {
+
+
+XMLStreamParserException::~XMLStreamParserException() noexcept
+{
+}
+
+
+XMLStreamParserException::XMLStreamParserException(const std::string& n, Poco::UInt64 l, Poco::UInt64 c, const std::string& d):
+ _name(n),
+ _line(l),
+ _column(c),
+ _description(d)
+{
+ init();
+}
+
+
+XMLStreamParserException::XMLStreamParserException(const XMLStreamParser& p, const std::string& d):
+ _name(p.inputName()),
+ _line(p.line()),
+ _column(p.column()),
+ _description(d)
+{
+ init();
+}
+
+
+void XMLStreamParserException::init()
+{
+ std::ostringstream os;
+ if (!_name.empty())
+ os << _name << ':';
+ os << _line << ':' << _column << ": error: " << _description;
+ _what = os.str();
+}
+
+
+const char* XMLStreamParserException::name() const noexcept
+{
+ return _name.c_str();
+}
+
+
+Poco::UInt64 XMLStreamParserException::line() const
+{
+ return _line;
+}
+
+
+Poco::UInt64 XMLStreamParserException::column() const
+{
+ return _column;
+}
+
+
+const std::string& XMLStreamParserException::description() const
+{
+ return _description;
+}
+
+
+char const* XMLStreamParserException::what() const noexcept
+{
+ return _what.c_str();
+}
+
+
+} } // namespace Poco::XML