rllib
1
lib
rljson.h
Go to the documentation of this file.
1
/***************************************************************************
2
rljson.h - description
3
-------------------
4
begin : Sat Jul 29 2023
5
copyright : (C) Lehrig Software Enigineering
6
email : lehrig@t-online.de
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This library is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13
* published by the Free Software Foundation *
14
* *
15
***************************************************************************/
16
#ifndef _RL_JSON_H_
17
#define _RL_JSON_H_
18
19
#include "
rldefine.h
"
20
#include "
rlstring.h
"
21
22
extern
const
char
rlCRLF
[];
23
27
typedef
struct
28
{
29
int
startsWithText
;
// "text"
30
int
startsWithOpenBracket
;
// {
31
int
startsWithCloseBracket
;
// }
32
int
startsWithEndArray
;
// ]
33
rlString
text
;
// white space in front of the tag name is ignored
34
int
optColon
;
// a colon must follow when text is a tag
35
int
optOpenBracket
;
// a openBracket { might follow
36
int
optBeginArray
;
// a beginArray [ might follow
37
int
optParamType
;
// 0=default=text 1=integer 2=float
38
rlString
param
;
// the parameter in text form
39
int
intParam
;
// 0 if there is no integer number
40
float
floatParam
;
// 0.0 if there is no floating point number
41
int
optComma
;
// tells us that more elements follow
42
}
rlJSONrecord
;
43
47
class
rlJSON
48
{
49
public
:
53
rlJSON
();
54
58
virtual
~rlJSON
();
59
63
int
initRecord
(
rlJSONrecord
*record);
64
68
int
interpret
(
const
char
*line,
rlJSONrecord
*record);
69
73
int
print
(FILE *fout,
rlJSONrecord
*record,
const
char
*indent=
""
);
74
};
75
76
#endif
rlJSON::~rlJSON
virtual ~rlJSON()
Definition:
rljson.cpp:22
rlJSONrecord::floatParam
float floatParam
Definition:
rljson.h:40
rlJSON::print
int print(FILE *fout, rlJSONrecord *record, const char *indent="")
Definition:
rljson.cpp:121
rlJSONrecord::text
rlString text
Definition:
rljson.h:33
rlJSONrecord::startsWithText
int startsWithText
Definition:
rljson.h:29
rlJSON::interpret
int interpret(const char *line, rlJSONrecord *record)
Definition:
rljson.cpp:44
rlJSONrecord::startsWithOpenBracket
int startsWithOpenBracket
Definition:
rljson.h:30
rlJSONrecord::optOpenBracket
int optOpenBracket
Definition:
rljson.h:35
rlJSONrecord::param
rlString param
Definition:
rljson.h:38
rlJSONrecord::optComma
int optComma
Definition:
rljson.h:41
rlJSONrecord::intParam
int intParam
Definition:
rljson.h:39
rlJSON::rlJSON
rlJSON()
Definition:
rljson.cpp:18
rlString
Definition:
rlstring.h:27
rlJSONrecord
Definition:
rljson.h:27
rlJSONrecord::optBeginArray
int optBeginArray
Definition:
rljson.h:36
rlJSONrecord::startsWithEndArray
int startsWithEndArray
Definition:
rljson.h:32
rlJSONrecord::startsWithCloseBracket
int startsWithCloseBracket
Definition:
rljson.h:31
rlJSONrecord::optParamType
int optParamType
Definition:
rljson.h:37
rlstring.h
rlJSON::initRecord
int initRecord(rlJSONrecord *record)
Definition:
rljson.cpp:26
rldefine.h
rlCRLF
const char rlCRLF[]
Definition:
rlstring.cpp:23
rlJSONrecord::optColon
int optColon
Definition:
rljson.h:34
rlJSON
Definition:
rljson.h:47
Generated by
1.8.14