godot-cpp/include/godot_cpp/core/String.hpp

74 lines
1.1 KiB
C++
Raw Normal View History

2017-03-02 22:51:31 +00:00
#ifndef STRING_H
#define STRING_H
2017-03-15 22:19:58 +00:00
#if defined(_WIN32)
# ifdef _GD_CPP_CORE_API_IMPL
# define GD_CPP_CORE_API __declspec(dllexport)
# else
# define GD_CPP_CORE_API __declspec(dllimport)
# endif
#else
# define GD_CPP_CORE_API
#endif
2017-03-02 22:51:31 +00:00
#include <godot/godot_string.h>
namespace godot {
2017-03-02 22:51:31 +00:00
2017-03-15 22:19:58 +00:00
class GD_CPP_CORE_API String
2017-03-02 22:51:31 +00:00
{
godot_string _godot_string;
public:
String();
String(const char *contents);
String(const wchar_t *contents);
String(const wchar_t c);
String(const String& other);
~String();
String substr(int p_from,int p_chars) const;
wchar_t &operator [](const int idx);
wchar_t operator [](const int idx) const;
int length() const;
bool operator ==(const String &s);
bool operator !=(const String &s);
String operator +(const String &s);
void operator +=(const String &s);
void operator +=(const wchar_t c);
bool operator <(const String &s);
bool operator <=(const String &s);
bool operator >(const String &s);
bool operator >=(const String &s);
2017-03-15 17:13:22 +00:00
const wchar_t *c_string() const;
2017-03-02 22:51:31 +00:00
};
2017-03-15 17:13:22 +00:00
String operator +(const char *a, const String& b);
2017-03-02 22:51:31 +00:00
}
#endif // STRING_H