json_spirit_writer.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Copyright John W. Wilkinson 2007 - 2009.
  2. // Distributed under the MIT License, see accompanying file LICENSE.txt
  3. // json spirit version 4.03
  4. #include "json_spirit_writer.h"
  5. #include "json_spirit_writer_template.h"
  6. void json_spirit::write( const Value& value, std::ostream& os )
  7. {
  8. write_stream( value, os, false );
  9. }
  10. void json_spirit::write_formatted( const Value& value, std::ostream& os )
  11. {
  12. write_stream( value, os, true );
  13. }
  14. std::string json_spirit::write( const Value& value )
  15. {
  16. return write_string( value, false );
  17. }
  18. std::string json_spirit::write_formatted( const Value& value )
  19. {
  20. return write_string( value, true );
  21. }
  22. #ifndef BOOST_NO_STD_WSTRING
  23. void json_spirit::write( const wValue& value, std::wostream& os )
  24. {
  25. write_stream( value, os, false );
  26. }
  27. void json_spirit::write_formatted( const wValue& value, std::wostream& os )
  28. {
  29. write_stream( value, os, true );
  30. }
  31. std::wstring json_spirit::write( const wValue& value )
  32. {
  33. return write_string( value, false );
  34. }
  35. std::wstring json_spirit::write_formatted( const wValue& value )
  36. {
  37. return write_string( value, true );
  38. }
  39. #endif
  40. void json_spirit::write( const mValue& value, std::ostream& os )
  41. {
  42. write_stream( value, os, false );
  43. }
  44. void json_spirit::write_formatted( const mValue& value, std::ostream& os )
  45. {
  46. write_stream( value, os, true );
  47. }
  48. std::string json_spirit::write( const mValue& value )
  49. {
  50. return write_string( value, false );
  51. }
  52. std::string json_spirit::write_formatted( const mValue& value )
  53. {
  54. return write_string( value, true );
  55. }
  56. #ifndef BOOST_NO_STD_WSTRING
  57. void json_spirit::write( const wmValue& value, std::wostream& os )
  58. {
  59. write_stream( value, os, false );
  60. }
  61. void json_spirit::write_formatted( const wmValue& value, std::wostream& os )
  62. {
  63. write_stream( value, os, true );
  64. }
  65. std::wstring json_spirit::write( const wmValue& value )
  66. {
  67. return write_string( value, false );
  68. }
  69. std::wstring json_spirit::write_formatted( const wmValue& value )
  70. {
  71. return write_string( value, true );
  72. }
  73. #endif