00001 /*************************************************************************** 00002 qgssearchstring.h 00003 interface for parsing and evaluation of search strings 00004 -------------------- 00005 begin : 2005-07-26 00006 copyright : (C) 2005 by Martin Dobias 00007 email : won.der at centrum.sk 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 /* $Id$ */ 00019 00020 #ifndef QGSSEARCHSTRING_H 00021 #define QGSSEARCHSTRING_H 00022 00023 #include <QString> 00024 00025 class QgsSearchTreeNode; 00026 00035 class CORE_EXPORT QgsSearchString 00036 { 00037 public: 00039 QgsSearchString(); 00040 00043 QgsSearchString( const QString & str ); 00044 00046 QgsSearchString( const QgsSearchString& str ); 00047 00049 ~QgsSearchString(); 00050 00052 QgsSearchString& operator=( const QgsSearchString& str ); 00053 00056 bool setString( QString str ); 00057 00058 /* copies tree and makes search string for it 00059 on success returns true and sets member variables to the new values */ 00060 bool setTree( QgsSearchTreeNode* tree ); 00061 00063 QgsSearchTreeNode* tree() { return mTree; } 00064 QString string() { return mString; } 00065 00067 const QString& parserErrorMsg() { return mParserErrorMsg; } 00068 00070 bool isEmpty(); 00071 00073 void clear(); 00074 00075 private: 00077 QgsSearchTreeNode* mTree; 00078 QString mString; 00079 00081 QString mParserErrorMsg; 00082 }; 00083 00084 #endif