summaryrefslogtreecommitdiff
path: root/src/uri.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-04-30 00:29:14 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-04-30 00:29:14 +0900
commit55d00d047c2c029594eca35e4c43b114f1cdf759 (patch)
tree162e47fac5e59bc607d1e5f34cc6a60bd7ffa344 /src/uri.cc
parent871819af594f85ddc9b693b178ddeebb77ce12f4 (diff)
Added swap for UriStruct
Diffstat (limited to 'src/uri.cc')
-rw-r--r--src/uri.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/uri.cc b/src/uri.cc
index 475b7663..77d6028f 100644
--- a/src/uri.cc
+++ b/src/uri.cc
@@ -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