Parser that reads points from *.GPX
file context.
More...
Go to the source code of this file.
Macros | |
#define | NL /* !"\n" & */ |
The new line charater[s]. More... | |
#define | NL /* !"\r\n" & */ |
The new line charater[s]. More... | |
#define | fetch(_T_) /* find_value(_T_, AttNams, AttVals) */ |
Macro to read data from parser context. More... | |
#define | _START_PARSER(_N_) |
Macro to start a parser. More... | |
#define | _END_PARSER(_N_) |
Macro to complete a start parser and open an end parser. More... | |
#define | _NEW_PARSER(_N_, _T_) |
Macro to complete an end parser and initialize the GMarkupParser UDT. More... | |
Functions | |
*FUNCTION_AS_INTEGER | isnum (BYVAL_AS_DOUBLE N) |
Check if floating point number is valid. More... | |
SUB_CDECL | skip_parser () |
This GMarkupParser parser does nothing, used for skipping unused XML-tags. More... | |
FUNCTION_AS_CONST_gchar_PTR | find_value (BYVAL_AS_CONST_gchar_PTR Nam, BYVAL_AS_CONST_gchar_PTR_PTR AttNams, BYVAL_AS_CONST_gchar_PTR_PTR AttVals) |
Find an attribute by its name. More... | |
SUB_CDECL | text_content (BYVAL_AS_GMarkupParseContext_PTR Ctx, BYVAL_AS_CONST_gchar_PTR Text, BYVAL_AS_gsize Size, BYVAL_AS_gpointer UserData, BYVAL_AS_GError_PTR_PTR Error_) |
Grep content between start and end tag. More... | |
SUB_CDECL | EXT_parser () |
The GMarkupParser for <extension> tags. More... | |
SUB_CDECL | PNT_parser () |
The GMarkupParser for <trkpt> tags. More... | |
SUB_CDECL | SEG_parser () |
The GMarkupParser for <trkseg> tags. More... | |
SUB_CDECL | TRK_parser () |
The GMarkupParser for <trk> tags. More... | |
SUB_CDECL | GPX_parser () |
The GMarkupParser for *.GPX files. More... | |
Parser that reads points from *.GPX
file context.
Code for a TYPE (class/UDT) that evaluates the context of a *.GPX
file, creating an array of TrP entries.
Definition in file parser_gpx.bas.
#define NL /* !"\n" & */ |
The new line charater[s].
Definition at line 18 of file parser_gpx.bas.
#define NL /* !"\r\n" & */ |
The new line charater[s].
Definition at line 18 of file parser_gpx.bas.
#define fetch | ( | _T_ | ) | /* find_value(_T_, AttNams, AttVals) */ |
Macro to read data from parser context.
This is an essential macro to find and read data in the parser GPX data.
Definition at line 47 of file parser_gpx.bas.
#define _START_PARSER | ( | _N_ | ) |
Macro to start a parser.
Each parser uses the same parameter list for the start function. This macro generates the code for such a procedure (SUB) and opens a WITH block to support access to the GPX data.
It's designed to be used in combination with the _END_PARSER() macro.
Definition at line 58 of file parser_gpx.bas.
#define _END_PARSER | ( | _N_ | ) |
Macro to complete a start parser and open an end parser.
Each parser uses the same code for ending a start function and the same parameter list for the end function. This macro generates the code to finish the start procedure (END WITH/END SUB), open an end procedure (SUB with constant parameter list) and opens a WITH block to support access to the GPX data.
It's designed to be used after the _START_PARSER() macro and in combination with the _NEW_PARSER() macro.
Definition at line 72 of file parser_gpx.bas.
#define _NEW_PARSER | ( | _N_, | |
_T_ | |||
) |
Macro to complete an end parser and initialize the GMarkupParser UDT.
Each parser uses the same code for ending an end procedure. This macro generates the code to finish the end procedure and generates a structure (TYPE) to use the parser. This TYPE contains two functions (procedures for start and end of a XML tag).
The second argument is used for the text
function, called for character data. Pass NULL
if you don't need any text from tags, or a function to fetch the text.
It's designed to be used after the _END_PARSER() macro.
Definition at line 88 of file parser_gpx.bas.
* FUNCTION_AS_INTEGER isnum | ( | BYVAL_AS_DOUBLE | N | ) |
Check if floating point number is valid.
N | Number to check |
The file content parser marks missing or error entries as NaN. This function identifies an input failure.
Definition at line 32 of file parser_gpx.bas.
SUB_CDECL skip_parser | ( | ) |
This GMarkupParser parser does nothing, used for skipping unused XML-tags.
Definition at line 92 of file parser_gpx.bas.
FUNCTION_AS_CONST_gchar_PTR find_value | ( | BYVAL_AS_CONST_gchar_PTR | Nam, |
BYVAL_AS_CONST_gchar_PTR_PTR | AttNams, | ||
BYVAL_AS_CONST_gchar_PTR_PTR | AttVals | ||
) |
Find an attribute by its name.
Nam | The attribute name |
AttNams | The GLib array of attribute names (zero terminated) |
AttVals | The GLib array of attribute values |
The GLib XML parser lists all attributes found in a tag and their values in the arrays AttNams and AttVals. This function finds an attribute by its name and returns its value. Otherwise it returns zero if the specified attribute isn't present.
Definition at line 108 of file parser_gpx.bas.
SUB_CDECL text_content | ( | BYVAL_AS_GMarkupParseContext_PTR | Ctx, |
BYVAL_AS_CONST_gchar_PTR | Text, | ||
BYVAL_AS_gsize | Size, | ||
BYVAL_AS_gpointer | UserData, | ||
BYVAL_AS_GError_PTR_PTR | Error_ | ||
) |
Grep content between start and end tag.
Ctx | the parser context |
Text | text read from tag |
Size | text length (not null terminated) |
UserData | our instance |
Error_ | pointer for error message |
If there's text between the opening and closing tag like <a>text</a>
, this function greps the context in member variable GPX.Cont.
Definition at line 133 of file parser_gpx.bas.
SUB_CDECL EXT_parser | ( | ) |
The GMarkupParser for <extension>
tags.
Definition at line 144 of file parser_gpx.bas.
SUB_CDECL PNT_parser | ( | ) |
The GMarkupParser for <trkpt>
tags.
Definition at line 167 of file parser_gpx.bas.
SUB_CDECL SEG_parser | ( | ) |
The GMarkupParser for <trkseg>
tags.
< Date / Time
< Latitude
< Longitude
< Elevation [m]
< Speed over ground [km/h]
< Direction Angle
Definition at line 203 of file parser_gpx.bas.
SUB_CDECL TRK_parser | ( | ) |
The GMarkupParser for <trk>
tags.
Definition at line 243 of file parser_gpx.bas.
SUB_CDECL GPX_parser | ( | ) |
The GMarkupParser for *.GPX
files.
Definition at line 267 of file parser_gpx.bas.