![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cVarMap.h>
Public Types | |
enum | M_TYPE_ { M_QTY } |
![]() | |
typedef INT32 | CYS_t |
type for 2 fixed point int for currency/money. More... | |
typedef INT64 | CY_t |
type for 4 fixed point int for currency/money. More... | |
Static Public Member Functions | |
static cAtomRef GRAYCALL | MakeKeyNameRef (const ATOMCHAR_t *&pszKey, bool bMustExist, bool bAllowDots) |
![]() | |
static StrLen_t GRAYCALL | CopyLenQ (ATOMCHAR_t *pszDst, const ATOMCHAR_t *pszSrc, StrLen_t iLenMax, STR_BLOCK_TYPE eBlock) |
When converting to string. More... | |
Public Attributes | |
cArraySortHash< cVarTuple, ATOMCODE_t > | m_aTuples |
Hash sorted by ATOMCODE_t. NOT alphabetic sort. More... | |
Static Public Attributes | |
static const ATOMCHAR_t * | k_pszKeyDefault = "_" |
Default name for keys with not valid names. "_" (or no name) More... | |
static cScriptableInterfaceDef | sm_ScriptInterfaceDef |
static cScriptableMethod | sm_Methods [M_QTY+1] |
![]() | |
static const ITERATE_t | k_MaxElements = 64*1024 |
(arbitrary) Max elements that may be parsed in array or map. More... | |
static const ITERATE_t | k_MaxElements2 = 256 |
arbitrary max for simple things. More... | |
static const CYS_t | k_CYSMul = 100 |
2 fixed places = cents. CYS_t More... | |
static const CY_t | k_CYMul = 10000 |
4 fixed places = hundredths of a cent. CY_t More... | |
Collection of named values. 'property bag' or Map. (Name=Value) Similar to PHP array, MFC CMap, cIniMap, JSON object ? Sorted by cAtomRef hash number, NOT by alpha.
|
inline |
|
inline |
StrLen_t GrayLib::cVarMap::AddHtmlArgsLen | ( | const ATOMCHAR_t * | pszArgs | ) |
HRESULT GrayLib::cVarMap::DumpTagsHead | ( | cStreamOutput * | pOut, |
const ATOMCHAR_t * | pszName | ||
) | const |
Use this with pOut = cStreamStringA or cStreamQueue
cVarTuplePtr GrayLib::cVarMap::FindKeyPtr | ( | const ATOMCHAR_t * | pszKey | ) | const |
parse the name and return the pVar if found. shortcut - if atom doesn't exit then the key doesn't exist.
cVarTuplePtr GrayLib::cVarMap::FindKeyPtrA | ( | cAtomRef | aKey | ) | const |
ASSUME aKey is already processed by MakeKeyNameRef()
cVarTuplePtr GrayLib::cVarMap::FindKeyPtrX | ( | const ATOMCHAR_t * | pszKeyX | ) | const |
ITERATE_t GrayLib::cVarMap::FindValAsInt | ( | int | iVal, |
const ATOMCHAR_t * | pszPrefix = nullptr |
||
) | const |
Find a tag that has this numeric value (not key) in the array just used for testing purposes.
ITERATE_t GrayLib::cVarMap::FindValAsStr | ( | const ATOMCHAR_t * | pszVal | ) | const |
Find a tag that has this string value (not key) in the array
void GrayLib::cVarMap::FixWeird | ( | ) |
Check all the tags for XObj,UID validity. Off-line UID's don't resolve but thats OK!??
|
inline |
|
inlinevirtual |
size_t GrayLib::cVarMap::GetHeapStats | ( | OUT ITERATE_t & | iAllocCount | ) | const |
Get heap stats assuming we own all that we reference (which is not normal)
|
inline |
StrLen_t GrayLib::cVarMap::GetStr | ( | ATOMCHAR_t * | pszArgs, |
StrLen_t | nLenMax, | ||
const ATOMCHAR_t * | pszLineBreak = nullptr |
||
) | const |
Get the whole map as a string. Use JSON format. Use the JSON Writer if you want this to be pretty. Bool = 0,1 not true/false
UINT32 GrayLib::cVarMap::GetValAsDWord | ( | const ATOMCHAR_t * | pszKey, |
UINT32 | uValDefault = 0 |
||
) | const |
float GrayLib::cVarMap::GetValAsFloat | ( | const ATOMCHAR_t * | pszKey, |
float | fValDefault = 0.0f |
||
) | const |
int GrayLib::cVarMap::GetValAsInt | ( | const ATOMCHAR_t * | pszKey, |
int | iValDefault = 0 |
||
) | const |
cStringA GrayLib::cVarMap::GetValAsStr | ( | const ATOMCHAR_t * | pszKey | ) | const |
|
inline |
HRESULT GrayLib::cVarMap::LoadTuple | ( | IScriptableEnumerator & | section | ) |
|
static |
Parse a name for valid length, chars. IF the name is not valid we should just FAIL.
cVarTuplePtr GrayLib::cVarMap::MakeKeyPtr | ( | const ATOMCHAR_t * | pszKey | ) |
Find or make a key tuple.
cVarTuplePtr GrayLib::cVarMap::MakeKeyPtrA | ( | cAtomRef | aKey | ) |
Find or make a key tuple. ASSUME aKey is already processed by MakeKeyNameRef() and is valid.
cVarTuplePtr GrayLib::cVarMap::MakeKeyPtrX | ( | const ATOMCHAR_t * | pszKeyX | ) |
|
inline |
|
inline |
cVariant & GrayLib::cVarMap::RefValVar | ( | const ATOMCHAR_t * | pszKey | ) |
@pszTag = fail if the name is not valid ???
bool GrayLib::cVarMap::RemoveKey | ( | const ATOMCHAR_t * | pszKey | ) |
bool GrayLib::cVarMap::RemoveKeyA | ( | cAtomRef | aKey | ) |
ASSUME aKey is already processed by MakeKeyNameRef() and is valid.
HRESULT GrayLib::cVarMap::s_GetByName | ( | const ATOMCHAR_t * | pszPropName, |
OUT cVariant & | vValRet | ||
) |
HRESULT GrayLib::cVarMap::s_GetEnum | ( | ITERATE_t | i, |
OUT cStringA & | rsPropName, | ||
OUT cVariant & | rvValRet | ||
) |
HRESULT GrayLib::cVarMap::s_Put | ( | const ATOMCHAR_t * | pszPropName, |
const cVariant & | vValSet | ||
) |
void GrayLib::cVarMap::s_WriteTags | ( | IScriptableSetter & | s, |
const ATOMCHAR_t * | pszKeyPrefix = nullptr |
||
) | const |
List out (call s_Put) all the keys to a IScriptableSetter/cScriptFileWriter file. They will be in some sort of HASHCODE_t sorted order.
HRESULT GrayLib::cVarMap::SerializeInput | ( | cStreamInput & | file | ) |
HRESULT GrayLib::cVarMap::SerializeOutput | ( | cStreamOutput & | file | ) | const |
HRESULT GrayLib::cVarMap::SetFromArrays | ( | int | iQty, |
const char ** | ppszNames, | ||
const char ** | ppszVals | ||
) |
HRESULT GrayLib::cVarMap::SetStr | ( | const ATOMCHAR_t * | pszArgs | ) |
Parse and Set the map via a string in JSON format.
set/replace/create key.
HRESULT GrayLib::cVarMap::SetValStr | ( | const ATOMCHAR_t * | pszKey, |
const ATOMCHAR_t * | pszVal | ||
) |
Set a single key with a string. "" = delete key. ASSUME: pszKey has been clipped of unwanted beginning and trailing spaces.
HRESULT GrayLib::cVarMap::SetValVar | ( | const ATOMCHAR_t * | pszKey, |
const cVariant & | vVal | ||
) |
Set a key with a variant. empty variant = delete
HRESULT GrayLib::cVarMap::SetValVarN | ( | const ATOMCHAR_t * | pszKey, |
const cVariant & | vVal | ||
) |
Set a key with a variant. Allow a null variant.
GrayLib::cVarMap::UNITTEST2_PREDEF | ( | cVarMap | ) |
|
static |
Default name for keys with not valid names. "_" (or no name)
cArraySortHash<cVarTuple, ATOMCODE_t> GrayLib::cVarMap::m_aTuples |
Hash sorted by ATOMCODE_t. NOT alphabetic sort.
|
static |
|
static |