cmJson.h/c : Added cmJsonMemberAtIndex().
This commit is contained in:
parent
a607108e48
commit
6331cb1753
8
cmJson.c
8
cmJson.c
@ -1456,6 +1456,14 @@ cmJsRC_t cmJsonMemberType( const cmJsonNode_t* np, const char* label, unsig
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmJsonNode_t* cmJsonMemberAtIndex( cmJsonNode_t* objNodePtr, unsigned idx )
|
||||||
|
{
|
||||||
|
cmJsonNode_t* cnp = cmJsonArrayElement( objNodePtr, idx );
|
||||||
|
assert( cmJsonIsPair(cnp) );
|
||||||
|
return cnp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cmJsRC_t cmJsonUIntMember( const cmJsonNode_t* np, const char* label, unsigned* retPtr )
|
cmJsRC_t cmJsonUIntMember( const cmJsonNode_t* np, const char* label, unsigned* retPtr )
|
||||||
{
|
{
|
||||||
cmJsonNode_t* vp;
|
cmJsonNode_t* vp;
|
||||||
|
5
cmJson.h
5
cmJson.h
@ -197,7 +197,10 @@ extern "C" {
|
|||||||
|
|
||||||
// Return the type of a member value.
|
// Return the type of a member value.
|
||||||
cmJsRC_t cmJsonMemberType( const cmJsonNode_t* objectNodePtr, const char* label, unsigned* typeIdRef );
|
cmJsRC_t cmJsonMemberType( const cmJsonNode_t* objectNodePtr, const char* label, unsigned* typeIdRef );
|
||||||
|
|
||||||
|
// Return the pair at the specified index. Use cmJsonChildCount() to get the count of pairs in the object.
|
||||||
|
cmJsonNode_t* cmJsonMemberAtIndex( cmJsonNode_t* objNodePtr, unsigned idx );
|
||||||
|
|
||||||
// Return values associated with the member values in the object
|
// Return values associated with the member values in the object
|
||||||
// pointed to by object objectNodePtr.
|
// pointed to by object objectNodePtr.
|
||||||
cmJsRC_t cmJsonUIntMember( const cmJsonNode_t* objectNodePtr, const char* label, unsigned* retPtr );
|
cmJsRC_t cmJsonUIntMember( const cmJsonNode_t* objectNodePtr, const char* label, unsigned* retPtr );
|
||||||
|
Loading…
Reference in New Issue
Block a user