jsonPrimitive.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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<Null>::~JSonPrimitive() {}
  10. template<> JSonPrimitive<double>::~JSonPrimitive() {}
  11. template<> JSonPrimitive<bool>::~JSonPrimitive() {}
  12. template<> JSonPrimitive<int>::~JSonPrimitive() {}
  13. template<> JSonPrimitive<long long>::~JSonPrimitive() {}
  14. template<> JSonPrimitive<std::string>::~JSonPrimitive() {}
  15. template<> std::string JSonPrimitive<std::string>::toString() const
  16. { return value; }
  17. template<> std::string JSonPrimitive<Null>::toString() const
  18. { return "null"; }
  19. template<> std::string JSonPrimitive<double>::toString() const
  20. {
  21. return std::to_string(value);
  22. }
  23. template<> std::string JSonPrimitive<long long>::toString() const
  24. {
  25. return std::to_string(value);
  26. }
  27. template<> std::string JSonPrimitive<int>::toString() const
  28. {
  29. return std::to_string(value);
  30. }
  31. template<> std::string JSonPrimitive<bool>::toString() const
  32. { return value ? "true" : "false"; }