commandcontinuationfilter.cpp
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team * 00003 * bernd@kdevelop.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00012 #include "commandcontinuationfilter.h" 00013 #include <qregexp.h> 00014 #include <kdebug.h> 00015 00016 CommandContinuationFilter::CommandContinuationFilter( OutputFilter& next ) 00017 : OutputFilter( next ) 00018 { 00019 } 00020 00021 void CommandContinuationFilter::processLine( const QString& line ) 00022 { 00023 bool foundLineCont = false; 00024 QString s = line.stripWhiteSpace(); 00025 if (s.endsWith("\\")) 00026 { 00027 m_text += s.left(s.length() - 1); 00028 foundLineCont = true; 00029 } else 00030 { 00031 m_text += line; 00032 } 00033 00034 if ( !foundLineCont ) 00035 { 00036 OutputFilter::processLine( m_text ); 00037 m_text = ""; 00038 } 00039 }