OR-Tools  8.1
file_util.h File Reference

Go to the source code of this file.

Namespaces

 operations_research
 The vehicle routing library lets one model and solve generic vehicle routing problems ranging from the Traveling Salesman Problem to more complex problems such as the Capacitated Vehicle Routing Problem with Time Windows.
 
 operations_research::internal
 

Enumerations

enum  ProtoWriteFormat { kProtoText, kProtoBinary, kJson }
 

Functions

absl::StatusOr< std::string > ReadFileToString (absl::string_view filename)
 
bool ReadFileToProto (absl::string_view filename, google::protobuf::Message *proto)
 
template<typename Proto >
Proto ReadFileToProtoOrDie (absl::string_view filename)
 
bool WriteProtoToFile (absl::string_view filename, const google::protobuf::Message &proto, ProtoWriteFormat proto_write_format, bool gzipped, bool append_extension_to_file_name)
 
template<typename Proto >
std::vector< Proto > ReadNumRecords (File *file, int expected_num_records)
 
template<typename Proto >
std::vector< Proto > ReadNumRecords (absl::string_view filename, int expected_num_records)
 
template<typename Proto >
std::vector< Proto > ReadAllRecordsOrDie (absl::string_view filename)
 
template<typename Proto >
std::vector< Proto > ReadAllRecordsOrDie (File *file)
 
template<typename Proto >
Proto ReadOneRecordOrDie (absl::string_view filename)
 
template<typename Proto >
void WriteRecordsOrDie (absl::string_view filename, const std::vector< Proto > &protos)