MCPcopy Create free account
hub / github.com/apple/coremltools / makeContents

Function makeContents

mlmodel/tools/enumgen.cpp:96–112  ·  view source on GitHub ↗

handle converting a FileDescriptor to enum strings

Source from the content-addressed store, hash-verified

94
95// handle converting a FileDescriptor to enum strings
96static std::string makeContents(const FileDescriptor& in) {
97 std::stringstream ret;
98
99 std::string guard = makeGuard(in.name());
100 ret << "#ifndef " << guard << std::endl;
101 ret << "#define " << guard << std::endl;
102
103 handleContainer(in, ret);
104 for (size_t i=0; i<in.message_type_count(); i++) {
105 const auto* message = in.message_type(i);
106 handleMessage(*message, ret);
107 }
108
109 ret << "#endif" << std::endl;
110
111 return ret.str();
112}
113
114int main(int argc, char *argv[]) {
115 CodeGeneratorRequest request;

Callers 1

mainFunction · 0.85

Calls 6

makeGuardFunction · 0.85
handleContainerFunction · 0.85
handleMessageFunction · 0.85
message_typeMethod · 0.80
nameMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected