Commits

Roy Walmsley  committed 8e91b0a Merge

Merged in TheHubbit/coin/issue60 (pull request #10)

Additional operators for SbString

  • Participants
  • Parent commits 346f82f, fb4d4cd

Comments (0)

Files changed (2)

File include/Inventor/SbString.h

   friend int operator!=(const SbString & sbstr, const char * s);
   friend int operator!=(const char * s, const SbString & sbstr);
   friend int operator!=(const SbString & str1, const SbString & str2);
+  friend int operator<(const SbString & sbstr, const char * s);
+  friend int operator<(const char * s, const SbString & sbstr);
+  friend int operator<(const SbString & str1, const SbString & str2);
+  friend int operator>(const SbString & sbstr, const char * s);
+  friend int operator>(const char * s, const SbString & sbstr);
+  friend int operator>(const SbString & str1, const SbString & str2);
   friend const SbString operator+(const SbString & str1, const SbString & str2);
   friend const SbString operator+(const SbString & sbstr, const char * s);
   friend const SbString operator+(const char * s, const SbString & sbstr);
 inline int operator!=(const SbString & str1, const SbString & str2)
 { return (cc_string_compare_text(str1.str.pointer, str2.str.pointer) != 0); }
 
+inline int operator<(const SbString & sbstr, const char * s)
+{ return (cc_string_compare_text(sbstr.str.pointer, s) < 0); }
+inline int operator<(const char * s, const SbString & sbstr)
+{ return (cc_string_compare_text(s, sbstr.str.pointer) < 0); }
+inline int operator<(const SbString & str1, const SbString & str2)
+{ return (cc_string_compare_text(str1.str.pointer, str2.str.pointer) < 0); }
+
+inline int operator>(const SbString & sbstr, const char * s)
+{ return (cc_string_compare_text(sbstr.str.pointer, s) > 0); }
+inline int operator>(const char * s, const SbString & sbstr)
+{ return (cc_string_compare_text(s, sbstr.str.pointer) > 0); }
+inline int operator>(const SbString & str1, const SbString & str2)
+{ return (cc_string_compare_text(str1.str.pointer, str2.str.pointer) > 0); }
+
 inline const SbString operator+(const SbString & str1, const SbString & str2)
 { 
   SbString newstr(str1);

File src/base/SbString.cpp

 */
 
 /*!
+  \fn int operator<(const SbString & str, const char * s)
+
+  Less than operator. Results in \c TRUE if the first character that
+  does not match has a lower value in \a str than in \a s.
+
+  \relates SbString
+*/
+
+/*!
+  \fn int operator<(const char * s, const SbString & str)
+
+  Less than operator. Results in \c TRUE if the first character that
+  does not match has a lower value in \a s than in \a str.
+
+  \relates SbString
+*/
+
+/*!
+  \fn int operator<(const SbString & str1, const SbString & str2)
+
+  Less than operator. Results in \c TRUE if the first character that
+  does not match has a lower value in \a str1 than in \a str2.
+
+  \relates SbString
+*/
+
+/*!
+  \fn int operator>(const SbString & str, const char * s)
+
+  Greater than operator. Results in \c TRUE if the first character that
+  does not match has a higher value in \a str than in \a s.
+
+  \relates SbString
+*/
+
+/*!
+  \fn int operator>(const char * s, const SbString & str)
+
+  Greater than operator. Results in \c TRUE if the first character that
+  does not match has a higher value in \a s than in \a str.
+
+  \relates SbString
+*/
+
+/*!
+  \fn int operator>(const SbString & str1, const SbString & str2)
+
+  Greater than operator. Results in \c TRUE if the first character that
+  does not match has a higher value in \a str1 than in \a str2.
+
+  \relates SbString
+*/
+
+/*!
   \fn const SbString operator+(const SbString & str1, const SbString & str2)
 
   Addition operator.