00001 #ifndef __J2K__JString_Compare_INL__ 00002 #define __J2K__JString_Compare_INL__ 00003 00004 #include <j2k/Fred/String/String.hpp> 00005 00006 //////////////////////////////////////////////////////////////////////////// 00007 /// Compare utilities only. No external function used, all inlined ! /// 00008 //////////////////////////////////////////////////////////////////////////// 00009 00010 00011 inline int JString::compare( const JString& right ) const { 00012 if ( pData == right.pData ) return 0; 00013 return strcmp( pData->data, right.pData->data ); 00014 } 00015 00016 00017 inline int JString::compare( const char* r ) const { 00018 if ( pData == strNull && ( r == "" || r == NULL ) ) return 0; 00019 return strcmp( pData->data, r ); 00020 } 00021 00022 // Is Left JString (THIS) less than Right JString? 00023 inline BOOL JString::operator< ( const JString& right ) const { 00024 return ( compare(right) < 0 ); 00025 } 00026 00027 inline BOOL JString::operator< ( const char* right ) const { 00028 return ( compare(right) < 0 ); 00029 } 00030 00031 inline BOOL JString::operator< ( char right ) const { 00032 return ( compare(right) < 0 ); 00033 } 00034 00035 inline BOOL JString::operator> ( const JString& right ) const { 00036 return ( compare(right) > 0 ); 00037 } 00038 00039 inline BOOL JString::operator> ( const char* right ) const { 00040 return ( compare(right) > 0 ); 00041 } 00042 00043 inline BOOL JString::operator> ( char right ) const { 00044 return ( compare(right) > 0 ); 00045 } 00046 00047 inline BOOL JString::operator<=( const JString& right ) const { 00048 return ( compare(right) <= 0 ); 00049 } 00050 00051 inline BOOL JString::operator<=( const char* right ) const { 00052 return ( compare(right) <= 0 ); 00053 } 00054 00055 inline BOOL JString::operator<=( char right ) const { 00056 return ( compare(right) <= 0 ); 00057 } 00058 00059 inline BOOL JString::operator>=( const JString& right ) const { 00060 return ( compare(right) >= 0 ); 00061 } 00062 00063 inline BOOL JString::operator>=( const char* right ) const { 00064 return ( compare(right) >= 0 ); 00065 } 00066 00067 inline BOOL JString::operator>=( char right ) const { 00068 return ( compare(right) >= 0 ); 00069 } 00070 00071 inline BOOL JString::operator==( const JString& right ) const { 00072 return ( compare(right) == 0 ); 00073 } 00074 00075 inline BOOL JString::operator==( const char* right ) const { 00076 return ( compare(right) == 0 ); 00077 } 00078 00079 inline BOOL JString::operator==( char right ) const { 00080 return ( compare(right) == 0 ); 00081 } 00082 00083 inline BOOL JString::operator!=( const JString& right ) const { 00084 return ( compare(right) != 0 ); 00085 } 00086 00087 inline BOOL JString::operator!=( const char* right ) const { 00088 return ( compare(right) != 0 ); 00089 } 00090 00091 inline BOOL JString::operator!=( char right ) const { 00092 return ( compare(right) != 0 ); 00093 } 00094 00095 #endif