MCPcopy Create free account
hub / github.com/Norbyte/ositools / OsirisPropertyMapGetRaw

Function OsirisPropertyMapGetRaw

OsiInterface/PropertyMaps.cpp:354–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352
353
354 bool OsirisPropertyMapGetRaw(PropertyMapBase const & propertyMap, void * obj,
355 OsiArgumentDesc & args, uint32_t firstArg, OsiPropertyMapType type, bool throwError)
356 {
357 auto propertyName = args.Get(firstArg).String;
358
359 if (obj == nullptr) {
360 OsiError("Attempted to get property '" << propertyName << "' of null object!");
361 return false;
362 }
363
364 switch (type) {
365 case OsiPropertyMapType::Integer:
366 {
367 auto val = propertyMap.getInt(obj, propertyName, false, false);
368 if (val) {
369 args.Get(firstArg + 1).Int32 = (int32_t)*val;
370 } else {
371 auto boolval = propertyMap.getFlag(obj, propertyName, false, throwError);
372 if (boolval) {
373 args.Get(firstArg + 1).Int32 = *boolval ? 1 : 0;
374 } else {
375 return false;
376 }
377 }
378
379 return true;
380 }
381
382 case OsiPropertyMapType::Integer64:
383 {
384 auto val = propertyMap.getInt(obj, propertyName, false, throwError);
385 if (!val) {
386 return false;
387 }
388
389 args.Get(firstArg + 1).Int64 = (int64_t)*val;
390 return true;
391 }
392
393 case OsiPropertyMapType::Real:
394 {
395 auto val = propertyMap.getFloat(obj, propertyName, false, throwError);
396 if (!val) {
397 return false;
398 }
399
400 args.Get(firstArg + 1).Float = *val;
401 return true;
402 }
403
404 case OsiPropertyMapType::String:
405 {
406 auto val = propertyMap.getString(obj, propertyName, false, throwError);
407 if (!val) {
408 return false;
409 }
410
411 args.Get(firstArg + 1).String = *val;

Callers 1

OsirisPropertyMapGetFunction · 0.85

Calls 9

ToFixedStringFunction · 0.85
FindGameObjectByHandleFunction · 0.85
getIntMethod · 0.80
getFlagMethod · 0.80
getFloatMethod · 0.80
getStringMethod · 0.80
getHandleMethod · 0.80
getVector3Method · 0.80
GetMethod · 0.45

Tested by

no test coverage detected