Commit Graph

51 Commits

Author SHA1 Message Date
The-EDev
5f18548369
Fixed problem where GCC < 6 wouldn't compile Crow 2022-03-30 15:50:11 +03:00
The-EDev
9a7677bf1a
Applied changes from review
Also moved builtin_expect to utility.h (for use in sanitizer function)
2022-02-11 00:56:30 +03:00
Farook Al-Sammarraie
ab50fb3134
Merge branch 'master' into parser_optimization 2022-02-11 00:46:19 +03:00
Vhuynh25
07a2422c63
changed output to null and changed warning message
also changed from <cmath> to <math.h>
2022-02-08 15:45:49 -08:00
Vhuynh25
c44fec82bf
added space to match clang format 2022-02-06 11:58:41 -08:00
The-EDev
175b004c26
code formatting (also disabled formatting where not applicable) 2022-02-06 22:29:46 +03:00
The-EDev
75b100527f
Merge branch 'refs/heads/master' into parser_optimization 2022-02-05 18:35:01 +03:00
The-EDev
4cdde73388
Optimized HTTP parser
Also (likely) fixed problem with streaming without keeping connection
alive
Also fixed problem with multipart hanging on request
Also updated TODO entries to indicate Writer
2022-02-05 18:15:19 +03:00
Vhuynh25
781a40bee1
fixed clang format 2022-02-03 09:07:54 -08:00
Vien Huynh
c21ae7ea3e change NaN output warning message 2022-02-01 16:40:07 -05:00
Vien Huynh
a134e2b9ff fixed NaN handling errors 2022-02-01 15:31:09 -05:00
Vien Huynh
9af906dc21 fixed JSON outputting NaN and infinite values 2022-01-30 23:43:30 -05:00
Thomas Neumann
3569c93984 defend against excessive recursion in json::load
Passing a deeply nested JSON structure to json::load leads to a crash
due to stack overflow. We handle this now gracefully by limiting the
maximum nesting depth to 10,000.

Test case:

https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_structure_100000_opening_arrays.json
2022-01-25 08:48:36 +01:00
Farook Al-Sammarraie
790e34cea8
Merge branch 'master' into mustache_lambdas 2021-12-17 09:08:24 +03:00
Mosolov Sergey
d59cda5677 Fixes issue 302
https://github.com/CrowCpp/Crow/issues/302
Escape only the invisible characters from 0 to 31 inclusive
Motivation: do not escape UTF8 encoding bytes
2021-12-17 08:47:00 +04:00
The-EDev
f6fd7dc85d
formatting, missing newline fixed 2021-12-11 02:38:30 +03:00
The-EDev
a1a4169d92
merge branch master 2021-12-10 05:12:24 +03:00
The-EDev
94a2f942bc
changed comment style back to the original (doxygen did not work with the new style) 2021-12-03 06:39:23 +03:00
The-EDev
03e59aa446
improved bracing rules, commented out clang-format 14 rule 2021-11-27 15:28:50 +03:00
The-EDev
7f4b7c8ff9
created new rules, used bot to enforce rules in PRs 2021-11-25 14:45:38 +03:00
Farook
eefe8f62bf made it so that workarounds would only run if the user is on an apple machine 2021-10-22 14:27:10 +03:00
The-EDev
efd55597f0 changed json and app code (relating to blueprints and initializer list)
also snuck in some guide updates
2021-10-10 14:42:36 +03:00
The-EDev
f5338260bb several changes:
added json list in a similar fashion to json object
renamed object_type to object
updated readme, index.html, and json.md to include objects and lists
updated examples to be slightly cleaner and include lists
replaced instances of json object (std::map and such) with the short version (object)
accurate floating point number dumping (`6.0` instead of `6`) while taking 1/30th of the time (29 microseconds saved)
added json list testing
snuck in utf-8 middleware warning fix
snuck in twitter card style for crowcpp.org site (makes social media cards look way better with a large image)
2021-08-20 03:57:21 +03:00
Lucas David
1e52b0182d ~ Corrected code as mentionned in review comments. 2021-08-11 22:25:58 +02:00
Lucas David
8f10f92627
Merge branch 'master' into feature-#189 2021-08-11 21:57:54 +02:00
Lucas David
df41cbec49 ~ Replaced foreach character type unsigned char by auto to resolve issue #195. 2021-08-11 15:43:40 +02:00
Lucas David
235f2b9ef4 + Added (implicit) constructors for json "supported" types.
+ added corresponding tests.
+ Added json-map examples.
2021-08-09 14:32:51 +02:00
Lucas David
762af68306 + Added object constructor and assignment for json::wvalue and unit tests.
+ json::wvalue::wvalue(std::initializer_list<std::pair<std::string const, json::wvalue>>
  + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue> const&)
  + json::wvalue::wvalue(std::[unordered_]map<std::string, json::wvalue>&&)
  + json::wvalue::operator=(std::initializer_list<std::pair<std::string const, json::wvalue>>)
  + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue> const&)
  + json::wvalue::operator=(std::[unordered_]map<std::string, json::wvalue>&&)
