-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNull.cpp
More file actions
46 lines (38 loc) · 722 Bytes
/
Null.cpp
File metadata and controls
46 lines (38 loc) · 722 Bytes
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
#include <sstream>
#include "Null.h"
namespace json
{
Null::~Null()
{
}
type_t Null::getType() const
{
return NULL_TYPE;
}
Value* Null::parse(uint8_t*& b, size_t& max, uint32_t& line)
{
if( max >= 4 &&
(*b == 'n' || *b == 'N') &&
(*(b+1) == 'u' || *(b+1) == 'U') &&
(*(b+2) == 'l' || *(b+2) == 'L') &&
(*(b+3) == 'l' || *(b+3) == 'L'))
{
b += 4; max -= 4;
return new Null();
}
return NULL;
}
std::string Null::str() const
{
return std::string("null");
}
std::ostream& operator<<(std::ostream& os, const Null* obj)
{
os << "null";
return os;
}
Value* Null::_find( SPATH& spath) const
{
return NULL;
}
} // namespace json