From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. 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