diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-03-07 12:05:50 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-03-07 12:05:50 +0000 |
| commit | fc0fa4203a0295e69f5101838dded603fc48b9e4 (patch) | |
| tree | fea885ef0bd8b2b526bab5c5420cdfa3c5a9fd1e /src/MetaFileUtil.h | |
| parent | 7578d5fb2299a7b818728c040bf91c4d076406db (diff) | |
2008-03-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use unsigned char for data store.
Diffstat (limited to 'src/MetaFileUtil.h')
| -rw-r--r-- | src/MetaFileUtil.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/MetaFileUtil.h b/src/MetaFileUtil.h index fdcae8c1..b29b948e 100644 --- a/src/MetaFileUtil.h +++ b/src/MetaFileUtil.h @@ -49,16 +49,22 @@ class MetaFileUtil { private: MetaFileUtil() {} - static MetaEntry* bdecodingR(const char** pp, const char* end); - static Dictionary* parseDictionaryTree(const char** pp, const char* end); - static List* parseListTree(const char** pp, const char* end); - static Data* decodeWord(const char** pp, const char* end); - static Data* decodeInt(const char** pp, const char* end); - static std::string decodeWordAsString(const char** pp, const char* end); + static MetaEntry* bdecodingR(const unsigned char** pp, const unsigned char* end); + static Dictionary* parseDictionaryTree(const unsigned char** pp, const unsigned char* end); + static List* parseListTree(const unsigned char** pp, const unsigned char* end); + static Data* decodeWord(const unsigned char** pp, const unsigned char* end); + static Data* decodeInt(const unsigned char** pp, const unsigned char* end); + static std::string decodeWordAsString(const unsigned char** pp, const unsigned char* end); public: static MetaEntry* parseMetaFile(const std::string& file); - static MetaEntry* bdecoding(const char* buf, int32_t len); + static MetaEntry* bdecoding(const unsigned char* buf, size_t len); + + static MetaEntry* bdecoding(const std::string& content) + { + return bdecoding(reinterpret_cast<const unsigned char*>(content.c_str()), + content.size()); + } }; } // namespace aria2 |
