Go to the documentation of this file.
23 #include <boost/regex.hpp>
111 throw LocalException(
"Invalid value: ") << value;
134 throw LocalException(
"Invalid type.");
140 boost::regex re(
"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$");
141 boost::match_results<std::string::const_iterator> results;
142 return boost::regex_match(value, results, re, boost::regex_constants::match_default) != 0;
148 boost::regex re(
"^-?\\d+$");
149 boost::match_results<std::string::const_iterator> results;
150 return boost::regex_match(value, results, re, boost::regex_constants::match_default) != 0;
156 return value ==
"true" || value ==
"false";
162 return value ==
"null";
173 writer->writeRawValue(
value);
192 std::ostringstream oss;
193 oss.imbue(std::locale::classic());
201 std::ostringstream oss;
202 oss.imbue(std::locale::classic());
210 std::ostringstream oss;
211 oss.imbue(std::locale::classic());
219 std::ostringstream oss;
220 oss.imbue(std::locale::classic());
230 throw LocalException(
"Invalid type");
240 throw LocalException(
"Invalid type");
250 throw LocalException(
"Invalid type");
260 throw LocalException(
"Invalid type");
262 return value ==
"true";
std::shared_ptr< JsonValue > JsonValuePtr
static JsonValuePtr True()
float toFloat(const std::string &input)
Converts a string to float and uses always dot as seperator.
static JsonValuePtr False()
static bool CheckInt(const std::string &value)
JsonValuePtr toSharedPtr() const
static JsonValuePtr Create(const std::string &value)
JsonDataPtr clone() override
std::shared_ptr< JsonWriter > JsonWriterPtr
static bool CheckNumber(const std::string &value)
std::shared_ptr< Value > value()
static bool CheckNull(const std::string &value)
std::string asString() const
void writeJson(const JsonWriterPtr &writer) override
static std::string EscapeQuote(const std::string &str)
static std::string ToString(int value)
static bool CheckValue(Type type, const std::string &value)
JsonValue(const std::string &value)
std::shared_ptr< JsonData > JsonDataPtr
static bool CheckBool(const std::string &value)
static JsonValuePtr CreateRaw(Type type, const std::string &value)
This file offers overloads of toIce() and fromIce() functions for STL container types.
static JsonValuePtr Null()