diff options
author | Hop311 <Hop3114@gmail.com> | 2023-05-22 19:44:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 19:44:27 +0200 |
commit | ac36a373139e3e815f70720b37d4ffc8d9062df9 (patch) | |
tree | 04c25f263a2364eab5bc3647b9e1a4ccc9fc3bf2 /extension/src/Utilities.hpp | |
parent | 30fa7d74ddcfd4e64a5526995a392f7b51feb869 (diff) | |
parent | 42b4b45d7d1216770077e0676cd66750cae26932 (diff) |
Merge pull request #123 from OpenVicProject/compatibility-mode
Map compatibility mode
Diffstat (limited to 'extension/src/Utilities.hpp')
-rw-r--r-- | extension/src/Utilities.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/extension/src/Utilities.hpp b/extension/src/Utilities.hpp new file mode 100644 index 0000000..16193e8 --- /dev/null +++ b/extension/src/Utilities.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include <godot_cpp/variant/string.hpp> + +#include "openvic/Types.hpp" + +#define ERR(x) ((x) == SUCCESS ? OK : FAILED) + +namespace OpenVic { + + inline char const* godot_to_c_string(godot::String const& str) { + return str.ascii().get_data(); + } + + inline std::string godot_to_std_string(godot::String const& str) { + return godot_to_c_string(str); + } + + inline godot::String std_to_godot_string(std::string const& str) { + return str.c_str(); + } +} |