18#ifndef __FPSDK_COMMON_PATH_HPP__
19#define __FPSDK_COMMON_PATH_HPP__
142 bool Write(
const std::vector<uint8_t>& data);
152 bool Write(
const uint8_t* data,
const std::size_t size);
159 const std::string&
Path()
const;
184 std::unique_ptr<std::ostream> fh_;
185 std::size_t size_ = 0;
220 std::size_t
Read(uint8_t* data,
const std::size_t size);
227 const std::string&
Path()
const;
257 bool Seek(
const std::size_t pos);
275 std::unique_ptr<std::istream> fh_;
276 std::size_t size_ = 0;
277 std::size_t pos_ = 0;
279 bool can_seek_ =
false;
300bool 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.
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.
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.
bool PathExists(const std::string &path)
Check if path exists.
std::size_t FileSize(const std::string &path)
Get file size.
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.