2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Return const reference.
	* src/DownloadHandlerConstants.cc
	* src/DownloadHandlerConstants.h
	(getMetalinkExtensions)
	(getMetalinkContentTypes)
	(getBtExtensions)
	(getBtContentTypes)
pull/1/head
Tatsuhiro Tsujikawa 2008-05-18 11:53:22 +00:00
parent 7235f2657f
commit e59f4f2fe3
3 changed files with 34 additions and 16 deletions

View File

@ -1,3 +1,13 @@
2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Return const reference.
* src/DownloadHandlerConstants.cc
* src/DownloadHandlerConstants.h
(getMetalinkExtensions)
(getMetalinkContentTypes)
(getBtExtensions)
(getBtContentTypes)
2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HttpHeader.cc (get): Rewritten.

View File

@ -49,28 +49,36 @@ const char* DownloadHandlerConstants::BT_CONTENT_TYPES[] = {
"application/x-bittorrent"
};
std::deque<std::string> DownloadHandlerConstants::getMetalinkExtensions()
const std::deque<std::string>& DownloadHandlerConstants::getMetalinkExtensions()
{
return std::deque<std::string>(&METALINK_EXTENSIONS[0],
&METALINK_EXTENSIONS[arrayLength(METALINK_EXTENSIONS)]);
static const std::deque<std::string> l
(&METALINK_EXTENSIONS[0],
&METALINK_EXTENSIONS[arrayLength(METALINK_EXTENSIONS)]);
return l;
}
std::deque<std::string> DownloadHandlerConstants::getMetalinkContentTypes()
const std::deque<std::string>& DownloadHandlerConstants::getMetalinkContentTypes()
{
return std::deque<std::string>(&METALINK_CONTENT_TYPES[0],
&METALINK_CONTENT_TYPES[arrayLength(METALINK_CONTENT_TYPES)]);
static const std::deque<std::string> l
(&METALINK_CONTENT_TYPES[0],
&METALINK_CONTENT_TYPES[arrayLength(METALINK_CONTENT_TYPES)]);
return l;
}
std::deque<std::string> DownloadHandlerConstants::getBtExtensions()
const std::deque<std::string>& DownloadHandlerConstants::getBtExtensions()
{
return std::deque<std::string>(&BT_EXTENSIONS[0],
&BT_EXTENSIONS[arrayLength(BT_EXTENSIONS)]);
static const std::deque<std::string> l
(&BT_EXTENSIONS[0],
&BT_EXTENSIONS[arrayLength(BT_EXTENSIONS)]);
return l;
}
std::deque<std::string> DownloadHandlerConstants::getBtContentTypes()
const std::deque<std::string>& DownloadHandlerConstants::getBtContentTypes()
{
return std::deque<std::string>(&BT_CONTENT_TYPES[0],
&BT_CONTENT_TYPES[arrayLength(BT_CONTENT_TYPES)]);
static const std::deque<std::string> l
(&BT_CONTENT_TYPES[0],
&BT_CONTENT_TYPES[arrayLength(BT_CONTENT_TYPES)]);
return l;
}
} // namespace aria2

View File

@ -46,19 +46,19 @@ class DownloadHandlerConstants
public:
static const char* METALINK_EXTENSIONS[];
static std::deque<std::string> getMetalinkExtensions();
static const std::deque<std::string>& getMetalinkExtensions();
static const char* METALINK_CONTENT_TYPES[];
static std::deque<std::string> getMetalinkContentTypes();
static const std::deque<std::string>& getMetalinkContentTypes();
static const char* BT_EXTENSIONS[];
static std::deque<std::string> getBtExtensions();
static const std::deque<std::string>& getBtExtensions();
static const char* BT_CONTENT_TYPES[];
static std::deque<std::string> getBtContentTypes();
static const std::deque<std::string>& getBtContentTypes();
};
} // namespace aria2