14#include <system_error>
19 : buffer_chunk_size_(buffer_chunk_size), filepath_(filepath)
23 throw std::system_error(
24 errno, std::system_category(),
"Cannot open file " + std::string(filepath) +
".");
31 fwrite(
b.data(), 1,
b.size(), this->outfile_);
38 int close_status = std::fclose(outfile_);
39 if (close_status == EOF) {
42 if (outfile_ && close_status) {
43 std::cerr <<
"Error: could not close the file '" << this->filepath_
44 <<
"' properly, it may be corrupted." << std::endl;
61 write_fstring(
"property list {} {} {}\n", countType, dataType, name);
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
File and directory operations.
constexpr int64_t size() const
constexpr const T * end() const
constexpr const T * begin() const
void insert(const int64_t insert_index, const T &value)
void ensure_space(size_t at_least)
void write_fstring(const char *fmt, T &&...args)
void write_string(StringRef s)
void write_header_scalar_property(StringRef dataType, StringRef name)
void write_bytes(Span< char > bytes)
void write_header_list_property(StringRef countType, StringRef dataType, StringRef name)
FileBuffer(const char *filepath, size_t buffer_chunk_size=64 *1024)
void write_header_element(StringRef name, int count)
local_group_size(16, 16) .push_constant(Type b