KlvLib  1.58
Public Member Functions | Related Functions | List of all members
IKlvDecoder Class Referenceabstract

IKlvDecoder class. More...

Public Member Functions

virtual ~IKlvDecoder (void)
 Virtual destructor.
 
virtual BOOL Parse (IKlvItem::KEY_LENGTH outerKeySize, IKlvItem::KEY_LENGTH innerKeySize, char *buf, const size_t size, BOOL fValidateCheckSum=FALSE)=0
 Decode KLV data. More...
 
virtual IKlvItem ** GetItemList (int &count)=0
 Return parsed items list. More...
 
virtual BOOL ValidateCheckSum (const char *buf, const size_t size)=0
 Validates checksum. More...
 
virtual void Purge ()=0
 Purge an internal parsed items list. More...
 

Related Functions

(Note that these are not member functions.)

KLVLIB_API IKlvDecoderCreateKlvDecoder ()
 Creates KlvDecoder instance. More...
 

Detailed Description

KLV Decoder class allows KLV Items extraction from the binary data buffer. You should use CreateKlvDecoder() helper function in order to create decoder instance. Once it is created, a Parse( IKlvItem::KEY_LENGTH outerKeySize, IKlvItem::KEY_LENGTH innerKeySize, char* buf, const size_t size, BOOL fValidateCheckSum = TRUE ) method may be used in order to process the data and extact Klv Items. When Parse( IKlvItem::KEY_LENGTH outerKeySize, IKlvItem::KEY_LENGTH innerKeySize, char* buf, const size_t size, BOOL fValidateCheckSum = TRUE ) method returns ( with TRUE return value ), IKlvItem** GetItemList(int& count) method may be used in order to get the list of exacted Klv Items. See Using KlvLib sample or Using KlvLib (16 bytes Keys) sample for more details on how to use the Decoder.

Examples:
klvtestapp.cpp, klvtestappfile.cpp, and klvtestappuds.cpp.

Member Function Documentation

virtual IKlvItem** IKlvDecoder::GetItemList ( int &  count)
pure virtual

Returns parsed items list. Returns a pointer to the KlvItem list container created from a parsed data buffer.

Parameters
countan int&. Number of KLVs in the list.
Returns
IKlvItem**. Returns a pointer to the KlvItem list container.
Examples:
klvtestapp.cpp, and klvtestappuds.cpp.
virtual BOOL IKlvDecoder::Parse ( IKlvItem::KEY_LENGTH  outerKeySize,
IKlvItem::KEY_LENGTH  innerKeySize,
char *  buf,
const size_t  size,
BOOL  fValidateCheckSum = FALSE 
)
pure virtual

Parses the data and returns decoded data buffer and its length.

Parameters
outerKeySizean unsigned char. Outer Key size. Ussually 16 bytes. Must be known in order to parse data.
innerKeySizean unsigned char. Inner Key size. Ussually 1 - 16 bytes. Must be known in order to parse data.
bufa char*. A byte array containing the KLV data
sizea const size_t. Buffer size
fValidateCheckSuma BOOL. If TRUE, the checksum will be validated during the parsing.
Returns
bool.
Examples:
klvtestapp.cpp, and klvtestappuds.cpp.
virtual void IKlvDecoder::Purge ( )
pure virtual

Purges an internal parsed items list.

Returns
void
virtual BOOL IKlvDecoder::ValidateCheckSum ( const char *  buf,
const size_t  size 
)
pure virtual

Validates checksum. The checksum is a running 16-byte sum through the entire buffer starting with the 16 byte Local Data

Parameters
bufa const char*. The pointer to the buffer that contains the data.
sizea const size_t. Buffer size.
Returns
BOOL validation result.

Friends And Related Function Documentation

KLVLIB_API IKlvDecoder * CreateKlvDecoder ( )
related

Helper function. Instantiates KlvDecoder class

Returns
IKlvDecoder* Pointer to the KlvDecoder instance.
Untitled 1




 Copyright 2010,    IMPLEOTV SYSTEMS LTD