jvar
JS inspired Variant and Json
jvar::KeywordArray Class Reference

Detailed Description

KeywordArray maintains a string keyword to integer relationship

#include <arr.h>

Classes

struct  Entry

Public Member Functions

 KeywordArray (const Entry *arr, size_t arrsize)
uint toValue (const char *keyword)
const char * toKeyword (uint value)

Constructor & Destructor Documentation

jvar::KeywordArray::KeywordArray ( const Entry arr,
size_t  arrsize 
) [inline]

constructor

Parameters:
arrPointer to an array which will be cloned
arrsizeNumer of elements in the array

Member Function Documentation

const char* jvar::KeywordArray::toKeyword ( uint  value) [inline]

Returns a keyword associated with the value

Parameters:
valueValue to lookup
Returns:
A pointer to the keyword

Referenced by jvar::Variant::typeName().

uint jvar::KeywordArray::toValue ( const char *  keyword) [inline]

Converts a keyword into a int value

Parameters:
keywordKeword to lookup
Returns:
Value or -1 if not found

The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerator