KDevelop API Documentation

bufferedstringreader.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Mario Scalas                                    *
00003  *   mario.scalas@libero.it                                                *
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 "bufferedstringreader.h"
00013 
00015 // class CvsOptions
00017 
00018 BufferedStringReader::BufferedStringReader()
00019 {
00020 }
00021 
00023 
00024 BufferedStringReader::~BufferedStringReader()
00025 {
00026 }
00027 
00029 
00030 QStringList BufferedStringReader::process( const QString &otherChars )
00031 {
00032     // Add to previous buffered chars
00033     m_stringBuffer += otherChars;
00034     QStringList strings;
00035     // Now find all the basic strings in the buffer
00036     int pos;
00037     while ( (pos = m_stringBuffer.find('\n')) != -1)
00038     {
00039         QString line = m_stringBuffer.left( pos );
00040         if (!line.isEmpty())
00041         {
00042             strings.append( line );
00043         }
00044         m_stringBuffer = m_stringBuffer.right( m_stringBuffer.length() - pos - 1 );
00045     }
00046     return strings;
00047 }
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:43 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003