sandbox
Loading...
Searching...
No Matches
string.hpp
1// SPDX-License-Identifier: MIT
2#ifndef LIBSBX_SCRIPTING_MANAGED_STRING_HPP_
3#define LIBSBX_SCRIPTING_MANAGED_STRING_HPP_
4
5#include <string>
6
7#include <libsbx/scripting/managed/core.hpp>
8
9namespace sbx::scripting::managed {
10
11class string {
12
13public:
14
15 string();
16
17 static auto create(const char* str) -> string;
18 static auto create(std::string_view str) -> string;
19 static auto destroy(string& str) -> void;
20
21 auto assign(std::string_view str) -> void;
22
23 operator std::string() const;
24
25 auto operator==(const string& other) const -> bool;
26 auto operator==(std::string_view other) const -> bool;
27
28 auto data() -> char_type*;
29 auto data() const -> const char_type*;
30
31private:
32
33 char_type* _string;
34 bool32 _is_disposed;
35
36}; // class string
37
39
40public:
41
42 static auto convert_utf8_to_wide(std::string_view str) -> string_type;
43 static auto convert_wide_to_utf8(string_view_type str) -> std::string;
44
45}; // class string_helper
46
47} // namespace sbx::scripting::managed
48
49#endif // LIBSBX_SCRIPTING_MANAGED_STRING_HPP_
Definition: string.hpp:11