inline bool PBFParser::Parse() { double time; time = get_timestamp(); INFO("Parsing relations..."); ParseStep(eRelations); INFO("Parsing relations done after " << get_timestamp() - time << " seconds"); time = get_timestamp(); INFO("Parsing nodes and ways..."); ParseStep(eOther); INFO("Parsing nodes and ways done after " << get_timestamp() - time << " seconds"); return true; }
ProgramComponent* CommandParser::ParseCycle(char* pBuffer) { char countBuf[5]; //find first step char* pStep = strchr(pBuffer, '['); //get cycle count int countLen = pStep - pBuffer; strncpy(countBuf, pBuffer, countLen); countBuf[countLen] = '\0'; int cycCount = atoi(countBuf); Cycle* pCycle = gpThermocycler->GetCyclePool().AllocateComponent(); pCycle->SetNumCycles(cycCount); //add steps while (pStep != NULL) { *pStep++ = '\0'; char* pStepEnd = strchr(pStep, ']'); *pStepEnd++ = '\0'; Step* pNewStep = ParseStep(pStep); pCycle->AddComponent(pNewStep); pStep = strchr(pStepEnd, '['); } return pCycle; }