lineparser.h

00001 /*
00002  * Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>
00003  * Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>
00004  * Copyright (c) 2005 Ryan Nickell <p0z3r@earthlink.net>
00005  * Copyright (c) 2005 Petri Damsten <damu@iki.fi>
00006  *
00007  * This file is part of SuperKaramba.
00008  *
00009  *  SuperKaramba is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  SuperKaramba is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with SuperKaramba; if not, write to the Free Software
00021  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  ****************************************************************************/
00023 #ifndef LINEPARSER_H
00024 #define LINEPARSER_H
00025 
00030 #include <qstring.h>
00031 #include <qcolor.h>
00032 
00033 class LineParser
00034 {
00035   public:
00036     LineParser(const QString& line = QString::null);
00037     ~LineParser();
00038 
00039     void set(const QString& line);
00040 
00041     int getInt(QString w, int def = 0) const;
00042     QColor getColor(QString w, QColor def = QColor()) const;
00043     QString getString(QString w, QString def = QString()) const;
00044     bool getBoolean(QString w, bool def = false) const;
00045 
00046     const QString& meter() const { return m_meter; };
00047 
00048   private:
00049     QString m_line;
00050     QString m_meter;
00051 };
00052 
00053 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys