#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_TEXT_STRING_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_TEXT_STRING_IMPL_H_
#include <limits.h>
#include <string.h>
#include <atomic>
#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/dcheck_is_on.h"
#include "base/functional/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/text/ascii_ctype.h"
#include "third_party/blink/renderer/platform/wtf/text/ascii_fast_path.h"
#include "third_party/blink/renderer/platform/wtf/text/number_parsing_options.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hasher.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/blink/renderer/platform/wtf/wtf_export.h"
#if BUILDFLAG(IS_APPLE)
#include "base/apple/scoped_cftyperef.h"
typedef const struct __CFString* CFStringRef;
#endif
#ifdef __OBJC__
@class NSString;
#endif
namespace WTF {
enum TextCaseSensitivity { … };
WTF_EXPORT unsigned ComputeHashForWideString(const UChar* str, unsigned length);
enum StripBehavior { … };
CharacterMatchFunctionPtr;
IsWhiteSpaceFunctionPtr;
StaticStringsTable;
class WTF_EXPORT StringImpl { … };
template <>
ALWAYS_INLINE const LChar* StringImpl::GetCharacters<LChar>() const { … }
template <>
ALWAYS_INLINE const UChar* StringImpl::GetCharacters<UChar>() const { … }
template <>
ALWAYS_INLINE size_t StringImpl::AllocationSize<LChar>(wtf_size_t length) { … }
WTF_EXPORT bool Equal(const StringImpl*, const StringImpl*);
WTF_EXPORT bool Equal(const StringImpl*, const LChar*);
inline bool Equal(const StringImpl* a, const char* b) { … }
WTF_EXPORT bool Equal(const StringImpl*, const LChar*, wtf_size_t);
WTF_EXPORT bool Equal(const StringImpl*, const UChar*, wtf_size_t);
inline bool Equal(const StringImpl* a, const char* b, wtf_size_t length) { … }
inline bool Equal(const LChar* a, StringImpl* b) { … }
inline bool Equal(const char* a, StringImpl* b) { … }
WTF_EXPORT bool EqualNonNull(const StringImpl* a, const StringImpl* b);
ALWAYS_INLINE bool StringImpl::ContainsOnlyASCIIOrEmpty() const { … }
ALWAYS_INLINE bool StringImpl::IsLowerASCII() const { … }
template <typename CharType>
ALWAYS_INLINE bool Equal(const CharType* a,
const CharType* b,
wtf_size_t length) { … }
ALWAYS_INLINE bool Equal(const LChar* a, const UChar* b, wtf_size_t length) { … }
ALWAYS_INLINE bool Equal(const UChar* a, const LChar* b, wtf_size_t length) { … }
WTF_EXPORT bool DeprecatedEqualIgnoringCase(const LChar*,
const LChar*,
wtf_size_t length);
WTF_EXPORT bool DeprecatedEqualIgnoringCase(const UChar*,
const LChar*,
wtf_size_t length);
inline bool DeprecatedEqualIgnoringCase(const LChar* a,
const UChar* b,
wtf_size_t length) { … }
WTF_EXPORT bool DeprecatedEqualIgnoringCase(const UChar*,
const UChar*,
wtf_size_t length);
WTF_EXPORT bool EqualIgnoringNullity(StringImpl*, StringImpl*);
template <typename CharacterTypeA, typename CharacterTypeB>
inline bool EqualIgnoringASCIICase(const CharacterTypeA* a,
const CharacterTypeB* b,
wtf_size_t length) { … }
WTF_EXPORT int CodeUnitCompareIgnoringASCIICase(const StringImpl*,
const StringImpl*);
WTF_EXPORT int CodeUnitCompareIgnoringASCIICase(const StringImpl*,
const LChar*);
inline wtf_size_t Find(const LChar* characters,
wtf_size_t length,
LChar match_character,
wtf_size_t index = 0) { … }
inline wtf_size_t Find(const UChar* characters,
wtf_size_t length,
UChar match_character,
wtf_size_t index = 0) { … }
ALWAYS_INLINE wtf_size_t Find(const UChar* characters,
wtf_size_t length,
LChar match_character,
wtf_size_t index = 0) { … }
inline wtf_size_t Find(const LChar* characters,
wtf_size_t length,
UChar match_character,
wtf_size_t index = 0) { … }
template <typename CharacterType>
inline wtf_size_t Find(const CharacterType* characters,
wtf_size_t length,
char match_character,
wtf_size_t index = 0) { … }
inline wtf_size_t Find(const LChar* characters,
wtf_size_t length,
CharacterMatchFunctionPtr match_function,
wtf_size_t index = 0) { … }
inline wtf_size_t Find(const UChar* characters,
wtf_size_t length,
CharacterMatchFunctionPtr match_function,
wtf_size_t index = 0) { … }
template <typename CharacterType>
inline wtf_size_t ReverseFind(const CharacterType* characters,
wtf_size_t length,
CharacterType match_character,
wtf_size_t index = UINT_MAX) { … }
ALWAYS_INLINE wtf_size_t ReverseFind(const UChar* characters,
wtf_size_t length,
LChar match_character,
wtf_size_t index = UINT_MAX) { … }
inline wtf_size_t ReverseFind(const LChar* characters,
wtf_size_t length,
UChar match_character,
wtf_size_t index = UINT_MAX) { … }
inline wtf_size_t StringImpl::Find(LChar character, wtf_size_t start) { … }
ALWAYS_INLINE wtf_size_t StringImpl::Find(char character, wtf_size_t start) { … }
inline wtf_size_t StringImpl::Find(UChar character, wtf_size_t start) { … }
inline wtf_size_t LengthOfNullTerminatedString(const UChar* string) { … }
template <wtf_size_t inlineCapacity>
bool EqualIgnoringNullity(const Vector<UChar, inlineCapacity>& a,
StringImpl* b) { … }
template <typename CharacterType1, typename CharacterType2>
static inline int CodeUnitCompare(wtf_size_t l1,
wtf_size_t l2,
const CharacterType1* c1,
const CharacterType2* c2) { … }
static inline int CodeUnitCompare8(const StringImpl* string1,
const StringImpl* string2) { … }
static inline int CodeUnitCompare16(const StringImpl* string1,
const StringImpl* string2) { … }
static inline int CodeUnitCompare8To16(const StringImpl* string1,
const StringImpl* string2) { … }
static inline int CodeUnitCompare(const StringImpl* string1,
const StringImpl* string2) { … }
inline scoped_refptr<StringImpl> StringImpl::IsolatedCopy() const { … }
template <typename BufferType>
inline void StringImpl::AppendTo(BufferType& result,
wtf_size_t start,
wtf_size_t length) const { … }
template <typename BufferType>
inline void StringImpl::PrependTo(BufferType& result,
wtf_size_t start,
wtf_size_t length) const { … }
template <typename T>
struct HashTraits;
template <>
struct HashTraits<StringImpl*>;
template <>
struct HashTraits<scoped_refptr<StringImpl>>;
}
Equal;
EqualNonNull;
kTextCaseASCIIInsensitive;
kTextCaseSensitive;
kTextCaseUnicodeInsensitive;
LengthOfNullTerminatedString;
ReverseFind;
StringImpl;
TextCaseSensitivity;
#endif