• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision96 (tree)
Time2018-05-11 22:12:34
Authorquiret

Log Message

- made libparse a wildcard project
- added JSON skeleton stuff

Change Summary

Incremental Difference

--- parsing/include/libparse/jsonparse.h (revision 0)
+++ parsing/include/libparse/jsonparse.h (revision 96)
@@ -0,0 +1,45 @@
1+#ifndef _LIBPARSE_JSON_PARSING_
2+#define _LIBPARSE_JSON_PARSING_
3+
4+#include <sdk/UniChar.h>
5+
6+enum class eJSONType
7+{
8+ NUMBER,
9+ BOOLEAN,
10+ STRING,
11+ TABLE
12+};
13+
14+struct JSONObject
15+{
16+ JSONObject( void );
17+ JSONObject( const JSONObject& right );
18+ JSONObject( JSONObject&& right );
19+ ~JSONObject( void );
20+
21+ JSONObject& operator = ( const JSONObject& right );
22+ JSONObject& operator = ( JSONObject&& right );
23+
24+ bool LoadFromString( const char8_t *jsonString );
25+
26+private:
27+ eJSONType type;
28+ union
29+ {
30+ double number;
31+ bool boolean;
32+ struct
33+ {
34+ const char *string_ptr;
35+ size_t string_len;
36+ };
37+ struct
38+ {
39+ JSONObject *array_of_objects;
40+ size_t array_len;
41+ };
42+ } data;
43+};
44+
45+#endif //_LIBPARSE_JSON_PARSING_
\ No newline at end of file
--- parsing/src/jsonparse.cpp (revision 0)
+++ parsing/src/jsonparse.cpp (revision 96)
@@ -0,0 +1,8 @@
1+#include "jsonparse.h"
2+
3+#include <sdk/UniChar.h>
4+
5+// Syntax parsers.
6+#include <gtaconfig/include.h>
7+
8+// TODO.
\ No newline at end of file
Show on old repository browser