diff options
author | ipknHama <ipknhama@gmail.com> | 2014-08-07 05:25:18 +0900 |
---|---|---|
committer | ipknHama <ipknhama@gmail.com> | 2014-08-07 05:25:18 +0900 |
commit | 1b83b78c8344b40355d9238d2fbeaf9a9b348ef9 (patch) | |
tree | 511883ce1342fb01e77e8bfec706b1817a2c9a99 /include/json.h | |
parent | e70380e003ae28822a6b903193c9a699cc02c405 (diff) | |
download | crow-1b83b78c8344b40355d9238d2fbeaf9a9b348ef9.tar.gz crow-1b83b78c8344b40355d9238d2fbeaf9a9b348ef9.zip |
spliting header implementation into cpp files, routing.cpp created
Diffstat (limited to 'include/json.h')
-rw-r--r-- | include/json.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/include/json.h b/include/json.h index b58a75e..bcfa24e 100644 --- a/include/json.h +++ b/include/json.h @@ -29,7 +29,7 @@ namespace crow namespace json { - void escape(const std::string& str, std::string& ret) + inline void escape(const std::string& str, std::string& ret) { ret.reserve(ret.size() + str.size()+str.size()/4); for(char c:str) @@ -63,7 +63,7 @@ namespace crow } } } - std::string escape(const std::string& str) + inline std::string escape(const std::string& str) { std::string ret; escape(str, ret); @@ -596,50 +596,47 @@ namespace crow namespace detail { } - bool operator == (const rvalue& l, const std::string& r) + inline bool operator == (const rvalue& l, const std::string& r) { return l.s() == r; } - bool operator == (const std::string& l, const rvalue& r) + inline bool operator == (const std::string& l, const rvalue& r) { return l == r.s(); } - bool operator != (const rvalue& l, const std::string& r) + inline bool operator != (const rvalue& l, const std::string& r) { return l.s() != r; } - bool operator != (const std::string& l, const rvalue& r) + inline bool operator != (const std::string& l, const rvalue& r) { return l != r.s(); } - bool operator == (const rvalue& l, double r) + inline bool operator == (const rvalue& l, double r) { return l.d() == r; } - bool operator == (double l, const rvalue& r) + inline bool operator == (double l, const rvalue& r) { return l == r.d(); } - bool operator != (const rvalue& l, double r) + inline bool operator != (const rvalue& l, double r) { return l.d() != r; } - bool operator != (double l, const rvalue& r) + inline bool operator != (double l, const rvalue& r) { return l != r.d(); } - //inline rvalue decode(const std::string& s) - //{ - //} inline rvalue load_nocopy_internal(char* data, size_t size) { //static const char* escaped = "\"\\/\b\f\n\r\t"; @@ -1298,13 +1295,13 @@ namespace crow friend std::string dump(const wvalue& v); }; - void dump_string(const std::string& str, std::string& out) + inline void dump_string(const std::string& str, std::string& out) { out.push_back('"'); escape(str, out); out.push_back('"'); } - void dump_internal(const wvalue& v, std::string& out) + inline void dump_internal(const wvalue& v, std::string& out) { switch(v.t_) { @@ -1362,7 +1359,7 @@ namespace crow } } - std::string dump(const wvalue& v) + inline std::string dump(const wvalue& v) { std::string ret; ret.reserve(v.estimate_length()); |