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

Function main

mlmodel/tools/enumgen.cpp:114–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114int main(int argc, char *argv[]) {
115 CodeGeneratorRequest request;
116 CodeGeneratorResponse response;
117 DescriptorPool pool;
118
119 bool result = request.ParseFromIstream(&std::cin);
120 if (!result) { return 1; }
121
122 for (const auto& fileDescriptorProto : request.proto_file()) {
123 const auto* fileDescriptor = pool.BuildFile(fileDescriptorProto);
124 auto* outputFile = response.add_file();
125 outputFile->set_name(makeExt(fileDescriptor->name()));
126 outputFile->set_content(makeContents(*fileDescriptor));
127 }
128
129 result = response.SerializeToOstream(&std::cout);
130 if (!result) { return 2; }
131
132 return 0;
133}

Callers

nothing calls this directly

Calls 9

makeExtFunction · 0.85
makeContentsFunction · 0.85
ParseFromIstreamMethod · 0.80
set_contentMethod · 0.80
SerializeToOstreamMethod · 0.80
BuildFileMethod · 0.45
add_fileMethod · 0.45
set_nameMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected