mirror of https://github.com/aria2/aria2
2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use A2STR::SHARP_C and A2STR::EQUAL_C. * src/A2STR.cc * src/A2STR.h * src/OptionParser.cc (parse)pull/1/head
parent
35b219ddc8
commit
f2588a882b
|
@ -1,3 +1,10 @@
|
|||
2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Use A2STR::SHARP_C and A2STR::EQUAL_C.
|
||||
* src/A2STR.cc
|
||||
* src/A2STR.h
|
||||
* src/OptionParser.cc (parse)
|
||||
|
||||
2008-05-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Defined fake filename `[tracker.announce]' as static const std::string.
|
||||
|
|
|
@ -52,4 +52,6 @@ const std::string A2STR::DOT_C(".");
|
|||
|
||||
const std::string A2STR::COLON_C(":");
|
||||
|
||||
const std::string A2STR::EQUAL_C("=");
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
static const std::string DOT_C;
|
||||
|
||||
static const std::string COLON_C;
|
||||
|
||||
static const std::string EQUAL_C;
|
||||
};
|
||||
} // namespace aria2
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "Util.h"
|
||||
#include "OptionHandlerImpl.h"
|
||||
#include "Option.h"
|
||||
#include "A2STR.h"
|
||||
#include <istream>
|
||||
#include <utility>
|
||||
|
||||
|
@ -47,10 +48,10 @@ void OptionParser::parse(Option* option, std::istream& is)
|
|||
int32_t linenum = 0;
|
||||
while(getline(is, line)) {
|
||||
++linenum;
|
||||
if(Util::startsWith(line, "#")) {
|
||||
if(Util::startsWith(line, A2STR::SHARP_C)) {
|
||||
continue;
|
||||
}
|
||||
std::pair<std::string, std::string> nv = Util::split(line, "=");
|
||||
std::pair<std::string, std::string> nv = Util::split(line, A2STR::EQUAL_C);
|
||||
OptionHandlerHandle handler = getOptionHandlerByName(nv.first);
|
||||
handler->parse(option, nv.second);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue