31#ifndef API_MIP_JSON_VALUE_H_
32#define API_MIP_JSON_VALUE_H_
67 virtual bool HasMember(
const std::string& key)
const = 0;
71 virtual void PushBack(
const std::shared_ptr<JsonValue>& jsonValue) = 0;
76 virtual void PushBack(
const std::string& member) = 0;
80 virtual void AddMember(
const std::string& key,
const std::shared_ptr<JsonValue>& jsonValue) = 0;
86 virtual void AddMember(
const std::string& key,
const std::string& member) = 0;
92 virtual void AddMember(
const std::string& key,
bool member) = 0;
98 virtual void AddMember(
const std::string& key,
int member) = 0;
104 virtual void AddMember(
const std::string& key,
unsigned int member) = 0;
110 virtual std::shared_ptr<JsonValue>
GetMember(
const std::string& key)
const = 0;
115 virtual std::shared_ptr<JsonValue>
GetMember(
unsigned int index)
const = 0;
120 virtual size_t Size()
const = 0;
virtual std::vector< std::string > GetStringArray() const =0
return value array as strings, skip non string elements.
virtual int GetInt() const =0
If the current value is an int, return it.
virtual void AddMember(const std::string &key, unsigned int member)=0
Add an unsigned integer member to an Object with the specified key and value.
virtual std::string SerializeToString() const =0
Serialize the value and all children as a string.
virtual void AddMember(const std::string &key, const std::shared_ptr< JsonValue > &jsonValue)=0
Add a value member to an Object.
virtual double GetDouble() const =0
If the current value is a double, return it.
virtual bool IsObject() const =0
check if value is a json object.
virtual bool IsUint() const =0
Return true if the current value is an unsigned int.
virtual void PushBack(const std::string &member)=0
Add a string member to an Array with the specified value.
virtual bool IsInt() const =0
Returns true if the current value is an int.
virtual void PushBack(const std::shared_ptr< JsonValue > &jsonValue)=0
Add a value member to an Array.
virtual void AddMember(const std::string &key, int member)=0
Add a signed integer member to an Object with the specified key and value.
virtual bool IsArray() const =0
check if value is a json array.
virtual bool GetBool() const =0
If the current value is a bool, return it.
virtual void AddMember(const std::string &key, bool member)=0
Add a boolean member to an Object with the specified key and value.
virtual size_t Size() const =0
return number of child elements.
virtual bool IsBool() const =0
Return true if the current value is a bool.
virtual unsigned int GetUint() const =0
If the current value is a uint, return it.
virtual bool HasMember(const std::string &key) const =0
return true if object has a child with the specified key.
virtual bool IsNumber() const =0
Return true if the current value is a number of any type.
virtual bool IsString() const =0
check if value is a string.
virtual std::shared_ptr< JsonValue > GetMember(unsigned int index) const =0
return child value at specified index if this is an Array.
virtual std::vector< std::pair< std::string, std::string > > GetStringObjectMembers() const =0
Return all string members of this object and their keys, skip non string elements.
virtual std::shared_ptr< JsonValue > GetMember(const std::string &key) const =0
return child value with the specified key if this is an Object.
virtual void AddMember(const std::string &key, const std::string &member)=0
virtual std::string GetString() const =0
If the current value is a string, return it.