working on csv data, parser works but needs more testing, might add bool to ParserData_DestroyFn callback for clearing
This commit is contained in:
parent
4c3d357cb9
commit
ca6a9c118f
13 changed files with 384 additions and 279 deletions
|
|
@ -0,0 +1,26 @@
|
|||
#include "arc/std/parser/helpers.h"
|
||||
#include "arc/std/errno.h"
|
||||
|
||||
void ARC_ParserData_HelperRecurseStringAdd(ARC_String **data, ARC_ParserTagToken *tagToken){
|
||||
if(*data == NULL){
|
||||
arc_errno = ARC_ERRNO_NULL;
|
||||
ARC_DEBUG_LOG_ERROR("ARC_ParserData_RecurseStringAdd(data, tagToken), string data was NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
//only adds tokens with data (check the header for more information)
|
||||
if(tagToken->token != NULL && tagToken->token->data != NULL){
|
||||
ARC_String_Append(data, tagToken->token->data);
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO: probs don't need this
|
||||
if(tagToken->tagTokens == NULL){
|
||||
return;
|
||||
}
|
||||
|
||||
//recurse through all the tag tokens
|
||||
for(uint32_t index = 0; index < ARC_Vector_GetSize(tagToken->tagTokens); index++){
|
||||
ARC_ParserData_HelperRecurseStringAdd(data, (ARC_ParserTagToken *)ARC_Vector_Get(tagToken->tagTokens, index));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue