00001 /** 00002 Licensed to the Apache Software Foundation (ASF) under one 00003 or more contributor license agreements. See the NOTICE file 00004 distributed with this work for additional information 00005 regarding copyright ownership. The ASF licenses this file 00006 to you under the Apache License, Version 2.0 (the 00007 "License"); you may not use this file except in compliance 00008 with the License. You may obtain a copy of the License at 00009 00010 http://www.apache.org/licenses/LICENSE-2.0 00011 00012 Unless required by applicable law or agreed to in writing, software 00013 distributed under the License is distributed on an "AS IS" BASIS, 00014 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 See the License for the specific language governing permissions and 00016 limitations under the License. 00017 */ 00018 /** 00019 * @file CaseInsensitiveStringComparator.h 00020 * @brief A case insensitive comparator that can be used with STL containers. 00021 */ 00022 00023 #pragma once 00024 #ifndef ATSCPPAPI_CASE_INSENSITIVE_STRING_COMPARATOR_H_ 00025 #define ATSCPPAPI_CASE_INSENSITIVE_STRING_COMPARATOR_H_ 00026 00027 #include <string> 00028 00029 namespace atscppapi { 00030 00031 /** 00032 * @brief A case insensitive comparator that can be used with standard library containers. 00033 * 00034 * The primary use for this class is to make all Headers case insensitive. 00035 */ 00036 class CaseInsensitiveStringComparator { 00037 public: 00038 /** 00039 * @return true if lhs is lexicographically "less-than" rhs; meant for use in std::map or other standard library containers. 00040 */ 00041 bool operator()(const std::string &lhs, const std::string &rhs) const; 00042 00043 /** 00044 * @return numerical value of lexicographical comparison a la strcmp 00045 */ 00046 int compare(const std::string &lhs, const std::string &rhs) const; 00047 }; 00048 00049 } 00050 00051 #endif