Fixed normalized line endings

This commit is contained in:
jvelilla
2013-11-07 18:14:59 -03:00
parent 8a96ed87b1
commit 137af843af
6 changed files with 237 additions and 238 deletions

View File

@@ -1,26 +1,26 @@
History file for EJSON History file for EJSON
====================== ======================
team: "" team: ""
date: "2011-07-06" date: "2011-07-06"
revision: "0.3.0" revision: "0.3.0"
+++++++++++++++++++++Important Changes since 0.2.0 version++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++Important Changes since 0.2.0 version++++++++++++++++++++++++++++++++++++++++++++++
*Updated skip_white_spaces, now check %U and %T codes *Updated skip_white_spaces, now check %U and %T codes
*Undo changes to is_a_valid_number, because it's doesn't follow the *Undo changes to is_a_valid_number, because it's doesn't follow the
JSON spec. Tests : fail13.json, fail29.json and fail30.json are valid JSON spec. Tests : fail13.json, fail29.json and fail30.json are valid
with this implementation, so we go back to the previous with this implementation, so we go back to the previous
implementation. implementation.
*Added autotest test suite *Added autotest test suite
*Added getest based test program *Added getest based test program
*Updated Eiffel configuration file, updated to the new clusters *Updated Eiffel configuration file, updated to the new clusters
*Added converters and factory classes *Added converters and factory classes
*Added new top level directories; library, test, build and example *Added new top level directories; library, test, build and example

View File

@@ -1,20 +1,20 @@
Copyright (c) 2010 Javier Velilla and others, http://ejson.origo.ethz.ch Copyright (c) 2010 Javier Velilla and others, http://ejson.origo.ethz.ch
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.

View File

@@ -1,97 +1,97 @@
Readme file for eJSON Readme file for eJSON
===================== =====================
team: "Javier Velilla,Jocelyn Fiat, Paul Cohen" team: "Javier Velilla,Jocelyn Fiat, Paul Cohen"
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
1. Introduction 1. Introduction
--------------- ---------------
eJSON stands for Eiffel JSON library and is a small Eiffel library for dealing eJSON stands for Eiffel JSON library and is a small Eiffel library for dealing
with the JSON format. The objective of the library is to provide two basic with the JSON format. The objective of the library is to provide two basic
features Eiffel2JSON and JSON2Eiffel. features Eiffel2JSON and JSON2Eiffel.
2. Legal stuff 2. Legal stuff
-------------- --------------
eJSON is copyrighted by the author Javier Velilla and others. It is licensed eJSON is copyrighted by the author Javier Velilla and others. It is licensed
under the MIT License. See the file license.txt in the same directory as this under the MIT License. See the file license.txt in the same directory as this
readme file. readme file.
3. Versioning scheme 3. Versioning scheme
-------------------- --------------------
eJSON version numbers has the form: eJSON version numbers has the form:
«major number».«minor number».«patch level» «major number».«minor number».«patch level»
eJSON will retain the major number 0 as long as it has beta status. A change in eJSON will retain the major number 0 as long as it has beta status. A change in
major number indicates that a release is not backward compatible. A change in major number indicates that a release is not backward compatible. A change in
minor number indicates that a release is backward compatible (within that major minor number indicates that a release is backward compatible (within that major
number) but that new useful features may have been added. A change in patch number) but that new useful features may have been added. A change in patch
level simply indicates that the release contains bug fixes for the previous level simply indicates that the release contains bug fixes for the previous
release. Note that as long as eJSON is in beta status (0.Y.Z) backward release. Note that as long as eJSON is in beta status (0.Y.Z) backward
compatibility is not guranteed for changes in minor numbers! compatibility is not guranteed for changes in minor numbers!
4. Documentation 4. Documentation
--------------- ---------------
Currently the only documentation on eJSON is available at: Currently the only documentation on eJSON is available at:
https://github.com/eiffelhub/json/wiki/User-guide https://github.com/eiffelhub/json/wiki/User-guide
5. Requirements and installation 5. Requirements and installation
-------------------------------- --------------------------------
EJSON requires that you have: EJSON requires that you have:
1. Gobo 3.9 installed or later 1. Gobo 3.9 installed or later
2. One of the following compiler combinations installed: 2. One of the following compiler combinations installed:
* ISE Eiffel 6.5 or later. * ISE Eiffel 6.5 or later.
* gec [try to test] * gec [try to test]
* tecomp [try to test] * tecomp [try to test]
eJSON probably works fine with other versions of the above compilers. eJSON probably works fine with other versions of the above compilers.
There are no known platform dependencies (Windows, Linux). There are no known platform dependencies (Windows, Linux).
To install eJSON simply extract the ejson-X.Y.Z.zip file to some appropriate To install eJSON simply extract the ejson-X.Y.Z.zip file to some appropriate
place on your hard disk. There are no requirements on environment variables or place on your hard disk. There are no requirements on environment variables or
registry variables. registry variables.
To verify that everything works you should compile the example programs and/or To verify that everything works you should compile the example programs and/or
the test program. the test program.
6. Contents of eJSON 6. Contents of eJSON
-------------------- --------------------
All directory names below are relative to the root directory of your ejson All directory names below are relative to the root directory of your ejson
installation. installation.
Directory Description Directory Description
--------- ----------- --------- -----------
doc Contains the eJSON.pdf documentation file. doc Contains the eJSON.pdf documentation file.
examples Contains the two example programs. examples Contains the two example programs.
ejson Contains the actual eJSON library classes. ejson Contains the actual eJSON library classes.
test Contains a test program for eJSON. test Contains a test program for eJSON.
7. Contacting the Team 7. Contacting the Team
---------------------- ----------------------
Contact the team: Contact the team:
Javier Velilla «javier.hector@gmail.com» Javier Velilla «javier.hector@gmail.com»
Paul Cohen «paco@seibostudios.se» Paul Cohen «paco@seibostudios.se»
Jocelyn Fiat «jfiat@eiffel.com» Jocelyn Fiat «jfiat@eiffel.com»
8. Releases 8. Releases
----------- -----------
For more information on what was changed in each release look in the file For more information on what was changed in each release look in the file
history.txt. history.txt.
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
0.3.0 2011-07-06 JSON Factory Converters 0.3.0 2011-07-06 JSON Factory Converters
0.2.0 2010-02-07 Adapted to EiffelStudio 6.4 or later, supports void-safety 0.2.0 2010-02-07 Adapted to EiffelStudio 6.4 or later, supports void-safety
0.1.0 2010-02-07 First release, Adapted to SmartEiffel 1.2r7 and EiffelStudio 6.2 or previous 0.1.0 2010-02-07 First release, Adapted to SmartEiffel 1.2r7 and EiffelStudio 6.2 or previous

