MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / ReadString

Method ReadString

core/logic/CDataPack.cpp:185–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185const char *CDataPack::ReadString(size_t *len) const
186{
187 if (!IsReadable() || elements[position].type != CDataPackType::String)
188 {
189 if (len)
190 *len = 0;
191
192 return nullptr;
193 }
194
195 const std::string &val = *elements[position++].pData.sval;
196 if (len)
197 *len = val.size();
198
199 return val.c_str();
200}
201
202cell_t *CDataPack::ReadCellArray(cell_t *size) const
203{

Callers 2

smn_BfReadStringFunction · 0.80
smn_ReadPackStringFunction · 0.80

Calls 2

sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected