fixed: in serialize_json_double(): the buffer length was calculated incorrectly: sizeof(char) changed to sizeof(wchar_t)
added to Space struct: void set_null(); void set_empty_string(); void set_empty_wstring(); void set_empty_table(); void set_empty_object(); void clear();
This commit is contained in:
@@ -156,6 +156,39 @@ Space::Space(const Space * space)
|
||||
}
|
||||
|
||||
|
||||
void Space::clear()
|
||||
{
|
||||
set_null();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Space::set_null()
|
||||
{
|
||||
initialize_value_null_if_needed();
|
||||
}
|
||||
|
||||
void Space::set_empty_string()
|
||||
{
|
||||
initialize_value_string_if_needed();
|
||||
}
|
||||
|
||||
void Space::set_empty_wstring()
|
||||
{
|
||||
initialize_value_wstring_if_needed();
|
||||
}
|
||||
|
||||
void Space::set_empty_table()
|
||||
{
|
||||
initialize_value_table_if_needed();
|
||||
}
|
||||
|
||||
void Space::set_empty_object()
|
||||
{
|
||||
initialize_value_object_if_needed();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Space::set(bool val)
|
||||
@@ -220,14 +253,28 @@ void Space::set(double val)
|
||||
|
||||
void Space::set(const char * str)
|
||||
{
|
||||
initialize_value_string_if_needed();
|
||||
value.value_string = str;
|
||||
if( str == nullptr )
|
||||
{
|
||||
initialize_value_null_if_needed();
|
||||
}
|
||||
else
|
||||
{
|
||||
initialize_value_string_if_needed();
|
||||
value.value_string = str;
|
||||
}
|
||||
}
|
||||
|
||||
void Space::set(const wchar_t * str)
|
||||
{
|
||||
initialize_value_wstring_if_needed();
|
||||
value.value_wstring = str;
|
||||
if( str == nullptr )
|
||||
{
|
||||
initialize_value_null_if_needed();
|
||||
}
|
||||
else
|
||||
{
|
||||
initialize_value_wstring_if_needed();
|
||||
value.value_wstring = str;
|
||||
}
|
||||
}
|
||||
|
||||
void Space::set(const std::string & str)
|
||||
|
Reference in New Issue
Block a user