Carl Shapiro | 1fb8620 | 2011-06-27 17:43:13 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #ifndef ART_SRC_STRUTIL_H_ |
| 4 | #define ART_SRC_STRUTIL_H_ |
| 5 | |
| 6 | #include <string.h> |
| 7 | |
| 8 | namespace art { |
| 9 | |
| 10 | // Key comparison function for C strings. |
| 11 | struct CStringLt { |
| 12 | bool operator()(const char* s1, const char* s2) const { |
| 13 | return strcmp(s1, s2) < 0; |
| 14 | } |
| 15 | }; |
| 16 | |
| 17 | // Key equality function for C strings. |
| 18 | struct CStringEq { |
| 19 | bool operator()(const char* s1, const char* s2) const { |
| 20 | return strcmp(s1, s2) == 0; |
| 21 | } |
| 22 | }; |
| 23 | |
| 24 | } // namespace art |
| 25 | |
| 26 | #endif // ART_SRC_STRUTIL_H_ |