From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- xpcom/string/nsStringFwd.h | 92 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 xpcom/string/nsStringFwd.h (limited to 'xpcom/string/nsStringFwd.h') diff --git a/xpcom/string/nsStringFwd.h b/xpcom/string/nsStringFwd.h new file mode 100644 index 0000000000..f737545163 --- /dev/null +++ b/xpcom/string/nsStringFwd.h @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +/* nsStringFwd.h --- forward declarations for string classes */ + +#ifndef nsStringFwd_h +#define nsStringFwd_h + +#include "nscore.h" + +static constexpr int32_t kNotFound = -1; + +namespace mozilla { +namespace detail { + +template +class nsTStringRepr; + +using nsStringRepr = nsTStringRepr; +using nsCStringRepr = nsTStringRepr; + +} // namespace detail +} // namespace mozilla + +static const size_t AutoStringDefaultStorageSize = 64; + +template +class nsTSubstring; +template +class nsTSubstringTuple; +template +class nsTString; +template +class nsTAutoStringN; +template +class nsTDependentString; +template +class nsTDependentSubstring; +template +class nsTPromiseFlatString; +template +class nsTLiteralString; +template +class nsTSubstringSplitter; + +template +using nsTStringComparator = int (*)(const T*, const T*, size_t, size_t); + +// The default string comparator (case-sensitive comparision) +template +int nsTDefaultStringComparator(const T*, const T*, size_t, size_t); + +// 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 +using nsTAutoString = nsTAutoStringN; + +// Double-byte (char16_t) string types. + +using nsAString = nsTSubstring; +using nsSubstringTuple = nsTSubstringTuple; +using nsString = nsTString; +using nsAutoString = nsTAutoString; +template +using nsAutoStringN = nsTAutoStringN; +using nsDependentString = nsTDependentString; +using nsDependentSubstring = nsTDependentSubstring; +using nsPromiseFlatString = nsTPromiseFlatString; +using nsStringComparator = nsTStringComparator; +using nsLiteralString = nsTLiteralString; +using nsSubstringSplitter = nsTSubstringSplitter; + +// Single-byte (char) string types. + +using nsACString = nsTSubstring; +using nsCSubstringTuple = nsTSubstringTuple; +using nsCString = nsTString; +using nsAutoCString = nsTAutoString; +template +using nsAutoCStringN = nsTAutoStringN; +using nsDependentCString = nsTDependentString; +using nsDependentCSubstring = nsTDependentSubstring; +using nsPromiseFlatCString = nsTPromiseFlatString; +using nsCStringComparator = nsTStringComparator; +using nsLiteralCString = nsTLiteralString; +using nsCSubstringSplitter = nsTSubstringSplitter; + +#endif /* !defined(nsStringFwd_h) */ -- cgit v1.2.3