diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-10-18 12:31:07 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-10-18 12:31:07 +0000 |
| commit | c8d34a46bee7bcc2f377dd1ba57f61b1b8108ffc (patch) | |
| tree | 564c707b7aa2703f5f509eb4db4f70c94b7e63fc /src/File.cc | |
| parent | 1a7064f6f67564ede3f31bb300caebbeb61c6f66 (diff) | |
2009-10-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced Util::slice() with split()
* src/AbstractCommand.cc
* src/CookieParser.cc
* src/File.cc
* src/HttpHeaderProcessor.cc
* src/HttpRequest.cc
* src/Metalink2RequestGroup.cc
* src/MetalinkParserController.cc
* src/Netrc.cc
* src/NsCookieParser.cc
* src/ParameterizedStringParser.cc
* src/ServerStatMan.cc
* src/UriListParser.cc
* src/Util.cc
* src/Util.h
* src/bittorrent_helper.cc
* test/UtilTest.cc
Diffstat (limited to 'src/File.cc')
| -rw-r--r-- | src/File.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/File.cc b/src/File.cc index bcd593a1..8957a954 100644 --- a/src/File.cc +++ b/src/File.cc @@ -39,7 +39,7 @@ #include <utime.h> #include <unistd.h> -#include <deque> +#include <vector> #include <cstring> #include <cstdio> @@ -105,8 +105,8 @@ bool File::mkdirs() { if(isDir()) { return false; } - std::deque<std::string> dirs; - Util::slice(dirs, name, '/'); + std::vector<std::string> dirs; + split(name, std::back_inserter(dirs), "/"); if(!dirs.size()) { return true; } @@ -115,8 +115,8 @@ bool File::mkdirs() { if(Util::startsWith(name, A2STR::SLASH_C)) { accDir = A2STR::SLASH_C; } - for(std::deque<std::string>::const_iterator itr = dirs.begin(); itr != dirs.end(); - ++itr, accDir += A2STR::SLASH_C) { + for(std::vector<std::string>::const_iterator itr = dirs.begin(); + itr != dirs.end(); ++itr, accDir += A2STR::SLASH_C) { accDir += *itr; if(File(accDir).isDir()) { continue; |
