MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / ReadProtoFromTextFile

Function ReadProtoFromTextFile

rtpose_wrapper/src/caffe/util/io.cpp:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32using google::protobuf::Message;
33
34bool ReadProtoFromTextFile(const char* filename, Message* proto) {
35 int fd = open(filename, O_RDONLY);
36 CHECK_NE(fd, -1) << "File not found: " << filename;
37 FileInputStream* input = new FileInputStream(fd);
38 bool success = google::protobuf::TextFormat::Parse(input, proto);
39 delete input;
40 close(fd);
41 return success;
42}
43
44void WriteProtoToTextFile(const Message& proto, const char* filename) {
45 int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);

Callers 4

mainFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected