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

Input file handle. More...

#include <path.hpp>

Public Member Functions

bool Open (const std::string &path)
 Open input file for reading.
void Close ()
 Close input file.
std::size_t Read (uint8_t *data, const std::size_t size)
 Read data from 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.
std::size_t Tell () const
 Get file position.
bool Seek (const std::size_t pos)
 Seek to position.
bool CanSeek () const
 Check if handle can seek.
const std::string & Error () const
 Get error.

Detailed Description

Input file handle.

Definition at line 192 of file path.hpp.

Member Function Documentation

◆ Open()

bool fpsdk::common::path::InputFile::Open ( const std::string & path)

Open input file for reading.

Parameters
[in]pathThe path / filename, can end in ".gz" for compressed output
Returns
true on success, failure otherwise

◆ Read()

std::size_t fpsdk::common::path::InputFile::Read ( uint8_t * data,
const std::size_t size )

Read data from file.

Parameters
[out]dataBuffer to read into
[in]sizeSize of buffer (> 0)
Returns
the size read, 0 if at end of file

◆ Path()

const std::string & fpsdk::common::path::InputFile::Path ( ) const

Get file path.

Returns
the file path if the file has been opened before, the empty string otherwise

◆ IsOpen()

bool fpsdk::common::path::InputFile::IsOpen ( ) const

Check if output file is open.

Returns
true if the file is open, false otherwise

◆ Size()

std::size_t fpsdk::common::path::InputFile::Size ( ) const

Get file size.

Returns
the file size

◆ Tell()

std::size_t fpsdk::common::path::InputFile::Tell ( ) const

Get file position.

Returns
the current file position

◆ Seek()

bool fpsdk::common::path::InputFile::Seek ( const std::size_t pos)

Seek to position.

Parameters
[in]posPosition to seek to
Returns
true on success, false otherwise (our of range, cannot seek)

◆ CanSeek()

bool fpsdk::common::path::InputFile::CanSeek ( ) const

Check if handle can seek.

Returns
true if Seek() is possible, false if not (e.g. compressed file)

◆ Error()

const std::string & fpsdk::common::path::InputFile::Error ( ) const

Get error.

Returns
an error string in case of error (e.g. after Open() failed), the empty string if there's no error

The documentation for this class was generated from the following file:
  • fpsdk_common/include/fpsdk_common/path.hpp