Core.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "CProject.h"
  3. #include <glm/mat4x4.hpp>
  4. #include <glm/vec2.hpp>
  5. #include <glm/vec3.hpp>
  6. #include <nlohmann/json.hpp>
  7. #include <string>
  8. namespace WallpaperEngine::Core {
  9. class CProject;
  10. glm::vec4 aToVector4 (const char* str);
  11. glm::vec3 aToVector3 (const char* str);
  12. glm::vec2 aToVector2 (const char* str);
  13. glm::vec4 aToVector4 (const std::string& str);
  14. glm::vec3 aToVector3 (const std::string& str);
  15. glm::vec2 aToVector2 (const std::string& str);
  16. glm::ivec4 aToVector4i (const char* str);
  17. glm::ivec3 aToVector3i (const char* str);
  18. glm::ivec2 aToVector2i (const char* str);
  19. glm::ivec4 aToVector4i (const std::string& str);
  20. glm::ivec3 aToVector3i (const std::string& str);
  21. glm::ivec2 aToVector2i (const std::string& str);
  22. glm::vec3 aToColorf (const char* str);
  23. glm::vec3 aToColorf (const std::string& str);
  24. glm::ivec3 aToColori (const char* str);
  25. glm::ivec3 aToColori (const std::string& str);
  26. template <typename T> const T jsonFindRequired (
  27. const nlohmann::json::const_iterator& data, const char* key, const char* notFoundMsg);
  28. template <typename T> const T jsonFindRequired (
  29. const nlohmann::json& data, const char* key, const char* notFoundMsg);
  30. nlohmann::json::const_iterator jsonFindRequired (
  31. const nlohmann::json::const_iterator& data, const char* key, const char* notFoundMsg);
  32. nlohmann::json::const_iterator jsonFindRequired (
  33. const nlohmann::json& data, const char* key, const char* notFoundMsg);
  34. template <typename T> const T jsonFindDefault (
  35. const nlohmann::json::const_iterator& data, const char* key, const T defaultValue);
  36. template <typename T> const T jsonFindDefault (
  37. const nlohmann::json& data, const char* key, const T defaultValue);
  38. template <typename T> const T* jsonFindUserConfig (
  39. const nlohmann::json::const_iterator& data, const CProject& project, const char* key, typename T::data_type defaultValue);
  40. template <typename T> const T* jsonFindUserConfig (
  41. const nlohmann::json& data, const CProject& project, const char* key, typename T::data_type defaultValue);
  42. } // namespace WallpaperEngine::Core