Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ConcatString Class Reference

#include <canonical_tables.h>

Public Member Functions

 ConcatString (const String &str1, const String &str2)
 
StringPtr ToSymbol () const
 
bool Equals (const String &other) const
 
uword Hash () const
 

Detailed Description

Definition at line 68 of file canonical_tables.h.

Constructor & Destructor Documentation

◆ ConcatString()

dart::ConcatString::ConcatString ( const String str1,
const String str2 
)
inline

Definition at line 70 of file canonical_tables.h.

71 : str1_(str1), str2_(str2), hash_(String::HashConcat(str1, str2)) {}
static uword HashConcat(const String &str1, const String &str2)
Definition: object.cc:23485

Member Function Documentation

◆ Equals()

bool dart::ConcatString::Equals ( const String other) const
inline

Definition at line 73 of file canonical_tables.h.

73 {
74 ASSERT(other.HasHash());
75 if (other.Hash() != hash_) {
76 return false;
77 }
78 return other.EqualsConcat(str1_, str2_);
79 }
#define ASSERT(E)

◆ Hash()

uword dart::ConcatString::Hash ( ) const
inline

Definition at line 80 of file canonical_tables.h.

80{ return hash_; }

◆ ToSymbol()

StringPtr dart::ConcatString::ToSymbol ( ) const

Definition at line 59 of file symbols.cc.

59 {
60 String& result = String::Handle(String::Concat(str1_, str2_, Heap::kOld));
61 result.SetCanonical();
62 result.SetHash(hash_);
63 return result.ptr();
64}
@ kOld
Definition: heap.h:39
static Object & Handle()
Definition: object.h:407
static StringPtr Concat(const String &str1, const String &str2, Heap::Space space=Heap::kNew)
Definition: object.cc:24037
GAsyncResult * result

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