Il2CppHStringReference.h 602 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <il2cpp-object-internals.h>
  3. #include "StringView.h"
  4. #include "vm/Exception.h"
  5. #include "vm/WindowsRuntime.h"
  6. namespace il2cpp
  7. {
  8. namespace utils
  9. {
  10. class Il2CppHStringReference
  11. {
  12. private:
  13. Il2CppHString m_String;
  14. Il2CppHStringHeader m_Header;
  15. public:
  16. inline Il2CppHStringReference(const StringView<Il2CppNativeChar>& str)
  17. {
  18. il2cpp::vm::WindowsRuntime::CreateHStringReference(str, &m_Header, &m_String);
  19. }
  20. inline operator Il2CppHString() const
  21. {
  22. return m_String;
  23. }
  24. };
  25. }
  26. }