Skip to content

Class Spinnaker::GenApi::FileProtocolAdapter

ClassList > GenApi > FileProtocolAdapter

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

  • #include <Filestream.h>

Public Functions

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

Detailed Description

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

Public Functions Documentation

function FileProtocolAdapter

Constructor.

GenApi::FileProtocolAdapter::FileProtocolAdapter () 


function attach

attach file protocol adapter to NodeMap __

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

Parameters:

Returns:

true if attach was successful, false if not


function closeFile

close a file on the device

bool GenApi::FileProtocolAdapter::closeFile (
    const  char * pFileName
) 

Parameters:

  • pFileName filename of the file to open. The filename must exist in the Enumeration FileSelector

Returns:

true on success, false on error


function deleteFile

Delete the content of the file.

bool GenApi::FileProtocolAdapter::deleteFile (
    const  char * pFileName
) 

Parameters:

  • pFileName filename of the file to open. The filename must exist in the Enumeration FileSelector

Returns:

true on success, false on error


function getBufSize

fetch max FileAccessBuffer length for a file

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

Parameters:

  • pFileName filename of the file to open. The filename must exist in the Enumeration FileSelector
  • mode mode 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


function openFile

open a file on the device

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

Parameters:

  • pFileName filename of the file to open. The filename must exist in the Enumeration FileSelector
  • mode mode to open the file. The mode must exist in the Enumeration FileOpenMode

Returns:

true on success, false on error


function read

read data from the device into a buffer

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

Parameters:

  • buf target buffer
  • offs offset in the device file to read from
  • len count of bytes to read
  • pFileName filename of the file to write into The filename must exist in the Enumeration FileSelector

Returns:

count of bytes successfully read


function write

writes data into a file.

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

Parameters:

  • buf source buffer
  • offs offset into the device file
  • len count of bytes to write
  • pFileName filename of the file to write into The filename must exist in the Enumeration FileSelector

Returns:

count of bytes written


function ~FileProtocolAdapter

virtual GenApi::FileProtocolAdapter::~FileProtocolAdapter () 


The documentation for this class was generated from the following file C:/workspace/include/SpinGenApi/Filestream.h