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
  
// $Id: JSON.pmod.in,v 1.2 2010/05/28 18:38:35 mast Exp $ 
 
#pike __REAL_VERSION__ 
 
//! @ignore 
#if !constant (@module@) 
constant this_program_does_not_exist = 1; 
#else 
inherit @module@; 
//! @endignore 
 
//! @appears Standards.JSON module 
//! 
//! Tools for handling the JSON structured data format. See 
//! @url{http://www.json.org/@} and RFC 4627. 
 
True true = True(); 
False false = False(); 
Null null = Null(); 
//! Objects representing the three JSON literals @expr{true@}, 
//! @expr{false@} and @expr{null@}. @expr{true@} and @expr{false@} 
//! should behave as expected in boolean contexts. 
 
class True 
//! Type for the @[true] object. 
{ 
  string encode_json() {return "true";} 
  protected string _sprintf (int flag) {return flag == 'O' && "JSON.true";} 
} 
 
class False 
//! Type for the @[false] object. 
{ 
  int `!() {return 1;} 
  string encode_json() {return "false";} 
  protected string _sprintf (int flag) {return flag == 'O' && "JSON.false";} 
} 
 
class Null 
//! Type for the @[null] object. 
{ 
  string encode_json() {return "null";} 
  protected string _sprintf (int flag) {return flag == 'O' && "JSON.null";} 
} 
 
#endif  // constant (@module@)