3
* @author Paul Pedersen (pcp071098@yahoo.com)
4
* @copyright 2006-2007 FLWOR Foundation (flworfound.org)
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
20
#ifndef XQP_SEQUENCES_H
21
#define XQP_SEQUENCES_H
32
/*______________________________________________________________________
34
| 15.1 General Functions and Operators on Sequences
35
|_______________________________________________________________________*/
37
//15.1.1 fn:boolean (effective boolean value)
41
//15.1.2 op:concatenate
42
//---------------------
43
class op_concatenate : public function
46
op_concatenate(const signature&);
50
Iterator_t operator()(const yy::location& loc,std::vector<Iterator_t>&) const;
51
sequence_type_t type_check(signature&) const;
52
bool validate_args(std::vector<Iterator_t>&) const;
58
class fn_index_of : public function
61
fn_index_of(const signature&);
65
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
66
sequence_type_t type_check(signature&) const;
67
bool validate_args(std::vector<Iterator_t>&) const;
73
class fn_empty : public function
76
fn_empty(const signature&);
80
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
81
sequence_type_t type_check(signature&) const;
82
bool validate_args(std::vector<Iterator_t>&) const;
88
class fn_exists : public function
91
fn_exists(const signature&);
95
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
96
sequence_type_t type_check(signature&) const;
97
bool validate_args(std::vector<Iterator_t>&) const;
101
//15.1.6 fn:distinct-values
102
//-------------------------
103
class fn_distinct_values : public function
106
fn_distinct_values(const signature&);
107
~fn_distinct_values() {}
110
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
111
sequence_type_t type_check(signature&) const;
112
bool validate_args(std::vector<Iterator_t>&) const;
116
//15.1.7 fn:insert-before
117
//-----------------------
126
class fn_reverse : public function
129
fn_reverse(const signature&);
133
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
134
sequence_type_t type_check(signature&) const;
135
bool validate_args(std::vector<Iterator_t>&) const;
139
//15.1.10 fn:subsequence
140
//----------------------
141
class fn_subsequence : public function
144
fn_subsequence(const signature&);
148
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const;
149
sequence_type_t type_check(signature&) const;
150
bool validate_args(std::vector<Iterator_t>&) const;
154
//15.1.11 fn:unordered
155
//--------------------
158
/*______________________________________________________________________
160
| 15.2 Functions That Test the Cardinality of Sequences
161
|_______________________________________________________________________*/
163
//15.2.1 fn:zero-or-one
165
//15.2.2 fn:one-or-more
167
//15.2.3 fn:exactly-one
170
/*______________________________________________________________________
172
| 15.3 Equals, Union, Intersection and Except
173
|_______________________________________________________________________*/
175
//15.3.1 fn:deep-equal
179
//15.3.3 op:intersect
184
/*______________________________________________________________________
186
| 15.4 Aggregate Functions
187
|_______________________________________________________________________*/
198
class fn_min : public function
201
fn_min(const signature&);
205
sequence_type_t type_check(signature&) const { return xs_untypedValue; }
206
Iterator_t operator()(const yy::location& loc, std::vector<Iterator_t>&) const { return NULL; }
207
bool validate_args(std::vector<Iterator_t>&) const { return true; }
213
class fn_min_int : public function
216
fn_min_int(const signature&);
219
sequence_type_t type_check(signature&) const;
220
Iterator_t operator()( vector<Iterator_t>) const;
223
class fn_min_float : public function
226
fn_min_float(const signature&);
229
sequence_type_t type_check(signature&) const;
230
Iterator_t operator()( vector<Iterator_t>) const;
238
/*______________________________________________________________________
240
| 15.5 Functions and Operators that Generate Sequences
241
|_______________________________________________________________________*/
251
class fn_doc_func : public function
254
fn_doc_func(const signature&);
258
sequence_type_t type_check(signature&) const;
259
Iterator_t operator()( const yy::location& loc, std::vector<Iterator_t>&) const;
260
bool validate_args(std::vector<Iterator_t>&) const;
264
//15.5.5 fn:doc-available
266
//15.5.6 fn:collection
269
/*______________________________________________________________________
272
|_______________________________________________________________________*/
275
const std::string& path,
276
const std::string& baseuri,
277
const std::string& uri);
280
} /* namespace xqp */
281
#endif /* XQP_SEQUENCES_H */