diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-04-30 00:29:14 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-04-30 00:29:14 +0900 |
| commit | 55d00d047c2c029594eca35e4c43b114f1cdf759 (patch) | |
| tree | 162e47fac5e59bc607d1e5f34cc6a60bd7ffa344 /src/uri.cc | |
| parent | 871819af594f85ddc9b693b178ddeebb77ce12f4 (diff) | |
Added swap for UriStruct
Diffstat (limited to 'src/uri.cc')
| -rw-r--r-- | src/uri.cc | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -77,6 +77,28 @@ UriStruct& UriStruct::operator=(const UriStruct& c) return *this; } +void UriStruct::swap(UriStruct& other) +{ + using std::swap; + if(this != &other) { + swap(protocol, other.protocol); + swap(host, other.host); + swap(port, other.port); + swap(dir, other.dir); + swap(file, other.file); + swap(query, other.query); + swap(username, other.username); + swap(password, other.password); + swap(hasPassword, other.hasPassword); + swap(ipv6LiteralAddress, other.ipv6LiteralAddress); + } +} + +void swap(UriStruct& lhs, UriStruct& rhs) +{ + lhs.swap(rhs); +} + bool parse(UriStruct& result, const std::string& uri) { // http://user:password@aria2.sourceforge.net:80/dir/file?query#fragment |
