blob: c9c6caa563c4434e09225bdfd68488da70ceec5d [file] [log] [blame]
Carl Shapiro1fb86202011-06-27 17:43:13 -07001// 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
8namespace art {
9
10// Key comparison function for C strings.
11struct 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.
18struct 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_