View File

@@ -1,38 +1,37 @@
note note
description: "Objects that ..." description: "Objects that ..."
author: "" date: "$Date$"
date: "$Date$" revision: "$Revision$"
revision: "$Revision$"
class
class JSON_FILE_READER
JSON_FILE_READER
feature -- Access
feature -- Access
read_json_from (a_path: STRING): detachable STRING
read_json_from (a_path: STRING): detachable STRING local
local l_file: PLAIN_TEXT_FILE
l_file: PLAIN_TEXT_FILE template_content: STRING
template_content: STRING l_last_string: detachable STRING
l_last_string: detachable STRING do
do create l_file.make (a_path)
create l_file.make (a_path) -- We perform several checks until we make a real attempt to open the file.
-- We perform several checks until we make a real attempt to open the file. if not l_file.exists then
if not l_file.exists then print ("error: '" + a_path + "' does not exist%N")
print ("error: '" + a_path + "' does not exist%N") else
else if not l_file.is_readable then
if not l_file.is_readable then print ("error: '" + a_path + "' is not readable.%N")
print ("error: '" + a_path + "' is not readable.%N") else
else l_file.open_read
l_file.open_read create template_content.make_empty
create template_content.make_empty l_file.read_stream (l_file.count)
l_file.read_stream (l_file.count) l_last_string := l_file.last_string
l_last_string := l_file.last_string check l_last_string /= Void end -- implied by postcondition of `l_file.read_stream'
check l_last_string /= Void end -- implied by postcondition of `l_file.read_stream' template_content.append (l_last_string.string)
template_content.append (l_last_string.string) Result := template_content
Result := template_content l_file.close
l_file.close end
end end
end end
end
end
end

View File

@@ -1,59 +1,59 @@
note note
description: description:
"JSON Visitor" "JSON Visitor"
pattern: "Visitor" pattern: "Visitor"
author: "Javier Velilla" author: "Javier Velilla"
license:"MIT (see http://www.opensource.org/licenses/mit-license.php)" license:"MIT (see http://www.opensource.org/licenses/mit-license.php)"
date: "2008/08/24" date: "2008/08/24"
revision: "Revision 0.1" revision: "Revision 0.1"
deferred class deferred class
JSON_VISITOR JSON_VISITOR
feature -- Visitor Pattern feature -- Visitor Pattern
visit_json_array (a_json_array: JSON_ARRAY) visit_json_array (a_json_array: JSON_ARRAY)
-- Visit `a_json_array'. -- Visit `a_json_array'.
require require
a_json_array_not_void: a_json_array /= Void a_json_array_not_void: a_json_array /= Void
deferred deferred
end end
visit_json_boolean (a_json_boolean: JSON_BOOLEAN) visit_json_boolean (a_json_boolean: JSON_BOOLEAN)
-- Visit `a_json_boolean'. -- Visit `a_json_boolean'.
require require
a_json_boolean_not_void: a_json_boolean /= Void a_json_boolean_not_void: a_json_boolean /= Void
deferred deferred
end end
visit_json_null (a_json_null: JSON_NULL) visit_json_null (a_json_null: JSON_NULL)
-- Visit `a_json_null'. -- Visit `a_json_null'.
require require
a_json_null_not_void: a_json_null /= Void a_json_null_not_void: a_json_null /= Void
deferred deferred
end end
visit_json_number (a_json_number: JSON_NUMBER) visit_json_number (a_json_number: JSON_NUMBER)
-- Visit `a_json_number'. -- Visit `a_json_number'.
require require
a_json_number_not_void: a_json_number /= Void a_json_number_not_void: a_json_number /= Void
deferred deferred
end end
visit_json_object (a_json_object: JSON_OBJECT) visit_json_object (a_json_object: JSON_OBJECT)
-- Visit `a_json_object'. -- Visit `a_json_object'.
require require
a_json_object_not_void: a_json_object /= Void a_json_object_not_void: a_json_object /= Void
deferred deferred
end end
visit_json_string (a_json_string: JSON_STRING) visit_json_string (a_json_string: JSON_STRING)
-- Visit `a_json_string'. -- Visit `a_json_string'.
require require
a_json_string_not_void: a_json_string /= Void a_json_string_not_void: a_json_string /= Void
deferred deferred
end end
end end

View File

@@ -1,4 +1,4 @@
{"menu": { { "menu": {
"id": "file", "id": "file",
"value": "File", "value": "File",
"popup": { "popup": {