Ported r75 (all JSON value classes) from POC_CONVERTERS_FACTORY branch to trunk

This commit is contained in:
paul.cohen
2010-03-08 22:45:41 +00:00
parent 2710cae1da
commit a0e570226c
7 changed files with 500 additions and 405 deletions

View File

@@ -1,52 +1,61 @@
indexing
description: "JSON Truth values"
author: "Javier Velilla"
date: "2008/08/24"
revision: "Revision 0.1"
description: "JSON Truth values"
author: "Javier Velilla"
date: "2008/08/24"
revision: "Revision 0.1"
class
JSON_BOOLEAN
JSON_BOOLEAN
inherit
JSON_VALUE
JSON_VALUE
create
make_boolean
make_boolean
feature {NONE} -- Initialization
make_boolean (an_item: BOOLEAN) is
--Initialize.
do
item := an_item
end
make_boolean (an_item: BOOLEAN) is
--Initialize.
do
item := an_item
end
feature -- Access
item: BOOLEAN
-- Content
item: BOOLEAN
-- Content
hash_code: INTEGER is
-- Hash code value
do
Result := item.hash_code
end
hash_code: INTEGER is
-- Hash code value
do
Result := item.hash_code
end
representation: STRING is
do
if item then
Result := "true"
else
Result := "false"
end
end
feature -- Visitor pattern
accept (a_visitor: JSON_VISITOR) is
-- Accept `a_visitor'.
-- (Call `visit_json_boolean' procedure on `a_visitor'.)
do
a_visitor.visit_json_boolean (Current)
end
accept (a_visitor: JSON_VISITOR) is
-- Accept `a_visitor'.
-- (Call `visit_json_boolean' procedure on `a_visitor'.)
do
a_visitor.visit_json_boolean (Current)
end
feature -- Status report
debug_output: STRING
-- String that should be displayed in debugger to represent `Current'.
do
Result := item.out
end
debug_output: STRING
-- String that should be displayed in debugger to represent `Current'.
do
Result := item.out
end
end