MobilityDB  1.0
temporal_parser.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * MobilityDB includes portions of PostGIS version 3 source code released
9  * under the GNU General Public License (GPLv2 or later).
10  * Copyright (c) 2001-2021, PostGIS contributors
11  *
12  * Permission to use, copy, modify, and distribute this software and its
13  * documentation for any purpose, without fee, and without a written
14  * agreement is hereby granted, provided that the above copyright notice and
15  * this paragraph and the following two paragraphs appear in all copies.
16  *
17  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
18  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
19  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
20  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
21  * OF SUCH DAMAGE.
22  *
23  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
26  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
27  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
28  *
29  *****************************************************************************/
30 
36 #ifndef __TEMPORAL_PARSER_H__
37 #define __TEMPORAL_PARSER_H__
38 
39 #include <postgres.h>
40 #include <catalog/pg_type.h>
41 #include "timetypes.h"
42 #include "temporal.h"
43 
44 /*****************************************************************************/
45 
46 extern void ensure_end_input(char **str, bool end);
47 
48 extern void p_whitespace(char **str);
49 extern bool p_obrace(char **str);
50 extern bool p_cbrace(char **str);
51 extern bool p_obracket(char **str);
52 extern bool p_cbracket(char **str);
53 extern bool p_oparen(char **str);
54 extern bool p_cparen(char **str);
55 extern bool p_comma(char **str);
56 
57 extern TBOX *tbox_parse(char **str);
58 extern Datum basetype_parse(char **str, Oid basetype);
59 extern double double_parse(char **str);
60 extern TimestampTz timestamp_parse(char **str);
61 extern TimestampSet *timestampset_parse(char **str);
62 extern Period *period_parse(char **str, bool make);
63 extern PeriodSet *periodset_parse(char **str);
64 extern TInstant *tinstant_parse(char **str, Oid basetype, bool end, bool make);
65 extern Temporal *temporal_parse(char **str, Oid basetype);
66 
67 /*****************************************************************************/
68 
69 #endif
bool p_oparen(char **str)
Input an opening parenthesis from the buffer.
Definition: temporal_parser.c:140
Structure to represent periods.
Definition: timetypes.h:52
bool p_obrace(char **str)
Input an opening brace from the buffer.
Definition: temporal_parser.c:80
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
TimestampSet * timestampset_parse(char **str)
Parse a timestamp set value from the buffer.
Definition: temporal_parser.c:375
bool p_cbracket(char **str)
Input a closing bracket from the buffer.
Definition: temporal_parser.c:125
bool p_comma(char **str)
Input a comma from the buffer.
Definition: temporal_parser.c:170
Basic functions for temporal types of any subtype.
bool p_cparen(char **str)
Input a closing parenthesis from the buffer.
Definition: temporal_parser.c:155
Structure to represent period sets.
Definition: timetypes.h:84
Period * period_parse(char **str, bool make)
Parse a period value from the buffer.
Definition: temporal_parser.c:343
Structure to represent temporal boxes.
Definition: tbox.h:53
Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet...
void p_whitespace(char **str)
Input a white space from the buffer.
Definition: temporal_parser.c:55
bool p_obracket(char **str)
Input an opening bracket from the buffer.
Definition: temporal_parser.c:110
Structure to represent timestamp sets.
Definition: timetypes.h:73
void ensure_end_input(char **str, bool end)
Ensure there is no more input excepted white spaces.
Definition: temporal_parser.c:65
Temporal * temporal_parse(char **str, Oid basetype)
Parse a temporal value from the buffer (dispatch function)
Definition: temporal_parser.c:610
TimestampTz timestamp_parse(char **str)
Parse a timestamp value from the buffer.
Definition: temporal_parser.c:324
TInstant * tinstant_parse(char **str, Oid basetype, bool end, bool make)
Parse a temporal instant value from the buffer.
Definition: temporal_parser.c:454
bool p_cbrace(char **str)
Input a closing brace from the buffer.
Definition: temporal_parser.c:95
PeriodSet * periodset_parse(char **str)
Parse a period set value from the buffer.
Definition: temporal_parser.c:409
Datum basetype_parse(char **str, Oid basetype)
Parse a base value from the buffer.
Definition: temporal_parser.c:203
TBOX * tbox_parse(char **str)
Parse a temporal box value from the buffer.
Definition: temporal_parser.c:245
double double_parse(char **str)
Input a double from the buffer.
Definition: temporal_parser.c:188
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253