libidav/davqlparser.h

changeset 98
237844f263b4
parent 96
896022673e0e
child 102
e9ae1318a559
equal deleted inserted replaced
97:f82cb65a78ec 98:237844f263b4
44 44
45 /** 45 /**
46 * Enumeration of possible expression types. 46 * Enumeration of possible expression types.
47 */ 47 */
48 typedef enum { 48 typedef enum {
49 DAVQL_UNDEFINED_TYP,
49 DAVQL_NUMBER, DAVQL_STRING, DAVQL_TIMESTAMP, DAVQL_IDENTIFIER, 50 DAVQL_NUMBER, DAVQL_STRING, DAVQL_TIMESTAMP, DAVQL_IDENTIFIER,
50 DAVQL_UNARY, DAVQL_BINARY, DAVQL_LOGICAL, DAVQL_FUNCCALL 51 DAVQL_UNARY, DAVQL_BINARY, DAVQL_LOGICAL, DAVQL_FUNCCALL
51 } davqlexprtype_t; 52 } davqlexprtype_t;
52 53
53 /** 54 /**
109 * Default is false (ascending). 110 * Default is false (ascending).
110 */ 111 */
111 _Bool descending; 112 _Bool descending;
112 } DavQLOrderCriterion; 113 } DavQLOrderCriterion;
113 114
115 /**
116 * A tuple representing a field.
117 */
118 typedef struct {
119 /**
120 * The field name.
121 * <ul>
122 * <li>GET: the identifier or an alias name</li>
123 * <li>SET: the identifier</li>
124 * </ul>
125 */
126 sstr_t name;
127 /**
128 * The field expression.
129 * <ul>
130 * <li>GET: the queried property (identifier) or an expression</li>
131 * <li>SET: the expression for the value to be set</li>
132 * </ul>
133 */
134 DavQLExpression *expr;
135 } DavQLField;
114 136
115 /** 137 /**
116 * Query statement object. 138 * Query statement object.
117 * Contains the binary information about the parsed query. 139 * Contains the binary information about the parsed query.
118 * 140 *
143 * UnaryOperator = "-" | "~"; 165 * UnaryOperator = "-" | "~";
144 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^"; 166 * BinaryOperator = "+" | "-" | "*" | "/" | "&" | "|" | "^";
145 * LogicalOperator = " and " | " or " | " xor "; 167 * LogicalOperator = " and " | " or " | " xor ";
146 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!="; 168 * Comparison = | "=" | "<" | ">" | "<=" | ">=" | "!=";
147 * 169 *
148 * FieldExpressions = "*", {",", Expression, " as ", String} 170 * FieldExpressions = "*", {",", Expression, " as ", Identifier}
149 * | FieldExpression, {",", FieldExpression} 171 * | FieldExpression, {",", FieldExpression}
150 * | "-"; 172 * | "-";
151 * FieldExpression = Identifier 173 * FieldExpression = Identifier
152 * | Expression, " as ", String; 174 * | Expression, " as ", Identifier;
153 * SetExpressions = SetExpression, {",", SetExpressions}; 175 * SetExpressions = SetExpression, {",", SetExpressions};
154 * SetExpression = Identifier, "=", Expression; 176 * SetExpression = Identifier, "=", Expression;
155 * 177 *
156 * Path = "%s" 178 * Path = "%s"
157 * | "/", {?Character? - " "} 179 * | "/", {?Character? - " "}
202 /** 224 /**
203 * Error message, if any error occurred. 225 * Error message, if any error occurred.
204 */ 226 */
205 char* errormessage; 227 char* errormessage;
206 /** 228 /**
207 * The list of field expressions. 229 * The list of DavQLFields.
208 */ 230 */
209 UcxList* fields; 231 UcxList* fields;
210 /**
211 * The list of DavQLExpressions for the new DAV property values.
212 * This is <code>NULL</code> for GET queries.
213 */
214 UcxList* setvalues;
215 /** 232 /**
216 * A string that denotes the queried path. 233 * A string that denotes the queried path.
217 */ 234 */
218 sstr_t path; 235 sstr_t path;
219 /** 236 /**

mercurial