TitleKeys.hpp 981 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef FREESHOP_TITLEKEYS_HPP
  2. #define FREESHOP_TITLEKEYS_HPP
  3. #include <map>
  4. #include <vector>
  5. #include <cpp3ds/System/FileInputStream.hpp>
  6. #include <cpp3ds/System/String.hpp>
  7. namespace FreeShop {
  8. class TitleKeys {
  9. public:
  10. enum TitleType {
  11. Game = 0x40000,
  12. Update = 0x4000E,
  13. Demo = 0x40002,
  14. DLC = 0x4008C,
  15. DSiWare = 0x48004,
  16. SystemApplication = 0x40010,
  17. SystemApplet = 0x40030,
  18. };
  19. static cpp3ds::Uint32 *get(cpp3ds::Uint64);
  20. static std::vector<cpp3ds::Uint64> &getIds();
  21. static std::vector<cpp3ds::Uint64> getRelated(cpp3ds::Uint64 titleId, TitleType type);
  22. static bool isValidUrl(const std::string &url, cpp3ds::String *errorOut);
  23. static bool isValidFile(cpp3ds::FileInputStream &file);
  24. static bool isValidFile(const std::string &filename);
  25. static bool isValidData(const void *data, size_t size);
  26. private:
  27. // Load title keys from file if not done already
  28. static void ensureTitleKeys();
  29. };
  30. } // namespace FreeShop
  31. #endif // FREESHOP_TITLEKEYS_HPP