2014-05-05 10:30:46 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2013-09-23 10:23:56 -07:00
|
|
|
// IWYU pragma: private, include "nsString.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsAString_h___
|
|
|
|
#define nsAString_h___
|
|
|
|
|
|
|
|
#include "nsStringFwd.h"
|
|
|
|
#include "nsStringIterator.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
2012-04-13 09:58:59 -07:00
|
|
|
#include <stdarg.h>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-05-08 09:42:27 -07:00
|
|
|
#include "mozilla/fallible.h"
|
|
|
|
|
2008-09-19 08:07:22 -07:00
|
|
|
#define kNotFound -1
|
|
|
|
|
2014-05-05 10:30:46 -07:00
|
|
|
// declare nsAString
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "string-template-def-unichar.h"
|
2008-09-19 08:07:22 -07:00
|
|
|
#include "nsTSubstring.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "string-template-undef.h"
|
|
|
|
|
2014-05-05 10:30:46 -07:00
|
|
|
// declare nsACString
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "string-template-def-char.h"
|
2008-09-19 08:07:22 -07:00
|
|
|
#include "nsTSubstring.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "string-template-undef.h"
|
|
|
|
|
|
|
|
|
2014-05-05 10:30:46 -07:00
|
|
|
/**
|
|
|
|
* ASCII case-insensitive comparator. (for Unicode case-insensitive
|
|
|
|
* comparision, see nsUnicharUtils.h)
|
|
|
|
*/
|
2011-08-18 06:46:39 -07:00
|
|
|
class nsCaseInsensitiveCStringComparator
|
2014-05-05 10:30:46 -07:00
|
|
|
: public nsCStringComparator
|
|
|
|
{
|
|
|
|
public:
|
2014-05-27 00:15:35 -07:00
|
|
|
nsCaseInsensitiveCStringComparator()
|
|
|
|
{
|
|
|
|
}
|
2014-05-05 10:30:46 -07:00
|
|
|
typedef char char_type;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-27 00:15:35 -07:00
|
|
|
virtual int operator()(const char_type*, const char_type*,
|
|
|
|
uint32_t, uint32_t) const;
|
2014-05-05 10:30:46 -07:00
|
|
|
};
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-30 17:50:42 -07:00
|
|
|
class nsCaseInsensitiveCStringArrayComparator
|
2014-05-05 10:30:46 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
template<class A, class B>
|
2014-05-27 00:15:35 -07:00
|
|
|
bool Equals(const A& aStrA, const B& aStrB) const
|
|
|
|
{
|
|
|
|
return aStrA.Equals(aStrB, nsCaseInsensitiveCStringComparator());
|
2014-05-05 10:30:46 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// included here for backwards compatibility
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifndef nsSubstringTuple_h___
|
|
|
|
#include "nsSubstringTuple.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // !defined(nsAString_h___)
|