diff options
Diffstat (limited to 'mailnews/addrbook/src/nsAbQueryStringToExpression.h')
-rw-r--r-- | mailnews/addrbook/src/nsAbQueryStringToExpression.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mailnews/addrbook/src/nsAbQueryStringToExpression.h b/mailnews/addrbook/src/nsAbQueryStringToExpression.h new file mode 100644 index 000000000..dfd8da0c5 --- /dev/null +++ b/mailnews/addrbook/src/nsAbQueryStringToExpression.h @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef nsAbQueryStringToExpression_h__ +#define nsAbQueryStringToExpression_h__ + +#include "nsIAbBooleanExpression.h" + +class nsAbQueryStringToExpression +{ +public: + static nsresult Convert ( + const nsACString &aQueryString, + nsIAbBooleanExpression** expression); + +protected: + static nsresult ParseExpression ( + const char** index, + nsISupports** expression); + static nsresult ParseExpressions ( + const char** index, + nsIAbBooleanExpression* expression); + static nsresult ParseCondition ( + const char** index, + const char* indexBracketClose, + nsIAbBooleanConditionString** conditionString); + + static nsresult ParseConditionEntry ( + const char** index, + const char* indexBracketClose, + char** entry); + static nsresult ParseOperationEntry ( + const char* indexBracketOpen1, + const char* indexBracketOpen2, + char** operation); + + static nsresult CreateBooleanExpression( + const char* operation, + nsIAbBooleanExpression** expression); + static nsresult CreateBooleanConditionString ( + const char* attribute, + const char* condition, + const char* value, + nsIAbBooleanConditionString** conditionString); +}; + +#endif |