MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / addLines

Method addLines

JUCE/modules/juce_core/text/juce_StringArray.cpp:362–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362int StringArray::addLines (StringRef sourceText)
363{
364 int numLines = 0;
365 auto text = sourceText.text;
366 bool finished = text.isEmpty();
367
368 while (! finished)
369 {
370 for (auto startOfLine = text;;)
371 {
372 auto endOfLine = text;
373
374 switch (text.getAndAdvance())
375 {
376 case 0: finished = true; break;
377 case '\n': break;
378 case '\r': if (*text == '\n') ++text; break;
379 default: continue;
380 }
381
382 strings.add (String (startOfLine, endOfLine));
383 ++numLines;
384 break;
385 }
386 }
387
388 return numLines;
389}
390
391StringArray StringArray::fromTokens (StringRef stringToTokenise, bool preserveQuotedStrings)
392{

Callers 15

restoreFromStringMethod · 0.80
readLinesMethod · 0.80
connectMethod · 0.80
connectMethod · 0.80
loadFromTextMethod · 0.80
fromLinesMethod · 0.80
cleanWhitespaceFunction · 0.80
fixIncludesFunction · 0.80
fillInGeneratedCodeMethod · 0.80
copyAcrossUserSectionsFunction · 0.80
loadFromCppMethod · 0.80

Calls 4

StringFunction · 0.70
isEmptyMethod · 0.45
getAndAdvanceMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected