MCPcopy Create free account
hub / github.com/Inori/GPCS4 / decodeSymbol

Method decodeSymbol

GPCS4/Emulator/Module.cpp:255–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255bool NativeModule::decodeSymbol(std::string const &strEncName,
256 uint32_t *modId,
257 uint32_t *libId,
258 uint64_t *funcNid) const
259{
260 bool bRet = false;
261
262 do
263 {
264 if (modId == nullptr || libId == nullptr || funcNid == nullptr)
265 {
266 break;
267 }
268
269 auto &nModuleId = *modId;
270 auto &nLibraryId = *libId;
271 auto &nNid = *funcNid;
272
273 std::vector<std::string> vtNameParts = util::str::split(strEncName, '#');
274 if (vtNameParts.empty())
275 {
276 break;
277 }
278
279 if (!decodeValue(vtNameParts[0], nNid))
280 {
281 break;
282 }
283
284 uint64_t nLibId = 0;
285 if (!decodeValue(vtNameParts[1], nLibId))
286 {
287 break;
288 }
289 nLibraryId = static_cast<uint32_t>(nLibId);
290
291 uint64_t nModId = 0;
292 if (!decodeValue(vtNameParts[2], nModId))
293 {
294 break;
295 }
296 nModuleId = static_cast<uint32_t>(nModId);
297
298 bRet = true;
299 } while (false);
300
301 return bRet;
302}
303
304bool NativeModule::isEncodedSymbol(std::string const &symbolName) const
305{

Callers

nothing calls this directly

Calls 2

splitFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected