1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // IWYU pragma: private, include "nsString.h"
7 
8 #ifndef nsAString_h___
9 #define nsAString_h___
10 
11 #include "nsStringFwd.h"
12 #include "nsStringIterator.h"
13 #include "mozilla/TypedEnumBits.h"
14 
15 #include <string.h>
16 #include <stdarg.h>
17 
18 #define kNotFound -1
19 
20 #include "nsStringFlags.h"
21 #include "nsTStringRepr.h"
22 #include "nsTSubstring.h"
23 #include "nsTSubstringTuple.h"
24 
25 /**
26  * ASCII case-insensitive comparator.  (for Unicode case-insensitive
27  * comparision, see nsUnicharUtils.h)
28  */
29 class nsCaseInsensitiveCStringComparator : public nsCStringComparator {
30  public:
nsCaseInsensitiveCStringComparator()31   nsCaseInsensitiveCStringComparator() {}
32   typedef char char_type;
33 
34   virtual int operator()(const char_type*, const char_type*, uint32_t,
35                          uint32_t) const override;
36 };
37 
38 class nsCaseInsensitiveCStringArrayComparator {
39  public:
40   template <class A, class B>
Equals(const A & aStrA,const B & aStrB)41   bool Equals(const A& aStrA, const B& aStrB) const {
42     return aStrA.Equals(aStrB, nsCaseInsensitiveCStringComparator());
43   }
44 };
45 
46 #endif  // !defined(nsAString_h___)
47