//============================================================================== void CodeTool::writeLinesToStream (juce::FileOutputStream* stream, juce::StringArray& lines, const juce::String& lineEnding) { jassert (stream != nullptr); stream->setPosition (0); if (stream->truncate().wasOk()) { const int size = lines.size(); for (int i = 0; i < size; ++i) { const juce::String& line = lines.getReference (i); stream->writeText (line + (line.endsWith (lineEnding) ? juce::String::empty : lineEnding), false, false); } } }
void TrailingWhitespaceCleaner::cleanRange (juce::StringArray& lines, const int start, const int end) { for (int i = start; i < end; ++i) cleanLine (lines.getReference (i)); }