OR-Tools  9.6
file Namespace Reference

Namespaces

 internal
 

Typedefs

using Options = int
 

Functions

absl::Status Open (const absl::string_view &filename, const absl::string_view &mode, File **f, int flags)
 
FileOpenOrDie (const absl::string_view &filename, const absl::string_view &mode, int flags)
 
absl::Status GetContents (const absl::string_view &filename, std::string *output, int flags)
 
absl::Status WriteString (File *file, const absl::string_view &contents, int flags)
 
absl::Status SetContents (const absl::string_view &filename, const absl::string_view &contents, int flags)
 
bool ReadFileToString (const absl::string_view &file_name, std::string *output)
 
bool WriteStringToFile (const std::string &data, const absl::string_view &file_name)
 
bool ReadFileToProto (const absl::string_view &file_name, google::protobuf::Message *proto)
 
void ReadFileToProtoOrDie (const absl::string_view &file_name, google::protobuf::Message *proto)
 
bool WriteProtoToASCIIFile (const google::protobuf::Message &proto, const absl::string_view &file_name)
 
void WriteProtoToASCIIFileOrDie (const google::protobuf::Message &proto, const absl::string_view &file_name)
 
bool WriteProtoToFile (const google::protobuf::Message &proto, const absl::string_view &file_name)
 
void WriteProtoToFileOrDie (const google::protobuf::Message &proto, const absl::string_view &file_name)
 
absl::Status GetTextProto (const absl::string_view &filename, google::protobuf::Message *proto, int flags)
 
absl::Status SetTextProto (const absl::string_view &filename, const google::protobuf::Message &proto, int flags)
 
absl::Status GetBinaryProto (const absl::string_view filename, google::protobuf::Message *const proto, const int flags)
 
absl::Status SetBinaryProto (const absl::string_view &filename, const google::protobuf::Message &proto, int flags)
 
absl::Status Delete (const absl::string_view &path, int flags)
 
absl::Status Exists (const absl::string_view &path, int flags)
 
Options Defaults ()
 
template<typename T >
absl::StatusOr< T > GetTextProto (absl::string_view filename, int flags)
 
template<typename T >
absl::StatusOr< T > GetBinaryProto (absl::string_view filename, int flags)
 
absl::Status Match (std::string_view pattern, std::vector< std::string > *result, const file::Options &options)
 
std::string JoinPath (absl::string_view path1, absl::string_view path2)
 
bool IsAbsolutePath (absl::string_view path)
 
std::string AddSlash (absl::string_view path)
 
absl::string_view Dirname (absl::string_view path)
 
absl::string_view Basename (absl::string_view path)
 
std::pair< absl::string_view, absl::string_view > SplitPath (absl::string_view path)
 
absl::string_view Stem (absl::string_view path)
 
absl::string_view Extension (absl::string_view path)
 
std::string CleanPath (const absl::string_view unclean_path)
 
std::string CollapseSlashes (absl::string_view path)
 
std::string JoinPath ()
 
std::string JoinPath (absl::string_view path)
 
template<typename... T>
std::string JoinPath (absl::string_view path1, absl::string_view path2, absl::string_view path3, const T &... args)
 
template<typename... T>
std::string JoinPathRespectAbsolute (const T &... args)
 

Typedef Documentation

◆ Options

using Options = int

Definition at line 121 of file base/file.h.

Function Documentation

◆ AddSlash()

std::string AddSlash ( absl::string_view  path)

Definition at line 96 of file path.cc.

◆ Basename()

absl::string_view Basename ( absl::string_view  path)

Definition at line 109 of file path.cc.

◆ CleanPath()

std::string CleanPath ( const absl::string_view  unclean_path)

Definition at line 137 of file path.cc.

◆ CollapseSlashes()

std::string CollapseSlashes ( absl::string_view  path)

Definition at line 218 of file path.cc.

◆ Defaults()

Options file::Defaults ( )
inline

Definition at line 123 of file base/file.h.

◆ Delete()

absl::Status Delete ( const absl::string_view &  path,
int  flags 
)

Definition at line 332 of file base/file.cc.

◆ Dirname()

absl::string_view Dirname ( absl::string_view  path)

Definition at line 105 of file path.cc.

◆ Exists()

absl::Status Exists ( const absl::string_view &  path,
int  flags 
)

Definition at line 340 of file base/file.cc.

◆ Extension()

absl::string_view Extension ( absl::string_view  path)

Definition at line 133 of file path.cc.

◆ GetBinaryProto() [1/2]

absl::StatusOr<T> file::GetBinaryProto ( absl::string_view  filename,
int  flags 
)

Definition at line 143 of file base/file.h.

◆ GetBinaryProto() [2/2]

