MCPcopy Create free account
hub / github.com/crossuo/crossuo / Load

Method Load

src/Managers/ClilocManager.cpp:37–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37astr_t CCliloc::Load(uint32_t id)
38{
39 astr_t result;
40 if (Loaded)
41 {
42 m_File.ResetPtr();
43 m_File.Move(6);
44 while (!m_File.IsEOF())
45 {
46 auto currentID = m_File.ReadUInt32LE();
47 m_File.Move(1);
48 short len = m_File.ReadUInt16LE();
49 if (currentID == id)
50 {
51 if (len > 0)
52 {
53 result = m_File.ReadString(len);
54 s_Cache[currentID] = result;
55 }
56 return result;
57 }
58
59 m_File.Move(len);
60 }
61 }
62 return result;
63}
64
65astr_t CCliloc::GetX(int id, bool toCamelCase, const char *default_value)
66{

Callers 1

CClilocMethod · 0.45

Calls 6

ReadUInt32LEMethod · 0.80
ReadUInt16LEMethod · 0.80
ReadStringMethod · 0.80
ResetPtrMethod · 0.45
MoveMethod · 0.45
IsEOFMethod · 0.45

Tested by

no test coverage detected