Nepomuk
queryparser.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the Nepomuk KDE project. 00003 Copyright (C) 2007-2010 Sebastian Trueg <trueg@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _NEPOMUK_SEARCH_QUERY_PARSER_H_ 00021 #define _NEPOMUK_SEARCH_QUERY_PARSER_H_ 00022 00023 #include "query.h" 00024 00025 #include <QtCore/QString> 00026 00027 #include "nepomukquery_export.h" 00028 00029 00030 namespace Nepomuk { 00031 namespace Query { 00090 class NEPOMUKQUERY_EXPORT QueryParser 00091 { 00092 public: 00096 QueryParser(); 00097 00101 ~QueryParser(); 00102 00108 enum ParserFlag { 00112 NoParserFlags = 0x0, 00113 00124 QueryTermGlobbing = 0x1, 00125 00134 DetectFilenamePattern = 0x2 00135 }; 00136 Q_DECLARE_FLAGS( ParserFlags, ParserFlag ) 00137 00138 00144 Query parse( const QString& query ) const; 00145 00157 Query parse( const QString& query, ParserFlags flags ) const; 00158 00176 QList<Types::Property> matchProperty( const QString& fieldName ) const; 00177 00184 static Query parseQuery( const QString& query ); 00185 00194 static Query parseQuery( const QString& query, ParserFlags flags ); 00195 00196 private: 00197 class Private; 00198 Private* const d; 00199 }; 00200 } 00201 } 00202 00203 Q_DECLARE_OPERATORS_FOR_FLAGS( Nepomuk::Query::QueryParser::ParserFlags ) 00204 00205 #endif
KDE 4.6 API Reference