MCPcopy Create free account
hub / github.com/defold/defold / AddString

Function AddString

engine/dlib/src/dlib/configfile.cpp:341–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 }
340
341 static uint32_t AddString(Context* context, const char* string)
342 {
343 uint32_t l = strlen(string) + 1;
344 if (context->m_StringBuffer.Remaining() < l)
345 {
346 uint32_t off = 0x400;
347 if (l > off)
348 off = l;
349 context->m_StringBuffer.OffsetCapacity(off);
350 }
351 uint32_t s = context->m_StringBuffer.Size();
352 context->m_StringBuffer.SetSize(s + l);
353 memcpy(&context->m_StringBuffer[s], string, l);
354 return s;
355 }
356
357 static bool ContainsKey(const dmArray<ConfigFileEntry>& entries, uint64_t key_hash)
358 {

Callers 3

ReadStringFieldMethod · 0.85
AddEntryFunction · 0.85
AddEntryWithHashedKeyFunction · 0.85

Calls 4

RemainingMethod · 0.45
OffsetCapacityMethod · 0.45
SizeMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected