#include
<sxpunchfile.h>
Collaboration diagram for sx360::sxPunchFile:
Public Member Functions |
|
sxPunchFile (ByteMap bmap) | |
~sxPunchFile () | |
bool | open (string name, FileSetup setup) |
bool | close () |
int | getCardCount () |
sxIterator * | getIterator () const |
const FileSetup & | getSetup () const |
bool | appendRecord (sxRecord *cards) |
int | seek (off_t offset, int whence) |
unsigned int | getRecordCount () |
off_t | tell () |
bool | read (void *ptr, size_t size) |
bool | write (void *ptr, size_t size) |
sxPunchFile::sxPunchFile | ( | ByteMap | bmap | ) |
Constructor for an sxPunchFile. The parameter is a ByteMap, which if a standard IBM 360 column binary is being used, can be constructed using the default parameters.
sxPunchFile::~sxPunchFile | ( | |
) |
Destructor for sxPunchFile.
bool sxPunchFile::open | ( | string | name, | |
FileSetup | setup | |||
) |
Opens a sxPunchFile. Returns true is file is open or false if
the file cannot be opened.
Parameters:
string name = file name to open.
FileSetup setup = defines how a file should be opened.
bool sxPunchFile::close | ( | |
) |
Closes the open sxPunchFile.
int sx360::sxPunchFile::getCardCount | ( | |
) | [inline] |
Returns the number of cards per record in the file.
sxIterator* sx360::sxPunchFile::getIterator | ( | |
) | const [inline] |
Returns the sxIterator that is used to traverse the file if the file was opened in READ_ONLY or READ_WRITE. Otherwise, NULL is returned.
const FileSetup& sx360::sxPunchFile::getSetup | ( | |
) | const [inline] |
Returns the FileSetup structure used to create the sxPunchFile.
bool sxPunchFile::appendRecord | ( | sxRecord * | cards | ) |
When a file is opened in CREATE mode, this method will write a new record to the end of the file. If the file is not opened in CREATE mode, the return value will be false.
int sxPunchFile::seek | ( | off_t | offset, | |
int | whence | |||
) |
Wrapper function for fseeko. No need to a client to call this function.
unsigned int sx360::sxPunchFile::getRecordCount | ( | |
) | [inline] |
Returns the number of records in the file.
off_t sx360::sxPunchFile::tell | ( | |
) | [inline] |
Returns an off_t to the current offset in the physical file.
off_t is #defined as __int64 on Windows.
bool sx360::sxPunchFile::read | ( | void * | ptr, | |
size_t | size | |||
) | [inline] |
Wrapper function for fread. No need for a client to call this
function.
bool sx360::sxPunchFile::write | ( | void * | ptr, | |
size_t | size | |||
) | [inline] |
Wrapper function for fwrite. No need for a client to call this
function.