aboutsummaryrefslogtreecommitdiffstats
path: root/amalgamate
diff options
context:
space:
mode:
authorJaeseung Ha <ipknhama@gmail.com>2014-11-09 08:12:43 +0900
committerJaeseung Ha <ipknhama@gmail.com>2014-11-09 08:20:04 +0900
commit49cad23ac917ac905fea2b16c0a4d63652aca2d9 (patch)
tree1f2afa5f0d1823d3a9a26a593d3c9812eccf19d0 /amalgamate
parent11128435cd10d0c95bebdd513a42a8dcaacf8230 (diff)
downloadcrow-49cad23ac917ac905fea2b16c0a4d63652aca2d9.tar.gz
crow-49cad23ac917ac905fea2b16c0a4d63652aca2d9.zip
Fixes #32 by chaing types for operator overloading from int32_t to int, long
Diffstat (limited to 'amalgamate')
-rw-r--r--amalgamate/crow_all.h61
1 files changed, 55 insertions, 6 deletions
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;