* Added FileListIterator to the API, which allows the client to

iterate through FileList as if it consisted of directories.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@831 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-12-25 10:54:31 +00:00
parent c65b6aa9ff
commit c453565e8f
5 changed files with 91 additions and 137 deletions
+24
View File
@@ -91,6 +91,28 @@ advance_bidirectional(_InputIter __first, _InputIter __middle1, _InputIter __las
return std::make_pair(__middle1, __middle2);
}
template <typename _InputIter, typename _Distance>
_InputIter
advance_forward(_InputIter __first, _InputIter __last, _Distance __distance) {
while (__first != __last && __distance != 0) {
__first++;
__distance--;
}
return __first;
}
template <typename _InputIter, typename _Distance>
_InputIter
advance_backward(_InputIter __first, _InputIter __last, _Distance __distance) {
while (__first != __last && __distance != 0) {
__first--;
__distance--;
}
return __first;
}
template <typename _Value>
struct compare_base : public std::binary_function<_Value, _Value, bool> {
bool operator () (const _Value& complete, const _Value& base) const {
@@ -133,6 +155,8 @@ make_base(_InputIter __first, _InputIter __last) {
return __base;
}
}
#endif