PreEmptive Analytics Linux Client
 All Classes Files Functions Variables Typedefs Macros
Public Member Functions | List of all members
KVList Class Reference

A platform indepenent representation of a list of key, value pairs that are wide strings. More...

Public Member Functions

DLL_PACLIENT KVList ()
 Create an empty KVList. More...
 
DLL_PACLIENT ~KVList ()
 Dispose of a KVList instance. More...
 
DLL_PACLIENT void Add (const wchar_t *key, const wchar_t *value)
 Add a key value pair. More...
 
DLL_PACLIENT void Clear ()
 Clear the key value pair list. More...
 
DLL_PACLIENT const wchar_t * Get (const wchar_t *key)
 Get a value based on its key. More...
 
DLL_PACLIENT const wchar_t * GetKey (size_t idx)
 Get the key for key value pair at an index in the list. More...
 
DLL_PACLIENT size_t GetSize ()
 Get the size of the key value pair list. More...
 
DLL_PACLIENT const wchar_t * GetValue (size_t idx)
 Get the value for key value pair at an index in the list. More...
 
DLL_PACLIENT KVListoperator= (const KVList *other)
 Copy the values of another KVList instance. More...
 
DLL_PACLIENT KVListoperator= (const KVList &other)
 Copy the values of another KVList instance. More...
 
DLL_PACLIENT void Remove (const wchar_t *key)
 Remove a key value pair based on key. More...
 

Detailed Description

A platform indepenent representation of a list of key, value pairs that are wide strings.

An instance can be used to set Configuration::CustomHeaders to send a list of custom headers where keys are the headers and values are the header values

Constructor & Destructor Documentation

DLL_PACLIENT KVList::KVList ( )

Create an empty KVList.

After a KVList has been created you can add key value pairs using KVList::Add()
DLL_PACLIENT KVList::~KVList ( )

Dispose of a KVList instance.

Member Function Documentation

DLL_PACLIENT void KVList::Add ( const wchar_t *  key,
const wchar_t *  value 
)

Add a key value pair.

If a key with the same name already exists its value is replaced.
Parameters
keyString to use as a key
valueString value represented by the key
DLL_PACLIENT void KVList::Clear ( )

Clear the key value pair list.

DLL_PACLIENT const wchar_t* KVList::Get ( const wchar_t *  key)

Get a value based on its key.

Parameters
keyKey of the key value pair's value to retrieve
DLL_PACLIENT const wchar_t* KVList::GetKey ( size_t  idx)

Get the key for key value pair at an index in the list.

Parameters
idxIndex of the key value pair to retrieve the key for
DLL_PACLIENT size_t KVList::GetSize ( )

Get the size of the key value pair list.

DLL_PACLIENT const wchar_t* KVList::GetValue ( size_t  idx)

Get the value for key value pair at an index in the list.

Parameters
idxIndex of the key value pair to retrieve the value for
DLL_PACLIENT KVList& KVList::operator= ( const KVList other)

Copy the values of another KVList instance.

Returns
this instance
DLL_PACLIENT KVList& KVList::operator= ( const KVList other)

Copy the values of another KVList instance.

Returns
this instance
DLL_PACLIENT void KVList::Remove ( const wchar_t *  key)

Remove a key value pair based on key.

Parameters
keyKey Value Pair's key to remove