69 StringRef (
const char* stringLiteral)
noexcept;
96 operator const String::CharPointerType::CharType*()
const noexcept {
return text.getAddress(); }
101 bool isEmpty() const noexcept {
return text.isEmpty(); }
103 bool isNotEmpty() const noexcept {
return ! text.isEmpty(); }
105 int length() const noexcept {
return (
int) text.length(); }
108 juce_wchar operator[] (
int index)
const noexcept {
return text[index]; }
111 bool operator== (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) == 0; }
113 bool operator!= (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) != 0; }
115 bool operator< (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) < 0; }
117 bool operator<= (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) <= 0; }
119 bool operator> (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) > 0; }
121 bool operator>= (
const String& s)
const noexcept {
return text.compare (s.getCharPointer()) >= 0; }
124 bool operator== (
StringRef s)
const noexcept {
return text.compare (s.text) == 0; }
126 bool operator!= (
StringRef s)
const noexcept {
return text.compare (s.text) != 0; }
132 #if JUCE_STRING_UTF_TYPE != 8 && ! defined (DOXYGEN)
154inline String operator+ (StringRef s1,
const String& s2) {
return String (s1.text) + s2; }
155inline String operator+ (
const char* s1, StringRef s2) {
return String (s1) + String (s2.text); }
156inline String operator+ (StringRef s1,
const char* s2) {
return String (s1.text) + String (s2); }
Wraps a pointer to a null-terminated UTF-8 character string, and provides various methods to operate ...
A simple class for holding temporary references to a string literal or String.
bool isNotEmpty() const noexcept
Returns true if the string is not empty.
int length() const noexcept
Returns the number of characters in the string.
String::CharPointerType text
The text that is referenced.
bool isEmpty() const noexcept
Returns true if the string is empty.
bool operator>(const var &v1, const var &v2)
Compares the values of two var objects, using the var::equals() comparison.
bool operator<=(const var &v1, const var &v2)
Compares the values of two var objects, using the var::equals() comparison.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
bool operator>=(const var &v1, const var &v2)
Compares the values of two var objects, using the var::equals() comparison.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...