Browse Source

python compare Filenames

David Rose 19 years ago
parent
commit
cd89c39c51
2 changed files with 11 additions and 0 deletions
  1. 10 0
      dtool/src/dtoolutil/filename.I
  2. 1 0
      dtool/src/dtoolutil/filename.h

+ 10 - 0
dtool/src/dtoolutil/filename.I

@@ -537,6 +537,16 @@ operator < (const string &other) const {
   return (*(string *)this) < other;
   return (*(string *)this) < other;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: Filename::compare_to
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE int Filename::
+compare_to(const Filename &other) const {
+  return strcmp(_filename.c_str(), other._filename.c_str());
+}
+
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: Filename::output
 //     Function: Filename::output

+ 1 - 0
dtool/src/dtoolutil/filename.h

@@ -187,6 +187,7 @@ PUBLISHED:
   INLINE bool operator == (const string &other) const;
   INLINE bool operator == (const string &other) const;
   INLINE bool operator != (const string &other) const;
   INLINE bool operator != (const string &other) const;
   INLINE bool operator < (const string &other) const;
   INLINE bool operator < (const string &other) const;
+  INLINE int compare_to(const Filename &other) const;
 
 
   INLINE void output(ostream &out) const;
   INLINE void output(ostream &out) const;