Keyple Card Calypso C++ Library 2.1.0
Reference Terminal Reader API for C++
Public Member Functions | Friends | List of all members
keyple::card::calypso::FileDataAdapter Class Referencefinal

#include <FileDataAdapter.h>

Inheritance diagram for keyple::card::calypso::FileDataAdapter:
Inheritance graph
[legend]
Collaboration diagram for keyple::card::calypso::FileDataAdapter:
Collaboration graph
[legend]

Public Member Functions

 FileDataAdapter ()
 
 FileDataAdapter (const std::shared_ptr< FileData > source)
 
const std::map< const uint8_t, std::vector< uint8_t > > & getAllRecordsContent () const override
 
const std::vector< uint8_t > getContent () const override
 
const std::vector< uint8_t > getContent (const uint8_t numRecord) const override
 
const std::vector< uint8_t > getContent (const uint8_t numRecord, const uint8_t dataOffset, const uint8_t dataLength) const override
 
const std::shared_ptr< int > getContentAsCounterValue (const int numCounter) const override
 
const std::map< const int, const int > getAllCountersValue () const override
 
void setContent (const uint8_t numRecord, const std::vector< uint8_t > &content)
 
void setCounter (const uint8_t numCounter, const std::vector< uint8_t > &content)
 
void setContent (const uint8_t numRecord, const std::vector< uint8_t > content, const uint8_t offset)
 
void fillContent (const uint8_t numRecord, const std::vector< uint8_t > content, const uint8_t offset)
 
void addCyclicContent (const std::vector< uint8_t > &content)
 

Friends

std::ostream & operator<< (std::ostream &os, const FileDataAdapter &fda)
 

Detailed Description

(package-private)
Implementation of FileData.

Since
2.0.0

Definition at line 40 of file FileDataAdapter.h.

Constructor & Destructor Documentation

◆ FileDataAdapter() [1/2]

keyple::card::calypso::FileDataAdapter::FileDataAdapter ( )

(package-private)
Constructor

Since
2.0.0

Definition at line 31 of file FileDataAdapter.cpp.

◆ FileDataAdapter() [2/2]

keyple::card::calypso::FileDataAdapter::FileDataAdapter ( const std::shared_ptr< FileData >  source)

(package-private)
Constructor used to create a clone of the provided file file data.

Parameters
sourcethe header to be cloned.
Since
2.0.0

Definition at line 33 of file FileDataAdapter.cpp.

Member Function Documentation

◆ addCyclicContent()

void keyple::card::calypso::FileDataAdapter::addCyclicContent ( const std::vector< uint8_t > &  content)

(package-private)
Adds 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
contentthe content (should be not empty).
Since
2.0.0

Definition at line 212 of file FileDataAdapter.cpp.

◆ fillContent()

void keyple::card::calypso::FileDataAdapter::fillContent ( const uint8_t  numRecord,
const std::vector< uint8_t >  content,
const uint8_t  offset 
)

(package-private)
Fills the content at the specified offset of the specified record using a binary OR operation with the provided content.
If actual record content is not set or has a size

<

offset + content size, then missing data will be completed by the provided content.

Parameters
numRecordthe record number (should be
>=
1).
contentthe content (should be not empty).
offsetthe offset (should be
>=
0).
Since
2.0.0

Definition at line 180 of file FileDataAdapter.cpp.

◆ getAllCountersValue()

const std::map< const int, const int > keyple::card::calypso::FileDataAdapter::getAllCountersValue ( ) const
override
Since
2.0.0

Definition at line 123 of file FileDataAdapter.cpp.

◆ getAllRecordsContent()

const std::map< const uint8_t, std::vector< uint8_t > > & keyple::card::calypso::FileDataAdapter::getAllRecordsContent ( ) const
override
Since
2.0.0

Definition at line 43 of file FileDataAdapter.cpp.

◆ getContent() [1/3]

const std::vector< uint8_t > keyple::card::calypso::FileDataAdapter::getContent ( ) const
override
Since
2.0.0

Definition at line 49 of file FileDataAdapter.cpp.

◆ getContent() [2/3]

const std::vector< uint8_t > keyple::card::calypso::FileDataAdapter::getContent ( const uint8_t  numRecord) const
override
Since
2.0.0

Definition at line 54 of file FileDataAdapter.cpp.

◆ getContent() [3/3]

const std::vector< uint8_t > keyple::card::calypso::FileDataAdapter::getContent ( const uint8_t  numRecord,
const uint8_t  dataOffset,
const uint8_t  dataLength 
) const
override
Since
2.0.0

Definition at line 65 of file FileDataAdapter.cpp.

◆ getContentAsCounterValue()

const std::shared_ptr< int > keyple::card::calypso::FileDataAdapter::getContentAsCounterValue ( const int  numCounter) const
override
Since
2.0.0

Definition at line 95 of file FileDataAdapter.cpp.

◆ setContent() [1/2]

void keyple::card::calypso::FileDataAdapter::setContent ( const uint8_t  numRecord,
const std::vector< uint8_t > &  content 
)

(package-private)
Sets or replaces the entire content of the specified record #numRecord by the provided content.

Parameters
numRecordthe record number (should be
>=
1).
contentthe content (should be not empty).
Since
2.0.0

Definition at line 143 of file FileDataAdapter.cpp.

◆ setContent() [2/2]

void keyple::card::calypso::FileDataAdapter::setContent ( const uint8_t  numRecord,
const std::vector< uint8_t >  content,
const uint8_t  offset 
)

(package-private)
Sets or replaces 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
numRecordthe record number (should be
>=
1).
contentthe content (should be not empty).
offsetthe offset (should be
>=
0).
Since
2.0.0

Definition at line 153 of file FileDataAdapter.cpp.

◆ setCounter()

void keyple::card::calypso::FileDataAdapter::setCounter ( const uint8_t  numCounter,
const std::vector< uint8_t > &  content 
)

(package-private)
Sets a counter value in record #1.

Parameters
numCounterthe counter number (should be
>=
1).
contentthe counter value (should be not null and 3 bytes length).
Since
2.0.0

Definition at line 148 of file FileDataAdapter.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const FileDataAdapter fda 
)
friend

Definition at line 227 of file FileDataAdapter.cpp.


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