You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.8 KiB
C++
114 lines
3.8 KiB
C++
// Copyright John W. Wilkinson 2007 - 2014
|
|
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|
|
|
// json spirit version 4.08
|
|
|
|
#include "json_spirit_writer.h"
|
|
#include "json_spirit_writer_template.h"
|
|
|
|
using namespace json_spirit;
|
|
|
|
#ifdef JSON_SPIRIT_VALUE_ENABLED
|
|
void json_spirit::write( const Value& value, std::ostream& os, int options, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, options, precision_of_doubles );
|
|
}
|
|
std::string json_spirit::write( const Value& value, int options, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, options, precision_of_doubles );
|
|
}
|
|
|
|
void json_spirit::write_formatted( const Value& value, std::ostream& os, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, pretty_print, precision_of_doubles );
|
|
}
|
|
|
|
std::string json_spirit::write_formatted( const Value& value, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, pretty_print, precision_of_doubles );
|
|
}
|
|
#endif
|
|
|
|
#ifdef JSON_SPIRIT_MVALUE_ENABLED
|
|
void json_spirit::write( const mValue& value, std::ostream& os, int options, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, options, precision_of_doubles );
|
|
}
|
|
|
|
std::string json_spirit::write( const mValue& value, int options, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, options, precision_of_doubles );
|
|
}
|
|
|
|
void json_spirit::write_formatted( const mValue& value, std::ostream& os, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, pretty_print, precision_of_doubles );
|
|
}
|
|
|
|
std::string json_spirit::write_formatted( const mValue& value, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, pretty_print, precision_of_doubles );
|
|
}
|
|
#endif
|
|
|
|
#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
|
|
void json_spirit::write( const wValue& value, std::wostream& os, int options, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, options, precision_of_doubles );
|
|
}
|
|
|
|
std::wstring json_spirit::write( const wValue& value, int options, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, options, precision_of_doubles );
|
|
}
|
|
|
|
void json_spirit::write_formatted( const wValue& value, std::wostream& os, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, pretty_print, precision_of_doubles );
|
|
}
|
|
|
|
std::wstring json_spirit::write_formatted( const wValue& value, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, pretty_print, precision_of_doubles );
|
|
}
|
|
#endif
|
|
|
|
#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
|
|
void json_spirit::write_formatted( const wmValue& value, std::wostream& os, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, pretty_print, precision_of_doubles );
|
|
}
|
|
|
|
std::wstring json_spirit::write_formatted( const wmValue& value, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, pretty_print, precision_of_doubles );
|
|
}
|
|
|
|
void json_spirit::write( const wmValue& value, std::wostream& os, int options, unsigned int precision_of_doubles )
|
|
{
|
|
write_stream( value, os, options, precision_of_doubles );
|
|
}
|
|
|
|
std::wstring json_spirit::write( const wmValue& value, int options, unsigned int precision_of_doubles )
|
|
{
|
|
return write_string( value, options, precision_of_doubles );
|
|
}
|
|
#endif
|
|
|
|
namespace json_spirit
|
|
{
|
|
|
|
template<>
|
|
std::string simple_write(const Value& v)
|
|
{
|
|
return json_spirit::write(v);
|
|
}
|
|
|
|
template<>
|
|
std::string simple_write(const mValue& v)
|
|
{
|
|
return json_spirit::write(v);
|
|
}
|
|
|
|
}
|