| 369 | |
| 370 | |
| 371 | ODBlock * ODBlock::getBlock(const char * ident,bool bRecursiveSearch) //returns block with given identifier, or NULL. |
| 372 | { |
| 373 | ODBlock * b; |
| 374 | if (identifier && ident && strncmp(identifier,ident,OD_MAXID) == 0) |
| 375 | return this; |
| 376 | else |
| 377 | { |
| 378 | if (bTerminal) |
| 379 | return NULL; |
| 380 | else |
| 381 | { |
| 382 | ODBlockList::Iterator i; |
| 383 | for (i = subBlocks.begin(); i != subBlocks.end(); ++i) |
| 384 | if (bRecursiveSearch) |
| 385 | { |
| 386 | b = (*i)->getBlock(ident,true); |
| 387 | if (b) |
| 388 | return b; |
| 389 | } |
| 390 | else |
| 391 | { |
| 392 | if ((*i)->identifier && ident && strncmp((*i)->identifier,ident,OD_MAXID) == 0) |
| 393 | return (*i); |
| 394 | } |
| 395 | return NULL; |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | } |
| 400 | |
| 401 | // hig level macro functs, return true on success: |
| 402 | bool ODBlock::getBlockInt(const char * ident, int* p, unsigned count) //reads blocks of form: ident{ 123; 123; ... } |
no test coverage detected