C++ Reference: file_util

This documentation is automatically generated.



Reads a proto from a file. Supports the following formats: binary, text, JSON, all of those optionally gzipped. Returns false on failure.
Function Type Arguments Comments
ReadAllRecordsOrDie

Return type: std::vector<Proto>

Arguments: absl::string_view filename

ReadAllRecordsOrDie

Return type: std::vector<Proto>

Arguments: File* file

ReadFileToProto

Return type: bool

Arguments: absl::string_view filename, google::protobuf::Message* proto

ReadFileToProtoOrDie

Return type: Proto

Arguments: absl::string_view filename

ReadNumRecords

Return type: std::vector<Proto>

Arguments: File* file, int expected_num_records

ReadNumRecords

Return type: std::vector<Proto>

Arguments: absl::string_view filename, int expected_num_records

ReadOneRecordOrDie

Return type: Proto

Arguments: absl::string_view filename

WriteProtoToFile

Return type: bool

Arguments: absl::string_view filename, const google::protobuf::Message& proto, ProtoWriteFormat proto_write_format, bool gzipped

WriteRecordsOrDie

Return type: void

Arguments: absl::string_view filename, const std::vector<Proto>& protos

Send feedback about...