forked from KDE/okteta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbookmarksconstiterator.hpp
84 lines (66 loc) · 3 KB
/
bookmarksconstiterator.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
This file is part of the Okteta Core library, made within the KDE community.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <[email protected]>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef OKTETA_BOOKMARKSCONSTITERATOR_HPP
#define OKTETA_BOOKMARKSCONSTITERATOR_HPP
// lib
#include "bookmarksconstiteratoradapter.hpp"
#include "oktetacore_export.hpp"
// Qt
#include <QExplicitlySharedDataPointer>
namespace Okteta {
class OKTETACORE_EXPORT BookmarksConstIterator
{
public:
explicit BookmarksConstIterator(BookmarksConstIteratorAdapter* adapter = nullptr);
BookmarksConstIterator(const BookmarksConstIterator&) = default;
~BookmarksConstIterator() = default;
BookmarksConstIterator& operator=(const BookmarksConstIterator&) = default;
public:
[[nodiscard]]
bool hasList() const;
public:
[[nodiscard]]
bool hasNext() const;
[[nodiscard]]
bool hasPrevious() const;
[[nodiscard]]
const Okteta::Bookmark& peekNext() const;
[[nodiscard]]
const Okteta::Bookmark& peekPrevious() const;
public:
[[nodiscard]]
bool findNext(const Okteta::Bookmark& bookmark);
[[nodiscard]]
bool findPrevious(const Okteta::Bookmark& bookmark);
[[nodiscard]]
bool findNextFrom(unsigned int offset);
[[nodiscard]]
bool findPreviousFrom(unsigned int offset);
[[nodiscard]]
const Okteta::Bookmark& next();
[[nodiscard]]
const Okteta::Bookmark& previous();
void toBack();
void toFront();
private:
QExplicitlySharedDataPointer<BookmarksConstIteratorAdapter> mAdapter;
};
inline BookmarksConstIterator::BookmarksConstIterator(BookmarksConstIteratorAdapter* adapter) : mAdapter(adapter) {}
inline bool BookmarksConstIterator::hasList() const { return mAdapter; }
inline bool BookmarksConstIterator::hasNext() const { return mAdapter->hasNext(); }
inline bool BookmarksConstIterator::hasPrevious() const { return mAdapter->hasPrevious(); }
inline const Okteta::Bookmark& BookmarksConstIterator::peekNext() const { return mAdapter->peekNext(); }
inline const Okteta::Bookmark& BookmarksConstIterator::peekPrevious() const { return mAdapter->peekPrevious(); }
inline bool BookmarksConstIterator::findNext(const Okteta::Bookmark& bookmark) { return mAdapter->findNext(bookmark); }
inline bool BookmarksConstIterator::findPrevious(const Okteta::Bookmark& bookmark) { return mAdapter->findPrevious(bookmark); }
inline bool BookmarksConstIterator::findNextFrom(unsigned int offset) { return mAdapter->findNextFrom(offset); }
inline bool BookmarksConstIterator::findPreviousFrom(unsigned int offset) { return mAdapter->findPreviousFrom(offset); }
inline const Okteta::Bookmark& BookmarksConstIterator::next() { return mAdapter->next(); }
inline const Okteta::Bookmark& BookmarksConstIterator::previous() { return mAdapter->previous(); }
inline void BookmarksConstIterator::toBack() { mAdapter->toBack(); }
inline void BookmarksConstIterator::toFront() { mAdapter->toFront(); }
}
#endif