Skip to content

Fixed use of inline #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/util/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,53 +24,53 @@ class jsont
J_TRUE, J_FALSE, J_NULL } kindt;
kindt kind;

inline bool is_string() const
bool is_string() const
{
return kind==J_STRING;
}

inline bool is_number() const
bool is_number() const
{
return kind==J_NUMBER;
}

inline bool is_object() const
bool is_object() const
{
return kind==J_OBJECT;
}

inline bool is_array() const
bool is_array() const
{
return kind==J_ARRAY;
}

inline bool is_true() const
bool is_true() const
{
return kind==J_TRUE;
}

inline bool is_false() const
bool is_false() const
{
return kind==J_FALSE;
}

inline bool is_null() const
bool is_null() const
{
return kind==J_NULL;
}

inline jsont():kind(J_NULL)
jsont():kind(J_NULL)
{
}

inline void output(std::ostream &out) const
void output(std::ostream &out) const
{
output_rec(out, 0);
}

void swap(jsont &other);

inline static jsont json_boolean(bool value)
static jsont json_boolean(bool value)
{
return jsont(value?J_TRUE:J_FALSE);
}
Expand All @@ -83,11 +83,11 @@ class jsont
array.clear();
}

inline json_arrayt &make_array();
inline json_objectt &make_object();
json_arrayt &make_array();
json_objectt &make_object();

// this presumes that this is an object
inline const jsont &operator[](const std::string &key) const
const jsont &operator[](const std::string &key) const
{
objectt::const_iterator it=object.find(key);
if(it==object.end())
Expand All @@ -102,11 +102,11 @@ class jsont

static const jsont null_json_object;

inline explicit jsont(kindt _kind):kind(_kind)
explicit jsont(kindt _kind):kind(_kind)
{
}

inline jsont(kindt _kind, const std::string &_value):kind(_kind), value(_value)
jsont(kindt _kind, const std::string &_value):kind(_kind), value(_value)
{
}

Expand Down Expand Up @@ -134,7 +134,7 @@ class json_arrayt:public jsont
{
}

inline void resize(std::size_t size)
void resize(std::size_t size)
{
array.resize(size);
}
Expand All @@ -144,13 +144,13 @@ class json_arrayt:public jsont
return array.size();
}

inline jsont &push_back(const jsont &json)
jsont &push_back(const jsont &json)
{
array.push_back(json);
return static_cast<jsont &>(array.back());
}

inline jsont &push_back()
jsont &push_back()
{
array.push_back(jsont());
return static_cast<jsont &>(array.back());
Expand Down Expand Up @@ -182,12 +182,12 @@ class json_objectt:public jsont
{
}

inline jsont &operator[](const std::string &key)
jsont &operator[](const std::string &key)
{
return object[key];
}

inline const jsont &operator[](const std::string &key) const
const jsont &operator[](const std::string &key) const
{
objectt::const_iterator it=object.find(key);
if(it==object.end())
Expand Down Expand Up @@ -215,13 +215,13 @@ class json_nullt:public jsont
json_nullt():jsont(J_NULL) { }
};

json_arrayt &jsont::make_array()
inline json_arrayt &jsont::make_array()
{
kind=J_ARRAY;
return static_cast<json_arrayt &>(*this);
}

json_objectt &jsont::make_object()
inline json_objectt &jsont::make_object()
{
kind=J_OBJECT;
return static_cast<json_objectt &>(*this);
Expand Down