Browse Source

Disambiguations to keep the MS compiler happy when using UTF32 string mode.

tags/2021-05-28
jules 11 years ago
parent
commit
addd649b27
4 changed files with 14 additions and 0 deletions
  1. +3
    -0
      modules/juce_core/text/juce_NewLine.h
  2. +5
    -0
      modules/juce_core/text/juce_String.cpp
  3. +3
    -0
      modules/juce_core/text/juce_String.h
  4. +3
    -0
      modules/juce_core/text/juce_StringRef.h

+ 3
- 0
modules/juce_core/text/juce_NewLine.h View File

@@ -79,5 +79,8 @@ extern NewLine newLine;
*/
JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, const NewLine&);
#if JUCE_STRING_UTF_TYPE != 8 && ! defined (DOXYGEN)
inline String operator+ (String s1, const NewLine&) { return s1 += NewLine::getDefault(); }
#endif
#endif // JUCE_NEWLINE_H_INCLUDED

+ 5
- 0
modules/juce_core/text/juce_String.cpp View File

@@ -580,6 +580,11 @@ bool String::equalsIgnoreCase (const char* const t) const noexcept
: isEmpty();
}
bool String::equalsIgnoreCase (StringRef t) const noexcept
{
return text.compareIgnoreCase (t.text) == 0;
}
bool String::equalsIgnoreCase (const String& other) const noexcept
{
return text == other.text


+ 3
- 0
modules/juce_core/text/juce_String.h View File

@@ -296,6 +296,9 @@ public:
/** Case-insensitive comparison with another string. */
bool equalsIgnoreCase (const String& other) const noexcept;
/** Case-insensitive comparison with another string. */
bool equalsIgnoreCase (StringRef other) const noexcept;
/** Case-insensitive comparison with another string. */
bool equalsIgnoreCase (const wchar_t* other) const noexcept;


+ 3
- 0
modules/juce_core/text/juce_StringRef.h View File

@@ -128,5 +128,8 @@ JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, StringRef string2
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, StringRef string2) noexcept;
#if JUCE_STRING_UTF_TYPE != 8 && ! defined (DOXYGEN)
inline String operator+ (String s1, StringRef s2) { return s1 += String (s2.text); }
#endif
#endif // JUCE_STRINGREF_H_INCLUDED

Loading…
Cancel
Save