diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-10-14 18:05:34 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-10-14 18:05:34 +0900 |
| commit | c904aa50fedd354937cb1dc29044712404c0c785 (patch) | |
| tree | 934c3194f9b5ca733945edd9c8c737dec35040c5 /src/uri.cc | |
| parent | eebc704b1933e5e43ff38cd37adb48d3daef1aad (diff) | |
Use uri_split instead of uri::parse where appropriate
Diffstat (limited to 'src/uri.cc')
| -rw-r--r-- | src/uri.cc | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -36,7 +36,6 @@ #include "A2STR.h" #include "FeatureConfig.h" #include "util.h" -#include "uri_split.h" namespace aria2 { @@ -167,6 +166,16 @@ bool parse(UriStruct& result, const std::string& uri) } } +std::string getFieldString(const uri_split_result& res, int field, + const char* base) +{ + if(res.field_set & (1 << field)) { + return std::string(base + res.fields[field].off, res.fields[field].len); + } else { + return ""; + } +} + std::string construct(const UriStruct& us) { std::string res; |
