Keypop Calypso Card C++ API - 2.2.0
Component of the Keypop C++ API
keypop::calypso::card::card::FileData Class Referenceabstract

Calypso EF content. More...

#include <keypop/calypso/card/card/FileData.hpp>

Public Member Functions

virtual std::vector< std::uint8_t > getContent () const =0
 Gets a reference to the known content of record #1. More...
 
virtual std::vector< std::uint8_t > getContent (std::uint8_t numRecord) const =0
 Gets a reference to the known content of a specific record. More...
 
virtual std::vector< std::uint8_t > getContent (std::uint8_t numRecord, std::uint8_t dataOffset, std::uint8_t dataLength) const =0
 Gets a copy of a known content subset of a specific record from dataOffset to dataLength. More...
 
virtual const std::map< const std::uint8_t, std::vector< std::uint8_t > > & getAllRecordsContent () const =0
 Gets a reference to all known records content. More...
 
virtual std::shared_ptr< int > getContentAsCounterValue (int numCounter) const =0
 Gets the known value of the counter #numCounter. More...
 
virtual std::map< const int, const int > getAllCountersValue () const =0
 Gets all known counters value. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const FileData &fd)
 Renders the records this file holds, so that a log shows the content and not the address of the object. More...
 
std::ostream & operator<< (std::ostream &os, const std::shared_ptr< FileData > &fd)
 

Detailed Description

Calypso EF content.

Since
1.0.0

Definition at line 31 of file FileData.hpp.

Member Function Documentation

◆ getAllCountersValue()

virtual std::map< const int, const int > keypop::calypso::card::card::FileData::getAllCountersValue ( ) const
pure virtual

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
an empty map if record #1 is not set.
Since
1.0.0

◆ getAllRecordsContent()

virtual const std::map< const std::uint8_t, std::vector< std::uint8_t > > & keypop::calypso::card::card::FileData::getAllRecordsContent ( ) const
pure virtual

Gets a reference to all known records content.

Returns
a not null map possibly empty if there's no content.
Since
1.0.0

◆ getContent() [1/3]

virtual std::vector< std::uint8_t > keypop::calypso::card::card::FileData::getContent ( ) const
pure virtual

Gets a reference to the known content of record #1.


For a Binary file, it means all the bytes of the file.

Returns
an empty array if the record #1 is not set.
Since
1.0.0

◆ getContent() [2/3]

virtual std::vector< std::uint8_t > keypop::calypso::card::card::FileData::getContent ( std::uint8_t  numRecord) const
pure virtual

Gets a reference to the known content of a specific record.

Parameters
numRecordThe record number.
Returns
an empty array if the requested record is not set.
Since
1.0.0

◆ getContent() [3/3]

virtual std::vector< std::uint8_t > keypop::calypso::card::card::FileData::getContent ( std::uint8_t  numRecord,
std::uint8_t  dataOffset,
std::uint8_t  dataLength 
) const
pure virtual

Gets a copy of a known content subset of a specific record from dataOffset to dataLength.

Parameters
numRecordThe record number.
dataOffsetThe offset index (should be
>=
0).
dataLengthThe data length (should be
>=
1).
Returns
a not empty copy of the record subset content when the record is set, an empty array when the record is not set.
Exceptions
IllegalArgumentExceptionif dataOffset
<
0 or dataLength
<
1.
IndexOutOfBoundsExceptionif dataOffset
>=
content length or (dataOffset + dataLength)
>
content length.
Since
1.0.0

◆ getContentAsCounterValue()

virtual std::shared_ptr< int > keypop::calypso::card::card::FileData::getContentAsCounterValue ( int  numCounter) const
pure virtual

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
numCounterThe counter number (should be
>=
1).
Returns
The counter value or null if record #1 or numCounter is not set.
Exceptions
IllegalArgumentExceptionif numCounter is
<
1.
IndexOutOfBoundsExceptionif numCounter has a truncated value (when size of record #1 modulo 3 != 0).
Since
1.0.0

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const FileData &  fd 
)
friend

Renders the records this file holds, so that a log shows the content and not the address of the object.

Definition at line 114 of file FileData.hpp.

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const std::shared_ptr< FileData > &  fd 
)
friend

Definition at line 142 of file FileData.hpp.


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