12faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes/*
22faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Copyright (C) 2011 The Android Open Source Project
32faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
42faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
52faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * you may not use this file except in compliance with the License.
62faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * You may obtain a copy of the License at
72faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
82faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
92faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
102faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Unless required by applicable law or agreed to in writing, software
112faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
122faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * See the License for the specific language governing permissions and
142faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * limitations under the License.
152faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes */
161fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
17fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#ifndef ART_RUNTIME_STRUTIL_H_
18fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#define ART_RUNTIME_STRUTIL_H_
191fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
201fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro#include <string.h>
211fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
221fb8620309a4e94d11879aabc33364acfa733904Carl Shapironamespace art {
231fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
241fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro// Key comparison function for C strings.
251fb8620309a4e94d11879aabc33364acfa733904Carl Shapirostruct CStringLt {
261fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  bool operator()(const char* s1, const char* s2) const {
271fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro    return strcmp(s1, s2) < 0;
281fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  }
291fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro};
301fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
311fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro// Key equality function for C strings.
321fb8620309a4e94d11879aabc33364acfa733904Carl Shapirostruct CStringEq {
331fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  bool operator()(const char* s1, const char* s2) const {
341fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro    return strcmp(s1, s2) == 0;
351fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro  }
361fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro};
371fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
381fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro}  // namespace art
391fb8620309a4e94d11879aabc33364acfa733904Carl Shapiro
40fc0e3219edc9a5bf81b166e82fd5db2796eb6a0dBrian Carlstrom#endif  // ART_RUNTIME_STRUTIL_H_
41