Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::common::path Namespace Reference

File and path utilities. More...

Classes

class  OutputFile
 Output file handle. More...
 

Functions

bool PathExists (const std::string &path)
 Check if path exists.
 
std::size_t FileSize (const std::string &path)
 Get file size.
 
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.
 

Detailed Description

File and path utilities.

Function Documentation

◆ PathExists()

bool fpsdk::common::path::PathExists ( const std::string & path)

Check if path exists.

Parameters
[in]pathPath (file or directory) to check
Returns
true if path exists, false otherwise

◆ FileSize()

std::size_t fpsdk::common::path::FileSize ( const std::string & path)

Get file size.

Parameters
[in]pathPath to file
Returns
the size of the file in bytes, 0 is only valid if file is readable

◆ FileSlurp()

bool fpsdk::common::path::FileSlurp ( const std::string & path,
std::vector< uint8_t > & data )

Read entire file into a string.

Parameters
[in]pathFile path
[out]dataThe data
Returns
true if data was successfully read from file, false otherwise

◆ FileSpew()

bool fpsdk::common::path::FileSpew ( const std::string & path,
const std::vector< uint8_t > & data )

Write string to file.

Parameters
[in]pathFile path
[out]dataThe data
Returns
true if data was successfully written to file, false otherwise