Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
file.h File Reference
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <string>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/message.h"
#include "ortools/base/status_macros.h"

Go to the source code of this file.

Classes

class  File
 

Namespaces

namespace  file
 

Typedefs

using file::Options = int
 

Functions

Options file::Defaults ()
 
absl::Status file::Open (absl::string_view filename, absl::string_view mode, File **f, Options options)
 As of 2016-01, these methods can only be used with flags = file::Defaults().
 
Filefile::OpenOrDie (absl::string_view filename, absl::string_view mode, Options options)
 
absl::Status file::GetTextProto (absl::string_view filename, google::protobuf::Message *proto, Options options)
 
template<typename T >
absl::StatusOr< T > file::GetTextProto (absl::string_view filename, Options options)
 
absl::Status file::SetTextProto (absl::string_view filename, const google::protobuf::Message &proto, Options options)
 
absl::Status file::GetBinaryProto (const absl::string_view filename, google::protobuf::Message *proto, Options options)
 
template<typename T >
absl::StatusOr< T > file::GetBinaryProto (absl::string_view filename, Options options)
 
absl::Status file::SetBinaryProto (absl::string_view filename, const google::protobuf::Message &proto, Options options)
 
absl::Status file::SetContents (absl::string_view filename, absl::string_view contents, Options options)
 
absl::StatusOr< std::string > file::GetContents (absl::string_view path, Options options)
 
absl::Status file::GetContents (absl::string_view filename, std::string *output, Options options)
 
absl::Status file::WriteString (File *file, absl::string_view contents, Options options)
 
bool file::ReadFileToString (absl::string_view file_name, std::string *output)
 
bool file::WriteStringToFile (absl::string_view data, absl::string_view file_name)
 
bool file::ReadFileToProto (absl::string_view file_name, google::protobuf::Message *proto)
 
void file::ReadFileToProtoOrDie (absl::string_view file_name, google::protobuf::Message *proto)
 
bool file::WriteProtoToASCIIFile (const google::protobuf::Message &proto, absl::string_view file_name)
 
void file::WriteProtoToASCIIFileOrDie (const google::protobuf::Message &proto, absl::string_view file_name)
 
bool file::WriteProtoToFile (const google::protobuf::Message &proto, absl::string_view file_name)
 
void file::WriteProtoToFileOrDie (const google::protobuf::Message &proto, absl::string_view file_name)
 
absl::Status file::Delete (absl::string_view path, Options options)
 
absl::Status file::Exists (absl::string_view path, Options options)