| @@ -209,7 +209,8 @@ DynamicObject* var::getObject() const | |||||
| return type == objectType ? value.objectValue : 0; | return type == objectType ? value.objectValue : 0; | ||||
| } | } | ||||
| bool var::operator== (const var& other) const throw() | |||||
| //============================================================================== | |||||
| bool var::equals (const var& other) const throw() | |||||
| { | { | ||||
| switch (type) | switch (type) | ||||
| { | { | ||||
| @@ -226,11 +227,12 @@ bool var::operator== (const var& other) const throw() | |||||
| return false; | return false; | ||||
| } | } | ||||
| bool var::operator!= (const var& other) const throw() | |||||
| { | |||||
| return ! operator== (other); | |||||
| } | |||||
| bool operator== (const var& v1, const var& v2) throw() { return v1.equals (v2); } | |||||
| bool operator!= (const var& v1, const var& v2) throw() { return ! v1.equals (v2); } | |||||
| bool operator== (const var& v1, const String& v2) throw() { return v1.toString() == v2; } | |||||
| bool operator!= (const var& v1, const String& v2) throw() { return v1.toString() != v2; } | |||||
| //============================================================================== | |||||
| void var::writeToStream (OutputStream& output) const | void var::writeToStream (OutputStream& output) const | ||||
| { | { | ||||
| switch (type) | switch (type) | ||||
| @@ -96,9 +96,6 @@ public: | |||||
| bool isObject() const throw() { return type == objectType; } | bool isObject() const throw() { return type == objectType; } | ||||
| bool isMethod() const throw() { return type == methodType; } | bool isMethod() const throw() { return type == methodType; } | ||||
| bool operator== (const var& other) const throw(); | |||||
| bool operator!= (const var& other) const throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Writes a binary representation of this value to a stream. | /** Writes a binary representation of this value to a stream. | ||||
| The data can be read back later using readFromStream(). | The data can be read back later using readFromStream(). | ||||
| @@ -170,6 +167,9 @@ public: | |||||
| //============================================================================== | //============================================================================== | ||||
| juce_UseDebuggingNewOperator | juce_UseDebuggingNewOperator | ||||
| /** Returns true if this var has the same value as the one supplied. */ | |||||
| bool equals (const var& other) const throw(); | |||||
| private: | private: | ||||
| enum Type | enum Type | ||||
| { | { | ||||
| @@ -196,5 +196,10 @@ private: | |||||
| ValueUnion value; | ValueUnion value; | ||||
| }; | }; | ||||
| bool operator== (const var& v1, const var& v2) throw(); | |||||
| bool operator!= (const var& v1, const var& v2) throw(); | |||||
| bool operator== (const var& v1, const String& v2) throw(); | |||||
| bool operator!= (const var& v1, const String& v2) throw(); | |||||
| #endif // __JUCE_VARIANT_JUCEHEADER__ | #endif // __JUCE_VARIANT_JUCEHEADER__ | ||||
| @@ -1322,7 +1322,7 @@ void TextEditor::repaintText (const Range<int>& range) | |||||
| if (range.getEnd() >= getTotalNumChars()) | if (range.getEnd() >= getTotalNumChars()) | ||||
| { | { | ||||
| y2 = getHeight(); | |||||
| y2 = textHolder->getHeight(); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -28,6 +28,7 @@ | |||||
| BEGIN_JUCE_NAMESPACE | BEGIN_JUCE_NAMESPACE | ||||
| #include "juce_ComponentAnimator.h" | #include "juce_ComponentAnimator.h" | ||||
| #include "../../../core/juce_Time.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -507,52 +507,52 @@ String& String::operator= (const String& other) throw() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const String& string2) throw() | |||||
| bool operator== (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) == 0; | return string1.compare (string2) == 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const char* string2) throw() | |||||
| bool operator== (const String& string1, const char* string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) == 0; | return string1.compare (string2) == 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const juce_wchar* string2) throw() | |||||
| bool operator== (const String& string1, const juce_wchar* string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) == 0; | return string1.compare (string2) == 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const String& string2) throw() | |||||
| bool operator!= (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) != 0; | return string1.compare (string2) != 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const char* string2) throw() | |||||
| bool operator!= (const String& string1, const char* string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) != 0; | return string1.compare (string2) != 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const juce_wchar* string2) throw() | |||||
| bool operator!= (const String& string1, const juce_wchar* string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) != 0; | return string1.compare (string2) != 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator> (const String& string1, const String& string2) throw() | |||||
| bool operator> (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) > 0; | return string1.compare (string2) > 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator< (const String& string1, const String& string2) throw() | |||||
| bool operator< (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) < 0; | return string1.compare (string2) < 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator>= (const String& string1, const String& string2) throw() | |||||
| bool operator>= (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) >= 0; | return string1.compare (string2) >= 0; | ||||
| } | } | ||||
| bool JUCE_PUBLIC_FUNCTION operator<= (const String& string1, const String& string2) throw() | |||||
| bool operator<= (const String& string1, const String& string2) throw() | |||||
| { | { | ||||
| return string1.compare (string2) <= 0; | return string1.compare (string2) <= 0; | ||||
| } | } | ||||
| @@ -665,114 +665,114 @@ void String::append (const tchar* const other, const int howMany) | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const char* const string1, const String& string2) | |||||
| const String operator+ (const char* const string1, const String& string2) | |||||
| { | { | ||||
| String s (string1); | String s (string1); | ||||
| return s += string2; | return s += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar* const string1, const String& string2) | |||||
| const String operator+ (const juce_wchar* const string1, const String& string2) | |||||
| { | { | ||||
| String s (string1); | String s (string1); | ||||
| return s += string2; | return s += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const char string1, const String& string2) | |||||
| const String operator+ (const char string1, const String& string2) | |||||
| { | { | ||||
| return String::charToString (string1) + string2; | return String::charToString (string1) + string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar string1, const String& string2) | |||||
| const String operator+ (const juce_wchar string1, const String& string2) | |||||
| { | { | ||||
| return String::charToString (string1) + string2; | return String::charToString (string1) + string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const String& string2) | |||||
| const String operator+ (String string1, const String& string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char* const string2) | |||||
| const String operator+ (String string1, const char* const string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar* const string2) | |||||
| const String operator+ (String string1, const juce_wchar* const string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char string2) | |||||
| const String operator+ (String string1, const char string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar string2) | |||||
| const String operator+ (String string1, const juce_wchar string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char characterToAppend) | |||||
| String& operator<< (String& string1, const char characterToAppend) | |||||
| { | { | ||||
| return string1 += characterToAppend; | return string1 += characterToAppend; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar characterToAppend) | |||||
| String& operator<< (String& string1, const juce_wchar characterToAppend) | |||||
| { | { | ||||
| return string1 += characterToAppend; | return string1 += characterToAppend; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char* const string2) | |||||
| String& operator<< (String& string1, const char* const string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar* const string2) | |||||
| String& operator<< (String& string1, const juce_wchar* const string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const String& string2) | |||||
| String& operator<< (String& string1, const String& string2) | |||||
| { | { | ||||
| return string1 += string2; | return string1 += string2; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const short number) | |||||
| String& operator<< (String& string1, const short number) | |||||
| { | { | ||||
| return string1 += (int) number; | return string1 += (int) number; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const int number) | |||||
| String& operator<< (String& string1, const int number) | |||||
| { | { | ||||
| return string1 += number; | return string1 += number; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned int number) | |||||
| String& operator<< (String& string1, const unsigned int number) | |||||
| { | { | ||||
| return string1 += number; | return string1 += number; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const long number) | |||||
| String& operator<< (String& string1, const long number) | |||||
| { | { | ||||
| return string1 += (int) number; | return string1 += (int) number; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned long number) | |||||
| String& operator<< (String& string1, const unsigned long number) | |||||
| { | { | ||||
| return string1 += (unsigned int) number; | return string1 += (unsigned int) number; | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const float number) | |||||
| String& operator<< (String& string1, const float number) | |||||
| { | { | ||||
| return string1 += String (number); | return string1 += String (number); | ||||
| } | } | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const double number) | |||||
| String& operator<< (String& string1, const double number) | |||||
| { | { | ||||
| return string1 += String (number); | return string1 += String (number); | ||||
| } | } | ||||
| OutputStream& JUCE_PUBLIC_FUNCTION operator<< (OutputStream& stream, const String& text) | |||||
| OutputStream& operator<< (OutputStream& stream, const String& text) | |||||
| { | { | ||||
| // (This avoids using toUTF8() to prevent the memory bloat that it would leave behind | // (This avoids using toUTF8() to prevent the memory bloat that it would leave behind | ||||
| // if lots of large, persistent strings were to be written to streams). | // if lots of large, persistent strings were to be written to streams). | ||||
| @@ -1072,73 +1072,73 @@ private: | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const char* string1, const String& string2); | |||||
| const String operator+ (const char* string1, const String& string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (const juce_wchar* string1, const String& string2); | |||||
| const String operator+ (const juce_wchar* string1, const String& string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (char string1, const String& string2); | |||||
| const String operator+ (char string1, const String& string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (juce_wchar string1, const String& string2); | |||||
| const String operator+ (juce_wchar string1, const String& string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const String& string2); | |||||
| const String operator+ (String string1, const String& string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const char* string2); | |||||
| const String operator+ (String string1, const char* string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, const juce_wchar* string2); | |||||
| const String operator+ (String string1, const juce_wchar* string2); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, char characterToAppend); | |||||
| const String operator+ (String string1, char characterToAppend); | |||||
| /** Concatenates two strings. */ | /** Concatenates two strings. */ | ||||
| const String JUCE_PUBLIC_FUNCTION operator+ (String string1, juce_wchar characterToAppend); | |||||
| const String operator+ (String string1, juce_wchar characterToAppend); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Appends a character at the end of a string. */ | /** Appends a character at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char characterToAppend); | |||||
| String& operator<< (String& string1, const char characterToAppend); | |||||
| /** Appends a character at the end of a string. */ | /** Appends a character at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar characterToAppend); | |||||
| String& operator<< (String& string1, const juce_wchar characterToAppend); | |||||
| /** Appends a string to the end of the first one. */ | /** Appends a string to the end of the first one. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const char* const string2); | |||||
| String& operator<< (String& string1, const char* const string2); | |||||
| /** Appends a string to the end of the first one. */ | /** Appends a string to the end of the first one. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const juce_wchar* const string2); | |||||
| String& operator<< (String& string1, const juce_wchar* const string2); | |||||
| /** Appends a string to the end of the first one. */ | /** Appends a string to the end of the first one. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const String& string2); | |||||
| String& operator<< (String& string1, const String& string2); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const short number); | |||||
| String& operator<< (String& string1, const short number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const int number); | |||||
| String& operator<< (String& string1, const int number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned int number); | |||||
| String& operator<< (String& string1, const unsigned int number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const long number); | |||||
| String& operator<< (String& string1, const long number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const unsigned long number); | |||||
| String& operator<< (String& string1, const unsigned long number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const float number); | |||||
| String& operator<< (String& string1, const float number); | |||||
| /** Appends a decimal number at the end of a string. */ | /** Appends a decimal number at the end of a string. */ | ||||
| String& JUCE_PUBLIC_FUNCTION operator<< (String& string1, const double number); | |||||
| String& operator<< (String& string1, const double number); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const String& string2) throw(); | |||||
| bool operator== (const String& string1, const String& string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const char* string2) throw(); | |||||
| bool operator== (const String& string1, const char* string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator== (const String& string1, const juce_wchar* string2) throw(); | |||||
| bool operator== (const String& string1, const juce_wchar* string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const String& string2) throw(); | |||||
| bool operator!= (const String& string1, const String& string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const char* string2) throw(); | |||||
| bool operator!= (const String& string1, const char* string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator!= (const String& string1, const juce_wchar* string2) throw(); | |||||
| bool operator!= (const String& string1, const juce_wchar* string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator> (const String& string1, const String& string2) throw(); | |||||
| bool operator> (const String& string1, const String& string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator< (const String& string1, const String& string2) throw(); | |||||
| bool operator< (const String& string1, const String& string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator>= (const String& string1, const String& string2) throw(); | |||||
| bool operator>= (const String& string1, const String& string2) throw(); | |||||
| /** Case-sensitive comparison of two strings. */ | /** Case-sensitive comparison of two strings. */ | ||||
| bool JUCE_PUBLIC_FUNCTION operator<= (const String& string1, const String& string2) throw(); | |||||
| bool operator<= (const String& string1, const String& string2) throw(); | |||||
| //============================================================================== | //============================================================================== | ||||
| /** This streaming override allows you to pass a juce String directly into std output streams. | /** This streaming override allows you to pass a juce String directly into std output streams. | ||||
| @@ -1151,7 +1151,7 @@ std::basic_ostream <charT, traits>& operator<< (std::basic_ostream <charT, trait | |||||
| } | } | ||||
| /** Writes a string to an OutputStream as UTF8. */ | /** Writes a string to an OutputStream as UTF8. */ | ||||
| OutputStream& JUCE_PUBLIC_FUNCTION operator<< (OutputStream& stream, const String& text); | |||||
| OutputStream& operator<< (OutputStream& stream, const String& text); | |||||
| #endif // __JUCE_STRING_JUCEHEADER__ | #endif // __JUCE_STRING_JUCEHEADER__ | ||||