absl::Status GetBinaryProto ( const absl::string_view  filename,
google::protobuf::Message *const  proto,
const int  flags 
)

Definition at line 309 of file base/file.cc.

◆ GetContents()

absl::Status GetContents ( const absl::string_view &  filename,
std::string *  output,
int  flags 
)

Definition at line 164 of file base/file.cc.

◆ GetTextProto() [1/2]

absl::StatusOr<T> file::GetTextProto ( absl::string_view  filename,
int  flags 
)

Definition at line 133 of file base/file.h.

◆ GetTextProto() [2/2]

absl::Status GetTextProto ( const absl::string_view &  filename,
google::protobuf::Message *  proto,
int  flags 
)

Definition at line 289 of file base/file.cc.

◆ IsAbsolutePath()

bool IsAbsolutePath ( absl::string_view  path)

Definition at line 92 of file path.cc.

◆ JoinPath() [1/4]

std::string file::JoinPath ( )
inline

Definition at line 82 of file path.h.

◆ JoinPath() [2/4]

std::string file::JoinPath ( absl::string_view  path)
inline

Definition at line 83 of file path.h.

◆ JoinPath() [3/4]

std::string JoinPath ( absl::string_view  path1,
absl::string_view  path2 
)

Definition at line 25 of file path.cc.

◆ JoinPath() [4/4]

std::string file::JoinPath ( absl::string_view  path1,
absl::string_view  path2,
absl::string_view  path3,
const T &...  args 
)
inline

Definition at line 88 of file path.h.

◆ JoinPathRespectAbsolute()

std::string file::JoinPathRespectAbsolute ( const T &...  args)
inline

Definition at line 104 of file path.h.

◆ Match()

absl::Status Match ( std::string_view  pattern,
std::vector< std::string > *  result,
const file::Options options 
)

Definition at line 20 of file filesystem.cc.

◆ Open()

absl::Status Open ( const absl::string_view &  filename,
const absl::string_view &  mode,
File **  f,
int  flags 
)

Definition at line 143 of file base/file.cc.

◆ OpenOrDie()

File * OpenOrDie ( const absl::string_view &  filename,
const absl::string_view &  mode,
int  flags 
)

Definition at line 155 of file base/file.cc.

◆ ReadFileToProto()

bool ReadFileToProto ( const absl::string_view &  file_name,
google::protobuf::Message *  proto 
)

Definition at line 231 of file base/file.cc.

◆ ReadFileToProtoOrDie()

void ReadFileToProtoOrDie ( const absl::string_view &  file_name,
google::protobuf::Message *  proto 
)

Definition at line 260 of file base/file.cc.

◆ ReadFileToString()

bool ReadFileToString ( const absl::string_view &  file_name,
std::string *  output 
)

Definition at line 215 of file base/file.cc.

◆ SetBinaryProto()

absl::Status SetBinaryProto ( const absl::string_view &  filename,
const google::protobuf::Message &  proto,
int  flags 
)

Definition at line 322 of file base/file.cc.

◆ SetContents()

absl::Status SetContents ( const absl::string_view &  filename,
const absl::string_view &  contents,
int  flags 
)

Definition at line 205 of file base/file.cc.

◆ SetTextProto()

absl::Status SetTextProto ( const absl::string_view &  filename,
const google::protobuf::Message &  proto,
int  flags 
)

Definition at line 299 of file base/file.cc.

◆ SplitPath()

std::pair< absl::string_view, absl::string_view > SplitPath ( absl::string_view  path)

Definition at line 113 of file path.cc.

◆ Stem()

absl::string_view Stem ( absl::string_view  path)

Definition at line 129 of file path.cc.

◆ WriteProtoToASCIIFile()

bool WriteProtoToASCIIFile ( const google::protobuf::Message &  proto,
const absl::string_view &  file_name 
)

Definition at line 265 of file base/file.cc.

◆ WriteProtoToASCIIFileOrDie()

void WriteProtoToASCIIFileOrDie ( const google::protobuf::Message &  proto,
const absl::string_view &  file_name 
)

Definition at line 272 of file base/file.cc.

◆ WriteProtoToFile()

bool WriteProtoToFile ( const google::protobuf::Message &  proto,
const absl::string_view &  file_name 
)

Definition at line 277 of file base/file.cc.

◆ WriteProtoToFileOrDie()

void WriteProtoToFileOrDie ( const google::protobuf::Message &  proto,
const absl::string_view &  file_name 
)

Definition at line 284 of file base/file.cc.

◆ WriteString()

absl::Status WriteString ( File file,
const absl::string_view &  contents,
int  flags 
)

Definition at line 194 of file base/file.cc.

◆ WriteStringToFile()

bool WriteStringToFile ( const std::string &  data,
const absl::string_view &  file_name 
)

Definition at line 219 of file base/file.cc.