diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-12 14:08:43 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-05-12 14:08:43 +0000 |
| commit | 7ea0e831d4e386119147a9f6e50d3dd06366031c (patch) | |
| tree | e87886f669664562826d4a5176e72ff301523512 /src/a2functional.h | |
| parent | fac64b9e0716c7a96bfc6f85a48ec37430eec661 (diff) | |
2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Accept-Features handling.
* src/HttpRequestCommand.cc (createHttpRequest)
* src/a2functional.h
Diffstat (limited to 'src/a2functional.h')
| -rw-r--r-- | src/a2functional.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/a2functional.h b/src/a2functional.h index a2fa0b26..99a55268 100644 --- a/src/a2functional.h +++ b/src/a2functional.h @@ -159,6 +159,23 @@ public: } }; +template<typename T> +class Append { +private: + T& _to; + T _delim; +public: + template<typename S> + Append(T& to, const S& delim):_to(to), _delim(delim) {} + + template<typename S> + void operator()(const S& s) { + _to += s+_delim; + } +}; + +typedef Append<std::string> StringAppend; + } // namespace aria2 #endif // _D_A2_FUNCTIONAL_H_ |
