#include <FileData.h>
The class
contains all known data content of a Calypso EF.
- Since
- 0.9
◆ FileData() [1/2]
keyple::calypso::transaction::FileData::FileData |
( |
| ) |
|
(package-private)
Constructor
◆ FileData() [2/2]
keyple::calypso::transaction::FileData::FileData |
( |
const FileData & |
o | ) |
|
Copy constructor
C++ vs. Java: Copy constructor is prefereable to .clone() method
◆ addCyclicContent()
void keyple::calypso::transaction::FileData::addCyclicContent |
( |
const std::vector< uint8_t > & |
content | ) |
|
(package-private)
Add cyclic content at record #1 by rolling previously all actual records contents (record #1 -> record #2, record #2 -> record #3,...).
This is useful for cyclic files.
Note that records are infinitely shifted.
- Parameters
-
content | the content (should be not empty) |
◆ fillContent()
void keyple::calypso::transaction::FileData::fillContent |
( |
const int |
numRecord, |
|
|
std::vector< uint8_t > & |
content |
|
) |
| |
(package-private)
Fill the content of the specified numRecord using a binary OR operation with the provided content.
If actual record content is not set or has a size
content size, then missing data will be completed by the provided content.
- Parameters
-
numRecord | the record number (should be 1) |
content | the content (should be not empty) |
◆ getAllCountersValue()
const std::map< int, int > keyple::calypso::transaction::FileData::getAllCountersValue |
( |
| ) |
const |
Gets all known counters value.
The counters values are extracted from record #1.
If last counter has a truncated value (when size of record #1 modulo 3 != 0), then last counter value is not returned.
- Returns
- a not empty object.
- Exceptions
-
NoSuchElementException | if record #1 is not set. |
- Since
- 0.9
◆ getAllRecordsContent()
const std::map< int, std::vector< uint8_t > > & keyple::calypso::transaction::FileData::getAllRecordsContent |
( |
| ) |
const |
Gets a reference to all known records content.
- Returns
- a not null map eventually empty if there's no content.
- Since
- 0.9
◆ getContent() [1/3]
const std::vector< uint8_t > & keyple::calypso::transaction::FileData::getContent |
( |
| ) |
const |
Gets a reference to the known content of record #1.
For a Binary file, it means all the bytes of the file.
- Returns
- a not empty reference to the record content.
- Exceptions
-
NoSuchElementException | if record #1 is not set. |
- Since
- 0.9
◆ getContent() [2/3]
const std::vector< uint8_t > & keyple::calypso::transaction::FileData::getContent |
( |
const int |
numRecord | ) |
const |
Gets a reference to the known content of a specific record.
- Parameters
-
numRecord | the record number |
- Returns
- a not empty reference to the record content.
- Exceptions
-
NoSuchElementException | if record numRecord is not set. |
- Since
- 0.9
◆ getContent() [3/3]
const std::vector< uint8_t > keyple::calypso::transaction::FileData::getContent |
( |
const int |
numRecord, |
|
|
const int |
dataOffset, |
|
|
const int |
dataLength |
|
) |
| const |
Gets a copy of a known content subset of a specific record from dataOffset to dataLength.
- Parameters
-
numRecord | the record number |
dataOffset | the offset index (should be 0) |
dataLength | the data length (should be 1) |
- Returns
- a copy not empty of the record subset content.
- Exceptions
-
IllegalArgumentException | if dataOffset 0 or dataLength 1. |
NoSuchElementException | if record numRecord is not set. |
IndexOutOfBoundsException | if dataOffset content length or (dataOffset + dataLength) content length. |
- Since
- 0.9
◆ getContentAsCounterValue()
int keyple::calypso::transaction::FileData::getContentAsCounterValue |
( |
const int |
numCounter | ) |
const |
Gets the known value of the counter numCounter.
The counter value is extracted from the 3 next bytes at the index [(numCounter - 1) * 3] of the record #1.
e.g. if numCounter == 2, then value is extracted from bytes indexes [3,4,5].
- Parameters
-
numCounter | the counter number (should be 1) |
- Returns
- the counter value.
- Exceptions
-
IllegalArgumentException | if numCounter is 1. |
NoSuchElementException | if record #1 or numCounter is not set. |
IndexOutOfBoundsException | if numCounter has a truncated value (when size of record #1 modulo 3 != 0). |
- Since
- 0.9
◆ operator!=()
bool keyple::calypso::transaction::FileData::operator!= |
( |
const FileData & |
o | ) |
const |
◆ operator==()
bool keyple::calypso::transaction::FileData::operator== |
( |
const FileData & |
o | ) |
const |
◆ setContent() [1/2]
void keyple::calypso::transaction::FileData::setContent |
( |
const int |
numRecord, |
|
|
const std::vector< uint8_t > & |
content |
|
) |
| |
(package-private)
Set or replace the entire content of the specified record numRecord by the provided content.
- Parameters
-
numRecord | the record number (should be 1) |
content | the content (should be not empty) |
◆ setContent() [2/2]
void keyple::calypso::transaction::FileData::setContent |
( |
const int |
numRecord, |
|
|
const std::vector< uint8_t > & |
content, |
|
|
const int |
offset |
|
) |
| |
(package-private)
Set or replace the content at the specified offset of record numRecord by a copy of the provided content.
If actual record content is not set or has a size
offset, then missing data will be padded with 0.
- Parameters
-
numRecord | the record number (should be 1) |
content | the content (should be not empty) |
offset | the offset (should be 0) |
◆ setCounter()
void keyple::calypso::transaction::FileData::setCounter |
( |
const int |
numCounter, |
|
|
const std::vector< uint8_t > & |
content |
|
) |
| |
(package-private)
Sets a counter value in record #1.
- Parameters
-
numCounter | the counter number (should be 1) |
content | the counter value (should be not null and 3 bytes length) |
◆ operator<<
The documentation for this class was generated from the following files:
- component/keyple-calypso/src/main/transaction/FileData.h
- component/keyple-calypso/src/main/transaction/FileData.cpp