RuntimeLibrary.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-10-27
  6. * Changed: 2022-10-27
  7. *
  8. * */
  9. #ifndef LS_STD_RUNTIME_LIBRARY_HPP
  10. #define LS_STD_RUNTIME_LIBRARY_HPP
  11. #include <string>
  12. #include <ls_std/os/library/goals/dynamic_goal.hpp>
  13. #include <ls_std/core/types/RuntimeLibraryTypes.hpp>
  14. #include <unordered_map>
  15. #include <windows.h>
  16. namespace ls::std::os
  17. {
  18. class LS_STD_DYNAMIC_GOAL RuntimeLibrary
  19. {
  20. public:
  21. RuntimeLibrary() = default;
  22. ~RuntimeLibrary() = default;
  23. bool addSymbol(const ls::std::core::type::runtime_library_entry& _entry);
  24. void* getSymbol(const ::std::string& _symbolName);
  25. bool hasSymbol(const ::std::string& _symbolName);
  26. private:
  27. ::std::unordered_map<::std::string, void*> symbols{};
  28. [[nodiscard]] void* _getSymbol(const ::std::string& _symbolName);
  29. [[nodiscard]] bool _hasSymbol(const ::std::string& _symbolName);
  30. [[nodiscard]] bool _isValidEntry(const ls::std::core::type::runtime_library_entry& _entry);
  31. };
  32. }
  33. #endif