Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
WAST::Name Struct Reference

#include <Parse.h>

Classes

struct  Hasher
 

Public Member Functions

 Name ()
 
 Name (const char *inBegin, U32 inNumChars)
 
 operator bool () const
 
std::string getString () const
 
Uptr getCharOffset (const char *string) const
 

Friends

bool operator== (const Name &a, const Name &b)
 
bool operator!= (const Name &a, const Name &b)
 

Detailed Description

Definition at line 48 of file Parse.h.

Constructor & Destructor Documentation

◆ Name() [1/2]

WAST::Name::Name ( )
inline

Definition at line 50 of file Parse.h.

50: begin(nullptr), numChars(0), hash(0) {}

◆ Name() [2/2]

WAST::Name::Name ( const char * inBegin,
U32 inNumChars )
inline

Definition at line 51 of file Parse.h.

52 : begin(inBegin)
53 , numChars(inNumChars)
54 , hash(calcHash(inBegin,inNumChars))
55 {}

Member Function Documentation

◆ getCharOffset()

Uptr WAST::Name::getCharOffset ( const char * string) const
inline

Definition at line 59 of file Parse.h.

59{ return begin - string; }

◆ getString()

std::string WAST::Name::getString ( ) const
inline

Definition at line 58 of file Parse.h.

58{ return begin ? std::string(begin + 1,numChars - 1) : std::string(); }
Definition name.hpp:106
Here is the caller graph for this function:

◆ operator bool()

WAST::Name::operator bool ( ) const
inline

Definition at line 57 of file Parse.h.

57{ return begin != nullptr; }

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const Name & a,
const Name & b )
friend

Definition at line 65 of file Parse.h.

66 {
67 return !(a == b);
68 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ operator==

bool operator== ( const Name & a,
const Name & b )
friend

Definition at line 61 of file Parse.h.

62 {
63 return a.hash == b.hash && a.numChars == b.numChars && memcmp(a.begin,b.begin,a.numChars) == 0;
64 }

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