From 49cad23ac917ac905fea2b16c0a4d63652aca2d9 Mon Sep 17 00:00:00 2001 From: Jaeseung Ha Date: Sun, 9 Nov 2014 08:12:43 +0900 Subject: Fixes #32 by chaing types for operator overloading from int32_t to int, long --- amalgamate/crow_all.h | 61 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 6 deletions(-) (limited to 'amalgamate') diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h index 2294438..38a7e4f 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -569,6 +569,39 @@ namespace crow } + query_string(const query_string& qs) + : url_(qs.url_) + { + for(auto p:qs.key_value_pairs_) + { + key_value_pairs_.push_back((char*)(p-qs.url_.c_str()+url_.c_str())); + } + } + + query_string& operator = (const query_string& qs) + { + url_ = qs.url_; + key_value_pairs_.clear(); + for(auto p:qs.key_value_pairs_) + { + key_value_pairs_.push_back((char*)(p-qs.url_.c_str()+url_.c_str())); + } + return *this; + } + + query_string& operator = (query_string&& qs) + { + key_value_pairs_ = std::move(qs.key_value_pairs_); + char* old_data = (char*)qs.url_.c_str(); + url_ = std::move(qs.url_); + for(auto& p:key_value_pairs_) + { + p += (char*)url_.c_str() - old_data; + } + return *this; + } + + query_string(std::string url) : url_(std::move(url)) { @@ -1898,7 +1931,23 @@ namespace crow return *this; } - wvalue& operator = (uint16_t value) + wvalue& operator = (unsigned short value) + { + reset(); + t_ = type::Number; + d = (double)value; + return *this; + } + + wvalue& operator = (short value) + { + reset(); + t_ = type::Number; + d = (double)value; + return *this; + } + + wvalue& operator = (long long value) { reset(); t_ = type::Number; @@ -1906,7 +1955,7 @@ namespace crow return *this; } - wvalue& operator = (int16_t value) + wvalue& operator = (long value) { reset(); t_ = type::Number; @@ -1914,7 +1963,7 @@ namespace crow return *this; } - wvalue& operator = (uint32_t value) + wvalue& operator = (int value) { reset(); t_ = type::Number; @@ -1922,7 +1971,7 @@ namespace crow return *this; } - wvalue& operator = (int32_t value) + wvalue& operator = (unsigned long long value) { reset(); t_ = type::Number; @@ -1930,7 +1979,7 @@ namespace crow return *this; } - wvalue& operator = (uint64_t value) + wvalue& operator = (unsigned long value) { reset(); t_ = type::Number; @@ -1938,7 +1987,7 @@ namespace crow return *this; } - wvalue& operator = (int64_t value) + wvalue& operator = (unsigned int value) { reset(); t_ = type::Number; -- cgit v1.2.3-54-g00ecf