MobilityDB 1.1
type_parser.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2023, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
27 *
28 *****************************************************************************/
29
34#ifndef __TEMPORAL_PARSER_H__
35#define __TEMPORAL_PARSER_H__
36
37/* MEOS */
38#include "general/meos_catalog.h"
39#include "general/span.h"
40#include "general/set.h"
41#include "general/temporal.h"
42
43/*****************************************************************************/
44
45extern void ensure_end_input(const char **str, bool end, const char *type);
46
47extern void p_whitespace(const char **str);
48extern bool p_obrace(const char **str);
49extern bool p_cbrace(const char **str);
50extern bool p_obracket(const char **str);
51extern bool p_cbracket(const char **str);
52extern bool p_oparen(const char **str);
53extern bool p_cparen(const char **str);
54extern bool p_comma(const char **str);
55extern Datum temporal_basetype_parse(const char **str, meosType basetypid);
56extern double double_parse(const char **str);
57extern Datum elem_parse(const char **str, meosType basetype);
58extern Set *set_parse(const char **str, meosType basetype);
59extern Span *span_parse(const char **str, meosType spantype, bool end, bool make);
60extern SpanSet *spanset_parse(const char **str, meosType spantype);
61extern TBox *tbox_parse(const char **str);
62extern TimestampTz timestamp_parse(const char **str);
63extern TInstant *tinstant_parse(const char **str, meosType temptype, bool end,
64 bool make);
65extern TSequence *tdiscseq_parse(const char **str, meosType temptype);
66extern TSequence *tcontseq_parse(const char **str, meosType temptype,
67 interpType interp, bool end, bool make);
68extern TSequenceSet *tsequenceset_parse(const char **str, meosType temptype,
69 interpType interp);
70extern Temporal *temporal_parse(const char **str, meosType temptype);
71
72/*****************************************************************************/
73
74#endif
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:53
interpType
Enumeration that defines the interpolation types used in MobilityDB.
Definition: meos.h:124
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos.h:56
Structure to represent span sets.
Definition: meos.h:83
Structure to represent spans (a.k.a.
Definition: meos.h:70
Structure to represent temporal boxes.
Definition: meos.h:97
Structure to represent temporal values of instant subtype.
Definition: meos.h:148
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:186
Structure to represent temporal values of instant set or sequence subtype.
Definition: meos.h:165
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136
bool p_oparen(const char **str)
Input an opening parenthesis from the buffer.
Definition: type_parser.c:139
Datum elem_parse(const char **str, meosType basetype)
Parse a element value from the buffer.
Definition: type_parser.c:340
TBox * tbox_parse(const char **str)
Parse a temporal box value from the buffer.
Definition: type_parser.c:238
Set * set_parse(const char **str, meosType basetype)
Parse a timestamp set value from the buffer.
Definition: type_parser.c:373
bool p_obrace(const char **str)
Input an opening brace from the buffer.
Definition: type_parser.c:79
bool p_comma(const char **str)
Input a comma from the buffer.
Definition: type_parser.c:169
TSequence * tdiscseq_parse(const char **str, meosType temptype)
Parse a temporal discrete sequence from the buffer.
Definition: type_parser.c:524
bool p_cparen(const char **str)
Input a closing parenthesis from the buffer.
Definition: type_parser.c:154
SpanSet * spanset_parse(const char **str, meosType spantype)
Parse a span set value from the buffer.
Definition: type_parser.c:461
bool p_cbrace(const char **str)
Input a closing brace from the buffer.
Definition: type_parser.c:94
TSequenceSet * tsequenceset_parse(const char **str, meosType temptype, interpType interp)
Parse a temporal sequence set value from the buffer.
Definition: type_parser.c:621
Temporal * temporal_parse(const char **str, meosType temptype)
Parse a temporal value from the buffer (dispatch function)
Definition: type_parser.c:660
void ensure_end_input(const char **str, bool end, const char *type)
Functions for parsing temporal types.
Definition: type_parser.c:64
Datum temporal_basetype_parse(const char **str, meosType basetypid)
Parse a base value from the buffer.
Definition: type_parser.c:201
bool p_cbracket(const char **str)
Input a closing bracket from the buffer.
Definition: type_parser.c:124
TimestampTz timestamp_parse(const char **str)
Parse a timestamp value from the buffer.
Definition: type_parser.c:315
double double_parse(const char **str)
Input a double from the buffer.
Definition: type_parser.c:187
bool p_obracket(const char **str)
Input an opening bracket from the buffer.
Definition: type_parser.c:109
TInstant * tinstant_parse(const char **str, meosType temptype, bool end, bool make)
Parse a temporal instant value from the buffer.
Definition: type_parser.c:504
void p_whitespace(const char **str)
Functions for parsing time types and temporal types.
Definition: type_parser.c:53
Span * span_parse(const char **str, meosType spantype, bool end, bool make)
Parse a span value from the buffer.
Definition: type_parser.c:426
TSequence * tcontseq_parse(const char **str, meosType temptype, interpType interp, bool end, bool make)
Parse a temporal sequence value from the buffer.
Definition: type_parser.c:568