Go to the documentation of this file.
25 #include <boost/regex.hpp>
99 throw LocalException(
"Invalid value: ") << value;
121 throw LocalException(
"Invalid type.");
126 boost::regex re(
"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$");
127 boost::match_results<std::string::const_iterator> results;
128 return boost::regex_match(value, results, re, boost::regex_constants::match_default) != 0;
133 boost::regex re(
"^-?\\d+$");
134 boost::match_results<std::string::const_iterator> results;
135 return boost::regex_match(value, results, re, boost::regex_constants::match_default) != 0;
140 return value ==
"true" || value ==
"false";
145 return value ==
"null";
155 writer->writeRawValue(
value);
172 std::ostringstream oss;
173 oss.imbue(std::locale::classic());
180 std::ostringstream oss;
181 oss.imbue(std::locale::classic());
188 std::ostringstream oss;
189 oss.imbue(std::locale::classic());
196 std::ostringstream oss;
197 oss.imbue(std::locale::classic());
206 throw LocalException(
"Invalid type");
215 throw LocalException(
"Invalid type");
224 throw LocalException(
"Invalid type");
233 throw LocalException(
"Invalid type");
235 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()