18#ifndef __FPSDK_COMMON_PATH_HPP__
19#define __FPSDK_COMMON_PATH_HPP__
161 bool Write(
const std::vector<uint8_t>& data);
171 bool Write(
const uint8_t* data,
const std::size_t size);
180 bool Write(
const std::string& data);
187 const std::string&
Path()
const;
212 std::unique_ptr<std::ostream> fh_;
213 std::size_t size_ = 0;
248 std::size_t
Read(uint8_t* data,
const std::size_t size);
255 const std::string&
Path()
const;
285 bool Seek(
const std::size_t pos);
303 std::unique_ptr<std::istream> fh_;
304 std::size_t size_ = 0;
305 std::size_t pos_ = 0;
307 bool can_seek_ =
false;
328bool FileSpew(
const std::string&
path,
const std::vector<uint8_t>& data);
bool Open(const std::string &path)
Open output file for writing.
bool Write(const uint8_t *data, const std::size_t size)
Write data to file.
const std::string & Path() const
Get file path.
bool IsOpen() const
Check if output file is open.
bool Write(const std::string &data)
Write data to file.
std::size_t Size() const
Get file size.
void Close()
Close output file.
bool Write(const std::vector< uint8_t > &data)
Write data to file.
const std::string & Error() const
Get error.
Base class to prevent copy or move.
bool PathIsFile(const std::string &path)
Check if path is a regular file.
bool PathIsSymlink(const std::string &path)
Check if path is a symlink.
bool PathIsExecutable(const std::string &path)
Check if path is executable.
bool PathIsWritable(const std::string &path)
Check if path is writable.
std::size_t DirSize(const std::string &path)
Get directory size.
bool PathExists(const std::string &path)
Check if path exists.
std::size_t FileSize(const std::string &path)
Get file size.
void RemoveAll(const std::string &path)
Remove, recursively.
bool PathIsDirectory(const std::string &path)
Check if path is a directory.
bool FileSlurp(const std::string &path, std::vector< uint8_t > &data)
Read entire file into a string.
bool FileSpew(const std::string &path, const std::vector< uint8_t > &data)
Write string to file.
bool PathIsReadable(const std::string &path)
Check if path is readable.
Fixposition SDK: Common library.
Fixposition SDK: Common types and type helpers.