Minor changes + cosmetics

Added conversion from STRING to JSON_STRING to help users.
This commit is contained in:
jfiat
2011-10-07 12:19:27 +00:00
parent 05b4bd90f5
commit 3739909e43
3 changed files with 392 additions and 433 deletions

View File

@@ -24,6 +24,9 @@ inherit
create
make_json
convert
make_json ({STRING})
feature {NONE} -- Initialization
make_json (an_item: STRING)
@@ -45,7 +48,7 @@ feature -- Access
Result.append (item)
Result.append_character ('%"')
end
feature -- Visitor pattern
accept (a_visitor: JSON_VISITOR)
@@ -92,7 +95,7 @@ feature -- Status report
feature {NONE} -- Implementation
escaped_json_string (s: STRING): STRING
escaped_json_string (s: READABLE_STRING_8): STRING
-- JSON string with '"' and '\' characters escaped
require
s_not_void: s /= Void
@@ -101,7 +104,7 @@ feature {NONE} -- Implementation
Result.replace_substring_all ("\", "\\")
Result.replace_substring_all ("%"", "\%"")
end
invariant
value_not_void: item /= Void