src/lq-collections.c
/**
 *  \brief STATIC Scope: Local function to determine the length of a JSON object or array. Used by lqc_getJsonPropValue().
 * 
 *  \param [in] blockStart - Pointer to the starting point for the scan.
 *  \param [in] jsonEnd - End of the original JSON formatted char array.
 *  \param [in] blockOpen - Character marking the start of the block being sized, used to identify nested blocks.
 *  \param [in] blockClose - Character marking the end of the block being sized (including nested).
 * 
 *  \return The size of the block (object\array) including the opening and closing marking chars.
*/
\brief STATIC Scope: Local function to determine the length of a JSON object or array.

\param [in] blockStart - Pointer to the starting point for the scan.
\param [in] jsonEnd - End of the original JSON formatted char array.
\param [in] blockOpen - Character marking the start of the block being sized, used to identify nested blocks.
\param [in] blockClose - Character marking the end of the block being sized (including nested).

\return The size of the block (object\array) including the opening and closing marking chars.
\ brief STATIC Scope : Local function to determine the length of a JSON object or array . \ param [ in ] blockStart - Pointer to the starting point for the scan . \ param [ in ] jsonEnd - End of the original JSON formatted char array . \ param [ in ] blockOpen - Character marking the start of the block being sized used to identify nested blocks . \ param [ in ] blockClose - Character marking the end of the block being sized ( including nested ) . \ return The size of the block ( object \ array ) including the opening and closing marking chars .
static uint16_t findJsonBlockLength(const char *blockStart, const char *jsonEnd, char blockOpen, char blockClose)
{
    uint8_t openPairs = 1;
    char * next = (char*)blockStart;
    while (openPairs > 0 && next < jsonEnd)   
    {
        next++;
        if (*next == blockOpen) openPairs++;
        if (*next == blockClose) openPairs--;
   }
   return (next - blockStart + 1);
}
static uint16_t findJsonBlockLength ( const char * blockStart , const char * jsonEnd , char blockOpen , char blockClose ) { uint8_t openPairs = 1 ; char * next = ( char * ) blockStart ; while ( openPairs > 0 && next < jsonEnd ) { next ++ ; if ( * next == blockOpen ) openPairs ++ ; if ( * next == blockClose ) openPairs -- ; } return ( next - blockStart + 1 ) ; }
\brief STATIC Scope: Local function to determine the length of a JSON object or array.
\ brief STATIC Scope : Local function to determine the length of a JSON object or array .
// scan forward until . or beyond current property