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
Eric Frias
b8a7531eab
Fix error message printed when unable to deserialize a json object, improve
...
logging of return values and add logging of exceptional returns from
json function calls. Continue my endless quest to break the mac build.
2014-05-06 17:20:04 -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
c3ea6cc62c
Assert to warn when calling unimplemented functions
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
Daniel Larimer
51a3d1126f
fix console
2014-03-21 01:14:01 -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
0843aa6652
adding raw serialization for unordered_map
2014-02-16 01:17:31 -05:00
Daniel Larimer
2743b56b56
added utility to hide console echo for entering passwords
2014-02-15 14:06:35 -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
vogel76
c2026efd56
[BW]: [Fix] Fixed ifstream/ofstream to be able to open unicode paths.
2014-01-09 17:00:41 +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