ClickHouse/base/poco/XML/src/ValueTraits.cpp
Robert Schulze b79ead9c84
Move poco to base/poco/ (#46075)
* Replicate poco into base/poco/

* De-register poco submodule

* Build poco from ClickHouse

* Exclude poco from stylecheck

* Exclude poco from whitespace check

* Exclude poco from typo check

* Remove x bit from sources/headers (the style check complained)

* Exclude poco from duplicate include check

* Fix fasttest

* Remove contrib/poco-cmake/*

* Simplify poco build descriptions

* Remove poco stuff not used by ClickHouse

* Glob poco sources

* Exclude poco from clang-tidy
2023-02-08 12:04:11 +01:00

40 lines
866 B
C++

//
// ValueTraits.cpp
//
// Library: XML
// Package: XML
// Module: ValueTraits
//
// Definition of the ValueTraits templates.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Based on libstudxml (http://www.codesynthesis.com/projects/libstudxml/).
// Copyright (c) 2009-2013 Code Synthesis Tools CC.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/XML/XMLStreamParser.h"
#include "Poco/XML/XMLStreamParserException.h"
namespace Poco {
namespace XML {
bool DefaultValueTraits<bool>::parse(std::string s, const XMLStreamParser& p)
{
if (s == "true" || s == "1" || s == "True" || s == "TRUE")
return true;
else if (s == "false" || s == "0" || s == "False" || s == "FALSE")
return false;
else
throw XMLStreamParserException(p, "invalid bool value '" + s + "'");
}
} } // namespace Poco::XML