Spinnaker SDK C++
4.1.0.172
 
 

 
Loading...
Searching...
No Matches

Adapter between the std::iostreambuf and the SFNC Features representing the device file system. More...

#include <Filestream.h>

Public Member Functions

 FileProtocolAdapter ()
 Constructor.
 
virtual ~FileProtocolAdapter ()
 
bool attach (::Spinnaker::GenApi::INodeMap *pInterface)
 attach file protocol adapter to NodeMap
 
bool openFile (const char *pFileName, std::ios_base::openmode mode)
 open a file on the device
 
bool closeFile (const char *pFileName)
 close a file on the device
 
std::streamsize write (const char *buf, int64_t offs, int64_t len, const char *pFileName)
 writes data into a file.
 
std::streamsize read (char *buf, int64_t offs, std::streamsize len, const char *pFileName)
 read data from the device into a buffer
 
int64_t getBufSize (const char *pFileName, std::ios_base::openmode mode)
 fetch max FileAccessBuffer length for a file
 
bool deleteFile (const char *pFileName)
 Delete the content of the file.
 

Detailed Description

Adapter between the std::iostreambuf and the SFNC Features representing the device file system.

The adapter assumes, that the features provide stdio file access compatible semantic

Constructor & Destructor Documentation

◆ FileProtocolAdapter()

Constructor.

◆ ~FileProtocolAdapter()

virtual ~FileProtocolAdapter ( )
virtual

Member Function Documentation

◆ attach()

bool attach ( ::Spinnaker::GenApi::INodeMap pInterface)

attach file protocol adapter to NodeMap

Parameters
pInterfaceNodeMap of the device to which the FileProtocolAdapter is attached
Returns
true if attach was successful, false if not

◆ closeFile()

bool closeFile ( const char *  pFileName)

close a file on the device

Parameters
pFileNamefilename of the file to open. The filename must exist in the Enumeration FileSelector
Returns
true on success, false on error

◆ deleteFile()

bool deleteFile ( const char *  pFileName)

Delete the content of the file.

Parameters
pFileNamefilename of the file to open. The filename must exist in the Enumeration FileSelector
Returns
true on success, false on error

◆ getBufSize()

int64_t getBufSize ( const char *  pFileName,
std::ios_base::openmode  mode 
)

fetch max FileAccessBuffer length for a file

Parameters
pFileNamefilename of the file to open. The filename must exist in the Enumeration FileSelector
modemode to open the file. The mode must exist in the Enumeration FileOpenMode
Returns
max length of FileAccessBuffer in the given mode on the given file

◆ openFile()

bool openFile ( const char *  pFileName,
std::ios_base::openmode  mode 
)

open a file on the device

Parameters
pFileNamefilename of the file to open. The filename must exist in the Enumeration FileSelector
modemode to open the file. The mode must exist in the Enumeration FileOpenMode
Returns
true on success, false on error

◆ read()

std::streamsize read ( char *  buf,
int64_t  offs,
std::streamsize  len,
const char *  pFileName 
)

read data from the device into a buffer

Parameters
buftarget buffer
offsoffset in the device file to read from
lencount of bytes to read
pFileNamefilename of the file to write into The filename must exist in the Enumeration FileSelector
Returns
count of bytes successfully read

◆ write()

std::streamsize write ( const char *  buf,
int64_t  offs,
int64_t  len,
const char *  pFileName 
)

writes data into a file.

Parameters
bufsource buffer
offsoffset into the device file
lencount of bytes to write
pFileNamefilename of the file to write into The filename must exist in the Enumeration FileSelector
Returns
count of bytes written

The documentation for this class was generated from the following file: