String.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. void operator =(const String &s);
  29. bool operator ==(const String &s);
  30. bool operator !=(const String &s);
  31. String operator +(const String &s);
  32. void operator +=(const String &s);
  33. void operator +=(const wchar_t c);
  34. bool operator <(const String &s);
  35. bool operator <=(const String &s);
  36. bool operator >(const String &s);
  37. bool operator >=(const String &s);
  38. const wchar_t *c_string() const;
  39. };
  40. String operator +(const char *a, const String& b);
  41. }
  42. #endif // STRING_H