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

Function WriteProtoToTextFile

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

Source from the content-addressed store, hash-verified

42}
43
44void WriteProtoToTextFile(const Message& proto, const char* filename) {
45 int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
46 FileOutputStream* output = new FileOutputStream(fd);
47 CHECK(google::protobuf::TextFormat::Print(proto, output));
48 delete output;
49 close(fd);
50}
51
52bool ReadProtoFromBinaryFile(const char* filename, Message* proto) {
53 int fd = open(filename, O_RDONLY);

Callers 3

mainFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by 1