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

Function parseToken

source/MaterialXGraphEditor/Main.cpp:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 " --help Display the complete list of command-line options\n";
39
40template <class T> void parseToken(std::string token, std::string type, T& res)
41{
42 if (token.empty())
43 {
44 return;
45 }
46
47 mx::ValuePtr value = mx::Value::createValueFromStrings(token, type);
48 if (!value)
49 {
50 std::cout << "Unable to parse token " << token << " as type " << type << std::endl;
51 return;
52 }
53
54 res = value->asA<T>();
55}
56
57} // anonymous namespace
58

Callers 1

mainFunction · 0.70

Calls 2

createValueFromStringsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected