1
1

jsonPrimitive.cpp 923 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * jsonPrimitive.cpp for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #include "jsonPrimitive.hh"
  7. AJSonPrimitive::~AJSonPrimitive()
  8. {}
  9. template<> JSonPrimitive<double>::~JSonPrimitive() {}
  10. template<> JSonPrimitive<bool>::~JSonPrimitive() {}
  11. template<> JSonPrimitive<int>::~JSonPrimitive() {}
  12. template<> JSonPrimitive<long long>::~JSonPrimitive() {}
  13. template<> JSonPrimitive<std::string>::~JSonPrimitive() {}
  14. template<> std::string JSonPrimitive<std::string>::toString() const
  15. { return value; }
  16. template<> std::string JSonPrimitive<double>::toString() const
  17. {
  18. return std::to_string(value);
  19. }
  20. template<> std::string JSonPrimitive<long long>::toString() const
  21. {
  22. return std::to_string(value);
  23. }
  24. template<> std::string JSonPrimitive<int>::toString() const
  25. {
  26. return std::to_string(value);
  27. }
  28. template<> std::string JSonPrimitive<bool>::toString() const
  29. { return value ? "true" : "false"; }