-
Notifications
You must be signed in to change notification settings - Fork 0
/
tomlbase.h
67 lines (51 loc) · 1.23 KB
/
tomlbase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _H_TOMLBASE
#define _H_TOMLBASE
#include <phpcpp.h>
#include "pcre8_imp.h"
namespace pun {
/*!
PathTag has no declared methods accessible by script.
It is used by internal TOML parsing.
*/
class PathTag : public Php::Base{
public:
static const char* PHP_NAME;
bool _objAOT; // ValueList for Array of Tables
bool _implicit; // Implicity created by Toml Path, not yet used as KeyTable
Php::Value __toString();
PathTag() : _objAOT(false), _implicit(true) {
}
};
/*!
A base class for ValueList and KeyTable, for the Tagable interface
*/
class TomlBase : public Php::Base {
protected:
Php::Value _tag;
public:
static const char* PHP_NAME;
static void setup_ext(Php::Extension& ext);
virtual int fn_endIndex() { return 0; }
// interface for PHP
Php::Value getTag() const;
void setTag(Php::Parameters& param);
public:
void fn_setTag(Php::Value&& v) { _tag = std::move(v); }
Php::Value fn_getTag() { return _tag; }
PathTag* fn_getPathTag();
void fn_setPathTag(PathTag* tag);
};
/*!
Temporary created during Table path parse
*/
class TomlPartTag {
public:
std::string _part;
TomlBase* _base;
bool _isAOT;
TomlPartTag(bool isAOT) : _base(nullptr), _isAOT(isAOT)
{
}
};
}; // end namespace pun
#endif