Commit graph

69 commits

Author SHA1 Message Date
Peter Conrad
a91822616e Added max_depth to remaining variant conversions 2018-03-18 10:49:44 +01:00
Peter Conrad
1331485c08 Stringify numbers >MAXINT or <MININT 2018-03-08 22:33:54 +01:00
Peter Conrad
f9802f6860 Added max_depth parameter to all to_/from_ methods 2018-03-08 22:33:41 +01:00
Peter Conrad
1412df18d1 Make broken_nul_parser usable 2018-03-08 22:33:27 +01:00
Peter Conrad
66ed9fc3dc Minor fixes 2018-03-07 22:42:43 +01:00
Peter Conrad
2bacd5fda8 Added broken_nul_parser to preserve previous behaviour 2018-03-07 15:44:18 +01:00
Peter Conrad
90137d400d Fix for recursion depth limitation 2018-03-07 15:44:10 +01:00
Peter Conrad
1ae3cc2fad Make unused parsers compile-time optional 2018-03-07 15:43:14 +01:00
Peter Conrad
43fabf618f Code deduplication 2018-03-07 15:42:46 +01:00
Peter Conrad
e37d9a5051 Code cleanups and simplifications 2018-03-07 15:42:35 +01:00
Peter Conrad
4d782e894f Deduplicate some code 2018-03-06 14:46:34 +01:00
Peter Conrad
52f6810735 Fixed from_file 2018-03-06 14:46:20 +01:00
Peter Conrad
bbe2a8b289 JSON parsing fix from steem PR 2178 2018-03-01 18:58:23 +01:00
theoreticalbts
19d41b8606 Do not emit \a escape sequence 2016-09-02 10:36:11 -04:00
theoreticalbts
c672e3b4b4 json.cpp: Add missing cases for control character escape sequences 2016-07-21 13:33:36 -04:00
theoreticalbts
c16bb206a3 fstream: Implement read_file_contents 2015-08-06 14:47:15 -04:00
Scott Howard
153d3f0433
Fix cryptonomex/graphene#107: Define char as signed when comparing against EOF 2015-07-05 15:44:32 -04:00
Peter Conrad
8ff0f3e764 Dont ignore EOF because users cannot distinguish EOF and empty input line 2015-06-21 15:33:50 +02:00
Eric Frias
c2451f30f1 Add a new mode to the variant->json generator to restore the normal
behavior of writing numbers out as numbers instead of strings
2015-06-12 11:05:58 -04:00
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
Eric Frias
5a91c4f118 Virtualize a few functions in istream to allow them to be overridden in derived classes 2014-12-22 17:56:30 -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
Eric Frias
751777e754 Fix more locations where we were making boost::asio calls with buffers declared on the stack which could cause problems when the calling tasks were canceled. 2014-09-11 16:30:03 -04:00
Eric Frias
aa6882b3b7 Allow us to safely cancel tasks that are executing asynchronous network reads
and writes.  This was previously unsafe because we almost always passed read/write
buffers to boost that were on the stack. Canceling the task deleted the stack and
therefore the buffer, but couldn't reliably prevent boost from writing to the buffer
if data came in after the cancel.  This commit adds variants of the read and write
functions that take a shared_ptr<char> instead of a raw char* as the buffer, and
these variants will ensure the shared_ptr will outlive the boost::asio read/write.
2014-09-09 11:10:37 -04:00
Nathan Hourt
9b6facea3f Make the JSON parser less fragile 2014-09-08 10:12:42 -04:00
Eric Frias
d847f6469a Allow us to require assigning descriptions to all async tasks to aid in debugging 2014-07-27 17:37:21 -04:00
dnotestein
9e320a3db8 Add descriptions for a bunch of async tasks, remove logging during thread::quit to avoid crashes for now until we cleanup thread quit code 2014-07-27 00:09:15 -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
HackFisher
174096c3ab Fix issue #25
eofbit std exception is replaced by eof_exception, checked in peek(), so no need to throw std exception when encounter EOF.
2014-05-20 19:17:19 +08: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
9378f6c7aa Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into phoenix 2014-05-07 21:27:48 -04:00
Daniel Larimer
3a34299199 update json validation and varint hashing 2014-05-07 21:27:37 -04:00