Commit graph

35 commits

Author SHA1 Message Date
Eric Frias
e5a5323642 When formatting doubles as strings, use 17 digits of precision to ensure they are read back in without loss (up from 12 digits).
Add a mode to the JSON parser to parse all real numbers into strings, so we can later parse them into doubles or another fixed/floating point format to preserve as much precision as needed
2015-06-12 11:05:52 -04:00
Daniel Larimer
71cca4559c adding quotes around large integers 2015-05-18 15:05:25 -04:00
Daniel Larimer
135949ee19 large integers are converted to strings in JSON printing 2015-05-15 15:58:47 -04:00
Daniel Larimer
812b42dbe6 adding default 2015-05-12 12:59:14 -04:00
Daniel Larimer
4f0919c493 adding sanity checks to string->json parsing 2015-05-12 12:58:47 -04:00
Daniel Larimer
8b5e2e7613 adding helper to get a list of variants from a string 2015-03-31 18:46:05 -04:00
drltc
40943808d0 Initial implementation of relaxed JSON parser (not fully tested) 2015-01-02 10:37:16 -05:00
Daniel Larimer
dfe67a4494 adding blob type to variant 2014-10-15 23:32:37 -04:00
Eric Frias
4e83427df0 Improvements for handling unicode filenames on Windows. When converting fc::path to/from fc::variant, use utf8 encoding. Replace several places where we use a std::ifstream and open it with a char* filename with a boost::filesystem::ifstream and open it with a boost::filesystem::path, which does unicode correctly. 2014-10-09 16:21:52 -04:00
Nathan Hourt
07e3947ed4 Fix bug in json pretty printer which broke formatting and possibly
corrupted json
2014-09-17 13:27:37 -04:00
Nathan Hourt
9b6facea3f Make the JSON parser less fragile 2014-09-08 10:12:42 -04:00
Daniel Larimer
0a2a9ec25b check for EOF while parsing quoted strings 2014-06-05 11:54:19 -04:00
Daniel Larimer
2e109d18c9 Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into HEAD 2014-06-04 22:18:39 +00:00
Daniel Larimer
df2d013bad fix exceptions when parsing json 2014-06-04 22:17:21 +00:00
Eric Frias
ff04a5a8fb Catch std::ios_base::failure exceptions, which mean EOF when reading JSON from a std::stringstream 2014-06-04 16:55:26 -04:00
Daniel Larimer
8a8ff28221 adding '/' to token chars to support paths 2014-05-19 16:59:01 -04:00
Eric Frias
c4770f0819 Restore correct parsing of json keywords (true/false/null) 2014-05-19 14:12:49 -04:00
Vikram Rajkumar
e8326ca66c Make objectFromStream always throw parse_error_exception when throwing 2014-05-17 03:30:49 -04:00
Daniel Larimer
8c370b06e6 update json error handling 2014-05-15 17:44:38 -04:00
Daniel Larimer
7078ebf382 expanding token chars 2014-05-15 14:07:19 -04:00
Daniel Larimer
c27ea9ba13 fix bugs parsing json tokens 2014-05-15 13:52:21 -04:00
Daniel Larimer
271fe8b909 found major bug in parsing, fixed it 2014-05-15 13:35:49 -04:00
Daniel Larimer
8d4fccba5f update pretty print save to file 2014-05-11 20:33:08 -04:00
Daniel Larimer
3a34299199 update json validation and varint hashing 2014-05-07 21:27:37 -04:00
Eric Frias
9731fac9f3 Fix error parsing a numeric constant at the end of file 2014-04-22 18:35:36 -04:00
Eric Frias
cd34f696ce - Add four-argument version of json-rpc call function
- fix bug in json parser that prevented correct parsing of
  a true/false/null at the end of input
- prevent infinite recursion in a json helper function
2014-04-21 14:34:46 -04:00
dnotestein
503b9033e8 fix infinite loop in windows when trying to read json variant from empty file 2014-02-27 21:56:46 -05:00
Daniel Larimer
4571ce36d5 fix bug in json file loading, see issue #8 2014-02-13 01:47:08 -05:00
vogel76
59f80e34d2 [BW]: [NIP] Further changes to get to work paths containing unicode characters:
- fc::path extended by method toNativeAnsiPath allowing to safely convert current unicode path into its ansi equivalent
- fc::path to_variant uses toNativeAnsiPath method instead of generic_string to avoid loss of data while serializing a path
- fc::mmap_struct_base::open should use toNativeAnsiPath method instead of generic_string to access ansi path
- fc::json::save_to_file should directly pass fc::path to underlying stream instead of generic_string.
2014-01-10 00:05:18 +01:00
Daniel Larimer
e1e3a7361b added flexability to json parsing and fixed closing hang in json rpc connection 2013-11-24 22:23:29 -05:00
Daniel Larimer
105948ea65 json and variant bug fixes 2013-08-15 12:44:51 -04:00
Daniel Larimer
d2635d0f8b fix pretty print 2013-07-30 00:28:37 -04:00
Daniel Larimer
a792cfaca7 update save to file to take fc::path 2013-07-18 19:09:18 -04:00
Daniel Larimer
a4a00717ef restore json pretty print 2013-06-06 23:42:20 -04:00
Daniel Larimer
59a121d64b Updating FC with changes from phoenix-int 2013-06-05 15:19:00 -04:00