String.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef STRING_H
  2. #define STRING_H
  3. #if defined(_WIN32)
  4. # ifdef _GD_CPP_CORE_API_IMPL
  5. # define GD_CPP_CORE_API __declspec(dllexport)
  6. # else
  7. # define GD_CPP_CORE_API __declspec(dllimport)
  8. # endif
  9. #else
  10. # define GD_CPP_CORE_API
  11. #endif
  12. #include <godot/godot_string.h>
  13. namespace godot {
  14. class GD_CPP_CORE_API String
  15. {
  16. godot_string _godot_string;
  17. public:
  18. String();
  19. String(const char *contents);
  20. String(const wchar_t *contents);
  21. String(const wchar_t c);
  22. String(const String& other);
  23. ~String();
  24. String substr(int p_from,int p_chars) const;
  25. wchar_t &operator [](const int idx);
  26. wchar_t operator [](const int idx) const;
  27. int length() const;
  28. bool operator ==(const String &s);
  29. bool operator !=(const String &s);
  30. String operator +(const String &s);
  31. void operator +=(const String &s);
  32. void operator +=(const wchar_t c);
  33. bool operator <(const String &s);
  34. bool operator <=(const String &s);
  35. bool operator >(const String &s);
  36. bool operator >=(const String &s);
  37. const wchar_t *c_string() const;
  38. };
  39. String operator +(const char *a, const String& b);
  40. }
  41. #endif // STRING_H