jsonPrimitive.cpp 806 B

123456789101112131415161718192021222324252627282930313233
  1. #include "jsonPrimitive.hh"
  2. template<> JSonPrimitive<float>::~JSonPrimitive() {}
  3. template<> JSonPrimitive<bool>::~JSonPrimitive() {}
  4. template<> JSonPrimitive<int>::~JSonPrimitive() {}
  5. template<> JSonPrimitive<long long>::~JSonPrimitive() {}
  6. template<> JSonPrimitive<std::string>::~JSonPrimitive() {}
  7. template<> std::string JSonPrimitive<std::string>::stringify() const
  8. {
  9. return value;
  10. }
  11. template<> std::string JSonPrimitive<float>::stringify() const
  12. {
  13. return std::to_string(value);
  14. }
  15. template<> std::string JSonPrimitive<long long>::stringify() const
  16. {
  17. return std::to_string(value);
  18. }
  19. template<> std::string JSonPrimitive<int>::stringify() const
  20. {
  21. return std::to_string(value);
  22. }
  23. template<> std::string JSonPrimitive<bool>::stringify() const
  24. {
  25. return value ? "true" : "false";
  26. }