MCPcopy Create free account
hub / github.com/devosoft/avida / Pop

Method Pop

avida-core/source/tools/cString.cc:383–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381
382
383cString cString::Pop(const char delim)
384{
385 int pos;
386 cString rv("");
387 if( (pos=Find(delim)) >= 0 ){ // if it is found at all
388 if( pos > 0 ){ // if the first char is not delim, return substring
389 rv = Substring(0,pos);
390 }
391 // Trim off the front
392 InsertStr(0, NULL, 0, pos+1);
393 }
394
395 // If the deliminator is *not* found, return the whole string.
396 else {
397 rv = *this;
398 *this = "";
399 }
400 return rv;
401}
402
403
404cString cString::PopWord()

Callers 11

~cStringListMethod · 0.45
LoadMethod · 0.45
PrintRowMethod · 0.45
GetDataCommandMethod · 0.45
LoadCommandListMethod · 0.45
ReturnArrayMethod · 0.45
processCommandMethod · 0.45
GetLineAsDictMethod · 0.45
FlushMethod · 0.45
FlushMethod · 0.45
ProcessCommandLineMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected