Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
keyple::calypso::transaction::FileHeader Class Referencefinal

#include <FileHeader.h>

Classes

class  FileHeaderBuilder
 

Public Types

enum  FileType {
  FileType::LINEAR, FileType::BINARY, FileType::CYCLIC, FileType::COUNTERS,
  FileType::SIMULATED_COUNTERS
}
 

Public Member Functions

uint16_t getLid () const
 
int getRecordsNumber () const
 
int getRecordSize () const
 
FileType getType () const
 
const std::vector< uint8_t > & getAccessConditions () const
 
const std::vector< uint8_t > & getKeyIndexes () const
 
uint8_t getDfStatus () const
 
bool isShared () const
 
uint16_t getSharedReference () const
 
bool operator== (const FileHeader &o) const
 

Static Public Member Functions

static std::unique_ptr< FileHeaderBuilderbuilder ()
 

Friends

KEYPLECALYPSO_API std::ostream & operator<< (std::ostream &os, const FileType ft)
 
KEYPLECALYPSO_API std::ostream & operator<< (std::ostream &os, const FileHeader &fh)
 

Detailed Description

The class

FileHeader

contains all metadata of a Calypso EF.

Since
0.9

Member Enumeration Documentation

◆ FileType

The EF type enum

Enumerator
LINEAR 
BINARY 
CYCLIC 
COUNTERS 
SIMULATED_COUNTERS 

Member Function Documentation

◆ builder()

std::unique_ptr< FileHeaderBuilder > keyple::calypso::transaction::FileHeader::builder ( )
static

(package-private)
Gets a new builder.

Returns
a new builder instance

◆ getAccessConditions()

const std::vector< uint8_t > & keyple::calypso::transaction::FileHeader::getAccessConditions ( ) const

Gets a reference to the access conditions.

Returns
a not empty byte array reference
Since
0.9

◆ getDfStatus()

uint8_t keyple::calypso::transaction::FileHeader::getDfStatus ( ) const

Gets the DF status.

Returns
the DF status byte
Since
0.9

◆ getKeyIndexes()

const std::vector< uint8_t > & keyple::calypso::transaction::FileHeader::getKeyIndexes ( ) const

Gets a reference to the keys indexes.

Returns
a not empty byte array reference
Since
0.9

◆ getLid()

uint16_t keyple::calypso::transaction::FileHeader::getLid ( ) const

Gets the associated LID.

Returns
the LID
Since
0.9

◆ getRecordSize()

int keyple::calypso::transaction::FileHeader::getRecordSize ( ) const

Gets the size of a record :

  • For a Counter file, the record size is the original size of the record #1.
    Extra bytes (rest of the division of the file size by 3) aren't accessible.
  • For a Binary file, the size of the record is corresponding to the file size.
Returns
the size of a record
Since
0.9

◆ getRecordsNumber()

int keyple::calypso::transaction::FileHeader::getRecordsNumber ( ) const

Gets the number of records :

  • For a Counter file, the number of records is always 1.
    Extra bytes (rest of the division of the file size by 3) aren't accessible.
  • For a Binary file, the number of records is always 1.
Returns
the number of records
Since
0.9

◆ getSharedReference()

uint16_t keyple::calypso::transaction::FileHeader::getSharedReference ( ) const

Gets the shared reference of a shared file.

Returns
null if file is not shared
Since
0.9

◆ getType()

FileType keyple::calypso::transaction::FileHeader::getType ( ) const

Gets the file type.

Returns
a not null file type
Since
0.9

◆ isShared()

bool keyple::calypso::transaction::FileHeader::isShared ( ) const

Returns true if EF is a shared file.

Returns
true if the EF is a shared file
Since
0.9

◆ operator==()

bool keyple::calypso::transaction::FileHeader::operator== ( const FileHeader o) const

Comparison is based on field "lid".

Parameters
othe object to compare
Returns
the comparison evaluation
Since
0.9

Friends And Related Function Documentation

◆ operator<< [1/2]

KEYPLECALYPSO_API std::ostream& operator<< ( std::ostream &  os,
const FileHeader fh 
)
friend

◆ operator<< [2/2]

KEYPLECALYPSO_API std::ostream& operator<< ( std::ostream &  os,
const FileType  ft 
)
friend

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