mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Add additional constructor to JsonNode from const char *
Fixes an issue where due to implicit conversion JsonNode(bool) will be called instead of expected JsonNode(std::string)
This commit is contained in:
@@ -76,6 +76,11 @@ JsonNode::JsonNode(double number)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JsonNode::JsonNode(const char * string)
|
||||||
|
: data(std::string(string))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
JsonNode::JsonNode(const std::string & string)
|
JsonNode::JsonNode(const std::string & string)
|
||||||
: data(string)
|
: data(string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
explicit JsonNode(uint32_t number);
|
explicit JsonNode(uint32_t number);
|
||||||
explicit JsonNode(int64_t number);
|
explicit JsonNode(int64_t number);
|
||||||
explicit JsonNode(double number);
|
explicit JsonNode(double number);
|
||||||
|
explicit JsonNode(const char * string);
|
||||||
explicit JsonNode(const std::string & string);
|
explicit JsonNode(const std::string & string);
|
||||||
|
|
||||||
/// Create tree from Json-formatted input
|
/// Create tree from Json-formatted input
|
||||||
|
|||||||
Reference in New Issue
Block a user