MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / parseToken

Function parseToken

source/MaterialXView/Main.cpp:52–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 " --help Display the complete list of command-line options\n";
51
52template <class T> void parseToken(std::string token, std::string type, T& res)
53{
54 if (token.empty())
55 {
56 return;
57 }
58
59 mx::ValuePtr value = mx::Value::createValueFromStrings(token, type);
60 if (!value)
61 {
62 std::cout << "Unable to parse token " << token << " as type " << type << std::endl;
63 return;
64 }
65
66 res = value->asA<T>();
67}
68
69int main(int argc, char* const argv[])
70{

Callers 1

mainFunction · 0.70

Calls 2

createValueFromStringsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected