Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::CharArray< CharType > Class Template Reference

#include <canonical_tables.h>

Public Member Functions

 CharArray (const CharType *data, intptr_t len)
 
StringPtr ToSymbol () const
 
bool Equals (const String &other) const
 
uword Hash () const
 

Detailed Description

template<typename CharType>
class dart::CharArray< CharType >

Definition at line 15 of file canonical_tables.h.

Constructor & Destructor Documentation

◆ CharArray()

template<typename CharType >
dart::CharArray< CharType >::CharArray ( const CharType *  data,
intptr_t  len 
)
inline

Definition at line 17 of file canonical_tables.h.

17 : data_(data), len_(len) {
18 hash_ = String::Hash(data, len);
19 }
uword Hash() const
Definition: object.h:10216
static int8_t data[kExtLength]

Member Function Documentation

◆ Equals()

template<typename CharType >
bool dart::CharArray< CharType >::Equals ( const String other) const
inline

Definition at line 26 of file canonical_tables.h.

26 {
27 ASSERT(other.HasHash());
28 if (other.Hash() != hash_) {
29 return false;
30 }
31 return other.Equals(data_, len_);
32 }
#define ASSERT(E)

◆ Hash()

template<typename CharType >
uword dart::CharArray< CharType >::Hash ( ) const
inline

Definition at line 33 of file canonical_tables.h.

33{ return hash_; }

◆ ToSymbol()

template<typename CharType >
StringPtr dart::CharArray< CharType >::ToSymbol ( ) const
inline

Definition at line 20 of file canonical_tables.h.

20 {
21 String& result = String::Handle(StringFrom(data_, len_, Heap::kOld));
22 result.SetCanonical();
23 result.SetHash(hash_);
24 return result.ptr();
25 }
@ kOld
Definition: heap.h:39
static Object & Handle()
Definition: object.h:407
GAsyncResult * result
StringPtr StringFrom(const uint8_t *data, intptr_t len, Heap::Space space)
Definition: symbols.cc:38

The documentation for this class was generated from the following file: