2
0

String.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 NodePath;
  15. class GD_CPP_CORE_API String
  16. {
  17. godot_string _godot_string;
  18. public:
  19. String();
  20. String(const char *contents);
  21. String(const wchar_t *contents);
  22. String(const wchar_t c);
  23. String(const String& other);
  24. ~String();
  25. String substr(int p_from,int p_chars) const;
  26. wchar_t &operator [](const int idx);
  27. wchar_t operator [](const int idx) const;
  28. int length() const;
  29. void operator =(const String &s);
  30. bool operator ==(const String &s);
  31. bool operator !=(const String &s);
  32. String operator +(const String &s);
  33. void operator +=(const String &s);
  34. void operator +=(const wchar_t c);
  35. bool operator <(const String &s);
  36. bool operator <=(const String &s);
  37. bool operator >(const String &s);
  38. bool operator >=(const String &s);
  39. operator NodePath() const;
  40. const char *c_string() const;
  41. };
  42. String operator +(const char *a, const String& b);
  43. }
  44. #endif // STRING_H