eJson initial import

This commit is contained in:
jvelilla
2008-05-24 14:23:27 +00:00
commit 308fa7f2e7
13 changed files with 854 additions and 0 deletions

63
json/json_string.e Normal file
View File

@@ -0,0 +1,63 @@
indexing
description:"[
A JSON_STRING represent a string in JSON.
A string is a collection of zero or more Unicodes characters, wrapped in double
quotes, using blackslash espaces.
]"
author: "Javier Velilla"
date: "$Date$"
revision: "$Revision$"
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
class
JSON_STRING
inherit
JSON_VALUE
rename
is_equal as is_equal_json
end
create
make_json
feature -- Initialization
make_json(value:STRING) is
--
do
create buffer.make(256)
buffer.append (value)
end
feature -- Access
feature -- Change Element
append(value:STRING)is
--
do
buffer.append (value)
end
feature -- Status report
to_json:STRING is
--
do
create Result.make_empty
Result.append ("%"")
Result.append (buffer)
Result.append ("%"")
end
hash_code:INTEGER is
--
do
Result:= buffer.hash_code + buffer.count
end
feature {NONE} -- Implementation
buffer:STRING
invariant
invariant_clause: True -- Your invariant here
end