2021-08-09 14:32:51 +02:00
The-EDev
6df5c94fd9 basic lambda support added (no expansion / blocks) 2021-07-03 23:28:52 +03:00
Maxime BELUGUET
811ef62c6f Fix constness on json dump method #133 2021-05-18 18:10:39 +02:00
The-EDev
0e9b615c2b fixed typos 2021-05-13 13:30:48 +03:00
The-EDev
f39b9ddce7 Quality of life improvements
Added pop() method to query_string, same as get(), but removes the item from the querystring
Added std::string() operator to json::rvalue (allows std::string(json["abc"]), which returns any value that isn't a container to string)
Added lo() method to json::rvalue, returns a vector of json::rvalue containing whatever a json object or list has (difference being a list has no keys)
Added keys() method to json::rvalue, returns a vector of std::string containing the keys of a json object
Made json::wvalue use either std::map or std::unordered_map instead of just std::unordered_map
Added copy constructor to json::wvalue
Added size() method to json::wvalue, returns 1 or the size of the json list.
Added constructor to create json::wvalue from std::vector
Added keys() method to query_string
Documented query_string and improved json doc
Made tests and examples for all the additions
2021-05-12 15:45:55 +03:00
Sfinktah Bungholio
6597feb3a8 converted all (int) to static_cast 2021-02-21 11:14:30 +11:00
The-EDev
33f1206571 made json a returnable type and removed json specific code 2021-01-05 17:49:10 +03:00
The-EDev
ed2a7ae0e0 Added returnables class and applied to multipart
did not apply to JSON because it caused a linker error
also changed the version of boost required in CMAKE
2020-12-18 12:28:37 +03:00
The-EDev
2422f55855 documented as much as possible relating to the API reference 2020-11-19 01:13:57 +03:00
The-EDev
cdd613935d removed char <=0 comparison
(not sure why it invoked an error in ARM now)
2020-10-20 12:17:00 +03:00
ipknHama
05d02fea6e Remove printf warning for lld, llu 2017-12-25 16:26:30 +09:00
Jaeseung Ha
6876a08e61
Merge pull request #260 from erikaldsund/fix_rvalue_copy_ctor_bug
Fixed bug in json::rvalue copy constructor
2017-12-25 15:31:11 +09:00
Jaeseung Ha
943dcba507
Merge pull request #259 from erikaldsund/fix_r_string_inconsistency
Fixed bug in r_string
2017-12-25 15:30:32 +09:00
Erik Åldstedt Sund
3c45393b2d Don't call copy_l before all other members are set
This lead to undefined behaviour during copy.
2017-10-30 20:51:44 +01:00
Erik Åldstedt Sund
29824c84ed Fixed bug in r_string: end of string pointer was not updated in the force member function
This could lead to undefined behaviour in the std::string conversion
operator, when using the iterator interface (begin() / end()), and the size()
member function.
2017-10-30 20:50:17 +01:00
Erik Åldstedt Sund
ecbbd0ebf2 Fixed ostream operator for big integers 2017-10-30 20:47:48 +01:00
Erik Åldstedt Sund
4fe7dd171a Handle big integers in json::wvalue
Handled by adding an enum num_type in both rvalue and wvalue (to separate
between signed/unsigned ints, and floating point values) and a union for
the number value in wvalue.
2017-10-30 20:47:48 +01:00
ipknHama
9c26e1ebde Simplify json.keys() 2017-09-18 01:21:18 +09:00
Jaeseung Ha
d8c4a67176 Merge branch 'master' into master 2017-09-17 19:17:54 +09:00
Jaeseung Ha
c32aae4b5f Merge pull request #183 from philave/vs2015-compilation-fix
MS VS2015 compilation fix.
2017-09-17 18:29:52 +09:00
jaewoo.seo
777852c97d wvalue (json) support vector<wvalue> 2017-05-12 11:43:27 +09:00
Philip
366e7c7e4b MS VS2015 compilation fix. It’s better to use native Win32 (strncpy_s, sprintf_s) to avoid compilation errors when building by MS C++. 2016-10-21 18:22:24 +03:00
Taylor King
26c4d5ddef implement .keys() 2016-10-10 06:10:01 -04:00