Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
file_util.cc File Reference
#include "ortools/util/file_util.h"
#include <string>
#include <utility>
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/tokenizer.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
#include "google/protobuf/json/json.h"
#include "google/protobuf/message.h"
#include "google/protobuf/text_format.h"
#include "google/protobuf/util/json_util.h"
#include "ortools/base/file.h"
#include "ortools/base/gzipstring.h"
#include "ortools/base/helpers.h"
#include "ortools/base/logging.h"
#include "ortools/base/options.h"
#include "ortools/base/status_macros.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 

Functions

absl::StatusOr< std::string > operations_research::ReadFileToString (absl::string_view filename)
 Reads a file, optionally gzipped, to a string.
 
absl::Status operations_research::ReadFileToProto (absl::string_view filename, google::protobuf::Message *proto, bool allow_partial)
 
absl::Status operations_research::StringToProto (absl::string_view data, google::protobuf::Message *proto, bool allow_partial=false)
 Exactly like ReadFileToProto(), but directly from the contents.
 
absl::Status operations_research::WriteProtoToFile (absl::string_view filename, const google::protobuf::Message &proto, ProtoWriteFormat proto_write_format, bool gzipped, bool append_extension_to_file_name)