xpcom/string/public/nsAString.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     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"
     8 #ifndef nsAString_h___
     9 #define nsAString_h___
    11 #include "nsStringFwd.h"
    12 #include "nsStringIterator.h"
    14 #include <string.h>
    15 #include <stdarg.h>
    17 #include "mozilla/fallible.h"
    19 #define kNotFound -1
    21   // declare nsAString
    22 #include "string-template-def-unichar.h"
    23 #include "nsTSubstring.h"
    24 #include "string-template-undef.h"
    26   // declare nsACString
    27 #include "string-template-def-char.h"
    28 #include "nsTSubstring.h"
    29 #include "string-template-undef.h"
    32   /**
    33    * ASCII case-insensitive comparator.  (for Unicode case-insensitive
    34    * comparision, see nsUnicharUtils.h)
    35    */
    36 class nsCaseInsensitiveCStringComparator
    37     : public nsCStringComparator
    38   {
    39     public:
    40       nsCaseInsensitiveCStringComparator() {}
    41       typedef char char_type;
    43       virtual int operator()( const char_type*, const char_type*, uint32_t, uint32_t ) const;
    44   };
    46 class nsCaseInsensitiveCStringArrayComparator
    47   {
    48     public:
    49       template<class A, class B>
    50       bool Equals(const A& a, const B& b) const {
    51         return a.Equals(b, nsCaseInsensitiveCStringComparator());
    52       }
    53   };
    55   // included here for backwards compatibility
    56 #ifndef nsSubstringTuple_h___
    57 #include "nsSubstringTuple.h"
    58 #endif
    60 #endif // !defined(nsAString_h___)

mercurial