json_formatter.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * libnbt++ - A library for the Minecraft Named Binary Tag format.
  3. * Copyright (C) 2013, 2015 ljfa-ag
  4. *
  5. * This file is part of libnbt++.
  6. *
  7. * libnbt++ is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * libnbt++ is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License
  18. * along with libnbt++. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef JSON_FORMATTER_H_INCLUDED
  21. #define JSON_FORMATTER_H_INCLUDED
  22. #include "tagfwd.h"
  23. #include <ostream>
  24. #include "nbt_export.h"
  25. namespace nbt
  26. {
  27. namespace text
  28. {
  29. /**
  30. * @brief Prints tags in a JSON-like syntax into a stream
  31. *
  32. * @todo Make it configurable and able to produce actual standard-conformant JSON
  33. */
  34. class NBT_EXPORT json_formatter
  35. {
  36. public:
  37. json_formatter() {}
  38. void print(std::ostream& os, const tag& t) const;
  39. };
  40. }
  41. }
  42. #endif // JSON_FORMATTER_H_INCLUDED