Skip to content
Open
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
24 changes: 8 additions & 16 deletions src/JSONValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ JSONValue *JSONValue::Parse(const wchar_t **data)
*
* @access public
*/
JSONValue::JSONValue(/*NULL*/)
JSONValue::JSONValue(/*NULL*/) : type(JSONType_Null)
{
type = JSONType_Null;
}
Expand All @@ -322,9 +322,8 @@ JSONValue::JSONValue(/*NULL*/)
*
* @param wchar_t* m_char_value The string to use as the value
*/
JSONValue::JSONValue(const wchar_t *m_char_value)
JSONValue::JSONValue(const wchar_t *m_char_value) : type(JSONType_String)
{
type = JSONType_String;
string_value = new std::wstring(std::wstring(m_char_value));
}

Expand All @@ -335,9 +334,8 @@ JSONValue::JSONValue(const wchar_t *m_char_value)
*
* @param std::wstring m_string_value The string to use as the value
*/
JSONValue::JSONValue(const std::wstring &m_string_value)
JSONValue::JSONValue(const std::wstring &m_string_value) : type(JSONType_String)
{
type = JSONType_String;
string_value = new std::wstring(m_string_value);
}

Expand All @@ -348,9 +346,8 @@ JSONValue::JSONValue(const std::wstring &m_string_value)
*
* @param bool m_bool_value The bool to use as the value
*/
JSONValue::JSONValue(bool m_bool_value)
JSONValue::JSONValue(bool m_bool_value) : type(JSONType_Bool)
{
type = JSONType_Bool;
bool_value = m_bool_value;
}

Expand All @@ -361,9 +358,8 @@ JSONValue::JSONValue(bool m_bool_value)
*
* @param double m_number_value The number to use as the value
*/
JSONValue::JSONValue(double m_number_value)
JSONValue::JSONValue(double m_number_value) : type(JSONType_Number)
{
type = JSONType_Number;
number_value = m_number_value;
}

Expand All @@ -374,9 +370,8 @@ JSONValue::JSONValue(double m_number_value)
*
* @param JSONArray m_array_value The JSONArray to use as the value
*/
JSONValue::JSONValue(const JSONArray &m_array_value)
JSONValue::JSONValue(const JSONArray &m_array_value) : type(JSONType_Array)
{
type = JSONType_Array;
array_value = new JSONArray(m_array_value);
}

Expand All @@ -387,9 +382,8 @@ JSONValue::JSONValue(const JSONArray &m_array_value)
*
* @param JSONObject m_object_value The JSONObject to use as the value
*/
JSONValue::JSONValue(const JSONObject &m_object_value)
JSONValue::JSONValue(const JSONObject &m_object_value) : type(JSONType_Object)
{
type = JSONType_Object;
object_value = new JSONObject(m_object_value);
}

Expand All @@ -400,10 +394,8 @@ JSONValue::JSONValue(const JSONObject &m_object_value)
*
* @param JSONValue m_source The source JSONValue that is being copied
*/
JSONValue::JSONValue(const JSONValue &m_source)
JSONValue::JSONValue(const JSONValue &m_source) : type(m_source.type)
{
type = m_source.type;

switch (type)
{
case JSONType_String:
Expand Down