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

Function StatGetAttributeString

OsiInterface/Functions/StatFunctions.cpp:68–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66 }
67
68 bool StatGetAttributeString(OsiArgumentDesc & args)
69 {
70 auto statName = args[0].String;
71 auto attributeName = args[1].String;
72
73 auto stats = gOsirisProxy->GetLibraryManager().GetStats();
74 if (stats == nullptr) {
75 return false;
76 }
77
78 auto object = stats->objects.Find(statName);
79 if (object == nullptr) {
80 OsiError("Stat object '" << statName << "' does not exist");
81 return false;
82 }
83
84 auto value = stats->GetAttributeFixedString(object, attributeName);
85 if (!value) {
86 OsiError("Attribute '" << attributeName << "' not found on object '" << statName << "'");
87 return false;
88 }
89
90 args[2].String = value->Str;
91 return true;
92 }
93
94 bool StatGetType(OsiArgumentDesc & args)
95 {

Callers

nothing calls this directly

Calls 3

GetStatsMethod · 0.80
FindMethod · 0.45

Tested by

no test coverage detected