2014-05-05 21:30:46 +04: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 15:12:37 +04: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/. */
|
2001-04-02 23:40:52 +04:00
|
|
|
|
|
|
|
/* nsStringFwd.h --- forward declarations for string classes */
|
|
|
|
|
2017-08-17 02:48:52 +03:00
|
|
|
#ifndef nsStringFwd_h
|
|
|
|
#define nsStringFwd_h
|
2001-04-02 23:40:52 +04:00
|
|
|
|
2004-02-19 05:44:03 +03:00
|
|
|
#include "nscore.h"
|
2001-06-29 16:47:43 +04:00
|
|
|
|
2022-06-28 04:35:11 +03:00
|
|
|
static constexpr int32_t kNotFound = -1;
|
|
|
|
|
2017-03-14 00:02:50 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace detail {
|
|
|
|
|
2017-08-15 00:22:50 +03:00
|
|
|
template <typename T>
|
|
|
|
class nsTStringRepr;
|
|
|
|
|
|
|
|
using nsStringRepr = nsTStringRepr<char16_t>;
|
|
|
|
using nsCStringRepr = nsTStringRepr<char>;
|
2017-03-14 00:02:50 +03:00
|
|
|
|
|
|
|
} // namespace detail
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2017-08-09 13:41:38 +03:00
|
|
|
static const size_t AutoStringDefaultStorageSize = 64;
|
|
|
|
|
2017-08-15 00:22:50 +03:00
|
|
|
template <typename T>
|
|
|
|
class nsTSubstring;
|
|
|
|
template <typename T>
|
|
|
|
class nsTSubstringTuple;
|
|
|
|
template <typename T>
|
|
|
|
class nsTString;
|
|
|
|
template <typename T, size_t N>
|
|
|
|
class nsTAutoStringN;
|
|
|
|
template <typename T>
|
|
|
|
class nsTDependentString;
|
|
|
|
template <typename T>
|
|
|
|
class nsTDependentSubstring;
|
|
|
|
template <typename T>
|
|
|
|
class nsTPromiseFlatString;
|
|
|
|
template <typename T>
|
|
|
|
class nsTLiteralString;
|
2018-08-09 15:18:22 +03:00
|
|
|
template <typename T>
|
|
|
|
class nsTSubstringSplitter;
|
2017-08-15 00:22:50 +03:00
|
|
|
|
2020-05-27 21:11:12 +03:00
|
|
|
template <typename T>
|
2021-12-14 00:47:56 +03:00
|
|
|
using nsTStringComparator = int (*)(const T*, const T*, size_t, size_t);
|
2020-05-27 21:11:12 +03:00
|
|
|
|
|
|
|
// The default string comparator (case-sensitive comparision)
|
|
|
|
template <typename T>
|
2021-12-14 00:47:56 +03:00
|
|
|
int nsTDefaultStringComparator(const T*, const T*, size_t, size_t);
|
2020-05-27 21:11:12 +03:00
|
|
|
|
2017-08-15 00:22:50 +03:00
|
|
|
// We define this version without a size param instead of providing a
|
|
|
|
// default value for N so that so there is a default typename that doesn't
|
|
|
|
// require angle brackets.
|
|
|
|
template <typename T>
|
|
|
|
using nsTAutoString = nsTAutoStringN<T, AutoStringDefaultStorageSize>;
|
|
|
|
|
2017-06-20 12:19:52 +03:00
|
|
|
// Double-byte (char16_t) string types.
|
2017-08-15 00:22:50 +03:00
|
|
|
|
|
|
|
using nsAString = nsTSubstring<char16_t>;
|
|
|
|
using nsSubstringTuple = nsTSubstringTuple<char16_t>;
|
|
|
|
using nsString = nsTString<char16_t>;
|
|
|
|
using nsAutoString = nsTAutoString<char16_t>;
|
|
|
|
template <size_t N>
|
|
|
|
using nsAutoStringN = nsTAutoStringN<char16_t, N>;
|
|
|
|
using nsDependentString = nsTDependentString<char16_t>;
|
|
|
|
using nsDependentSubstring = nsTDependentSubstring<char16_t>;
|
|
|
|
using nsPromiseFlatString = nsTPromiseFlatString<char16_t>;
|
|
|
|
using nsStringComparator = nsTStringComparator<char16_t>;
|
|
|
|
using nsLiteralString = nsTLiteralString<char16_t>;
|
2018-08-09 15:18:22 +03:00
|
|
|
using nsSubstringSplitter = nsTSubstringSplitter<char16_t>;
|
2001-04-02 23:40:52 +04:00
|
|
|
|
2017-06-20 12:19:52 +03:00
|
|
|
// Single-byte (char) string types.
|
2017-08-15 00:22:50 +03:00
|
|
|
|
|
|
|
using nsACString = nsTSubstring<char>;
|
|
|
|
using nsCSubstringTuple = nsTSubstringTuple<char>;
|
|
|
|
using nsCString = nsTString<char>;
|
|
|
|
using nsAutoCString = nsTAutoString<char>;
|
|
|
|
template <size_t N>
|
|
|
|
using nsAutoCStringN = nsTAutoStringN<char, N>;
|
|
|
|
using nsDependentCString = nsTDependentString<char>;
|
|
|
|
using nsDependentCSubstring = nsTDependentSubstring<char>;
|
|
|
|
using nsPromiseFlatCString = nsTPromiseFlatString<char>;
|
|
|
|
using nsCStringComparator = nsTStringComparator<char>;
|
|
|
|
using nsLiteralCString = nsTLiteralString<char>;
|
2018-08-09 15:18:22 +03:00
|
|
|
using nsCSubstringSplitter = nsTSubstringSplitter<char>;
|
2001-04-02 23:40:52 +04:00
|
|
|
|
2017-08-17 02:48:52 +03:00
|
|
|
#endif /* !defined(nsStringFwd_h) */
|