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

IKlvItem interface. More...

Public Types

enum  KEY_LENGTH {
  UNDEFINED = 0, ONE_BYTE = 1, TWO_BYTES = 2, FOUR_BYTES = 4,
  SIXTEEN_BYTES = 16
}
 KEY_LENGTH KLV Key length. More...
 

Public Member Functions

virtual char * Init (const char *key, const char *value, const size_t size, size_t &length)=0
 Initialize KlvItem using ASCII key and a value. More...
 
virtual char * Init (const char *key, KEY_LENGTH keySize, const char *value, const size_t size, size_t &length)=0
 Initialize KlvItem using Binary key and a value. More...
 
virtual void Parse (KEY_LENGTH keyLength, const char *buf, size_t &size)=0
 
virtual const char * GetKeyString ()=0
 Get Key as ASCII string. More...
 
virtual const char * GetKey (KEY_LENGTH &len)=0
 Get Key as a binary array. More...
 
virtual const size_t GetLength ()=0
 Get a Value Length. More...
 
virtual const char * GetValue ()=0
 Get a Value. More...
 
virtual const size_t GetSize ()=0
 Get a size of entire KLV. More...
 
virtual const char * GetBuffer (size_t &length)=0
 Get an encoded KLV buffer. More...
 
virtual ~IKlvItem ()
 Virtual destructor.
 

Related Functions

(Note that these are not member functions.)

KLVLIB_API IKlvItemCreateKlvItem ()
 Creates KlvItem instance. More...
 
KLVLIB_API IKlvItemCreateNonInitializedKlvItem ()
 Creates not initialized KlvItem instance. More...
 

Detailed Description

IKlvItem interface defines a KLV item and allows numerous operations on it.

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

Member Enumeration Documentation

KEY_LENGTH enumeration defines a Key length of the KLV.

Enumerator
UNDEFINED 

Undefined state.

ONE_BYTE 

1 byte key length

TWO_BYTES 

2 byte key length

FOUR_BYTES 

4 byte key length

SIXTEEN_BYTES 

16 byte key length

Member Function Documentation

virtual const char* IKlvItem::GetBuffer ( size_t &  length)
pure virtual

Returns a KLV buffer.

Parameters
lengtha size_t&. A size of the returned buffer.
Returns
const char*. Returns a Value.
virtual const char* IKlvItem::GetKey ( KEY_LENGTH len)
pure virtual

Returns an item Key.

Parameters
lena KEY_LENGTH& a Key's letngth.
Returns
const char*. Returns a Key.
virtual const char* IKlvItem::GetKeyString ( )
pure virtual

Returns an item Key as ASCII string.

Returns
const char*. Returns a Key.
Examples:
klvtestapp.cpp, klvtestappfile.cpp, and klvtestappuds.cpp.
virtual const size_t IKlvItem::GetLength ( )
pure virtual

Returns an item's value Length.

Returns
const int. Returns a length of Value.
Examples:
klvtestapp.cpp, klvtestappfile.cpp, and klvtestappuds.cpp.
virtual const size_t IKlvItem::GetSize ( )
pure virtual

Returns a KLV size.

Returns
const size_t. Returns a size of entire KLV.
virtual const char* IKlvItem::GetValue ( )
pure virtual

Returns an item Value.

Returns
const char*. Returns a Value.
virtual char* IKlvItem::Init ( const char *  key,
const char *  value,
const size_t  size,
size_t &  length 
)
pure virtual

Initializes a KlvItem with key (ASCII) and value, returns encoded data buffer and its length.

Parameters
keya const char*. The Key String. 2 characters per byte, see Note below.
valuea const char*. A binary Value.
sizea size_t. Value's size.
lengtha size_t&. A size of the returned buffer.
Returns
char*. KLV buffer.
Note
Note, 2 characters per byte MUST be used! For example - "060E2B34020101010E01010201010000"
virtual char* IKlvItem::Init ( const char *  key,
KEY_LENGTH  keySize,
const char *  value,
const size_t  size,
size_t &  length 
)
pure virtual

Initializes KlvItem with key (Binary) and value, returns encoded data buffer and its length.

Parameters
keya const char*. A binary Key.
keySizea KEY_LENGTH. Key's size.
valuea const char*. A binary Value.
sizea size_t. Value's size.
lengtha size_t&. A size of the returned buffer.
Returns
char*. KLV buffer.

Friends And Related Function Documentation

KLVLIB_API IKlvItem * CreateKlvItem ( )
related

CreateKlvItem helper function. Instantiates the KlvItem class

Returns
IKlvItem* Pointer to the KlvItem instance.
KLVLIB_API IKlvItem * CreateNonInitializedKlvItem ( )
related

CreateKlvItem helper function. Creates the KlvItem and copies key, value and length. Does not perform BER encoding and other initialization procedures

Returns
IKlvItem* Pointer to the KlvItem instance.
Untitled 1




 Copyright 2010,    IMPLEOTV SYSTEMS LTD