Spinnaker C++
2.6.0.0
Public Member Functions | List of all members
FileProtocolAdapter Class Reference

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

Public Member Functions

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

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

Constructor.

virtual ~FileProtocolAdapter ( )
virtual

Member Function Documentation

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
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
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
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
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
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
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:
Contact Support Spinnaker® SDK Programmer's Guide and API Reference