OpenClonk
C4String Class Reference

#include <C4StringTable.h>

Inheritance diagram for C4String:
[legend]
Collaboration diagram for C4String:
[legend]

Public Member Functions

 ~C4String () override
 
const char * GetCStr () const
 
StdStrBuf GetData () const
 
void IncRef ()
 
void DecRef ()
 

Public Attributes

unsigned int Hash
 

Protected Attributes

unsigned int RefCnt {0}
 

Friends

class C4StringTable
 

Detailed Description

Definition at line 34 of file C4StringTable.h.

Constructor & Destructor Documentation

◆ ~C4String()

C4String::~C4String ( )
override

Definition at line 53 of file C4StringTable.cpp.

References C4Set< T >::Add(), StdStrBuf::getData(), Hash, C4Set< T >::Hash(), StdStrBuf::Ref(), C4RefCnt::RefCnt, C4Set< T >::Remove(), s, and Strings.

54 {
55  // unreg
56 #ifdef _DEBUG
57  static bool remove = false;
58  assert(!remove); (void)remove;
59  remove = true;
60 #endif
61  Strings.Set.Remove(this);
62 #ifdef _DEBUG
63  remove = false;
64 #endif
65 }
C4StringTable Strings
Definition: C4Globals.cpp:42
void Remove(H e)
Here is the call graph for this function:

Member Function Documentation

◆ DecRef()

void C4RefCnt::DecRef ( )
inlineinherited

◆ GetCStr()

◆ GetData()

StdStrBuf C4String::GetData ( ) const
inline

Definition at line 50 of file C4StringTable.h.

References StdStrBuf::getRef().

Referenced by C4PropertyPath::C4PropertyPath(), C4AulExec::ClearPointers(), C4Command::CompileFunc(), C4Value::CompileFunc(), C4EditCursor::DoContextMenu(), C4AulExec::FnTranslate(), C4AulFunc::GetFullName(), GetTextColorForBackground(), C4ValueArraySortcomp::operator()(), C4Object::SetAction(), C4Value::ToJSON(), and C4GraphicsOverlay::UpdateFacet().

50 { return Data.getRef(); }
StdStrBuf getRef() const
Definition: StdBuf.h:462
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IncRef()

void C4RefCnt::IncRef ( )
inlineinherited

Friends And Related Function Documentation

◆ C4StringTable

friend class C4StringTable
friend

Definition at line 45 of file C4StringTable.h.

Member Data Documentation

◆ Hash

unsigned int C4String::Hash

Definition at line 37 of file C4StringTable.h.

Referenced by C4Set< C4String *>::Equals(), C4Set< C4String *>::Hash(), and ~C4String().

◆ RefCnt

unsigned int C4RefCnt::RefCnt {0}
protectedinherited

Definition at line 31 of file C4StringTable.h.

Referenced by C4RefCnt::DecRef(), C4RefCnt::IncRef(), and ~C4String().


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