atscppapi  1.0.9
C++ wrapper for Apache Traffic Server API
 All Classes Files Functions Enumerations Enumerator Macros
CaseInsensitiveStringComparator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 LinkedIn Corp. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
4  * except in compliance with the License. You may obtain a copy of the license at
5  * http://www.apache.org/licenses/LICENSE-2.0
6  *
7  * Unless required by applicable law or agreed to in writing, software distributed under the
8  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
9  * either express or implied.
10  *
11  */
12 
13 /**
14  * @file CaseInsensitiveStringComparator.h
15  * @author Brian Geffon
16  * @author Manjesh Nilange
17  * @brief A case insensitive comparator that can be used with STL containers.
18  */
19 
20 #pragma once
21 #ifndef ATSCPPAPI_CASE_INSENSITIVE_STRING_COMPARATOR_H_
22 #define ATSCPPAPI_CASE_INSENSITIVE_STRING_COMPARATOR_H_
23 
24 #include <string>
25 
26 namespace atscppapi {
27 
28 /**
29  * @brief A case insensitive comparator that can be used with standard library containers.
30  *
31  * The primary use for this class is to make all Headers case insensitive.
32  */
34 public:
35  /**
36  * @return true if lhs is lexicographically "less-than" rhs; meant for use in std::map or other standard library containers.
37  */
38  bool operator()(const std::string &lhs, const std::string &rhs) const;
39 
40  /**
41  * @return numerical value of lexicographical comparison a la strcmp
42  */
43  int compare(const std::string &lhs, const std::string &rhs) const;
44 };
45 
46 }
47 
48 #endif