From ef2935347099967cc7092fa7f472d91d51571468 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Feb 2009 00:06:16 +0000 Subject: Whoa, lots of updates. Md5 is more general, nids, cache, cachestore, and cachestorenids all support synchronizing now. Url is pretty much done. --- src/url.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/url.cpp') diff --git a/src/url.cpp b/src/url.cpp index 7cc4263..e4d2f55 100644 --- a/src/url.cpp +++ b/src/url.cpp @@ -235,3 +235,32 @@ void Bu::Url::clear() iPort.clear(); } +Bu::FString Bu::Url::getFullPath() const +{ + Bu::FString sBuf = sPath; + if( !lParam.isEmpty() ) + { + for( ParamList::const_iterator i = lParam.begin(); i; i++ ) + { + if( i == lParam.begin() ) + sBuf += "?"; + else + sBuf += "&"; + + sBuf += encode( (*i).sName ); + if( !(*i).sValue.isEmpty() ) + { + sBuf += "=" + encode( (*i).sValue ); + } + } + } + + return sBuf; +} + +Bu::FString Bu::Url::getUrl() const +{ + Bu::FString sBuf = sProtocol + "://" + sHost + getFullPath(); + return sBuf; +} + -- cgit v1.2.3