MCPcopy Create free account
hub / github.com/bytedance/bolt / typeFromString

Function typeFromString

bolt/type/parser/ParserUtil.cpp:35–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace bytedance::bolt {
34
35TypePtr typeFromString(
36 const std::string& type,
37 bool failIfNotRegistered = true) {
38 auto upper = type;
39 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
40 if (upper == "INT") {
41 upper = "INTEGER";
42 } else if (upper == "DOUBLE PRECISION") {
43 upper = "DOUBLE";
44 }
45 auto inferredType = getType(upper, {});
46 if (failIfNotRegistered) {
47 BOLT_CHECK(
48 inferredType, "Failed to parse type [{}]. Type not registered.", type);
49 }
50 return inferredType;
51}
52
53std::pair<std::string, std::shared_ptr<const Type>> inferTypeWithSpaces(
54 std::vector<std::string>& words,

Callers 1

inferTypeWithSpacesFunction · 0.85

Calls 3

getTypeFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected