YSTest: ReadingList.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

ReadingList.h
浏览该文件的文档.
1 /*
2 © 2012-2015 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef INC_YReader_ReadingList_h_
29 #define INC_YReader_ReadingList_h_ 1
30
31 #include "Shells.h"
32 #include YFM_YSLib_Service_AccessHistory
33
34 namespace YReader
35 {
36
42 class Bookmark
43 {
44 public:
49 using PositionType = size_t;
50
51 IO::Path Path;
53 PositionType Position;
54
55 Bookmark(const IO::Path& path, size_t pos)
56 : Path(path), Position(pos)
57 {}
58 DefDeCopyCtor(Bookmark)
59 DefDeMoveCtor(Bookmark)
60
61
62 explicit
63 operator ValueNode::Container() const;
64 };
65
66
71 inline PDefHOp(bool, ==, const Bookmark& x, const Bookmark& y)
72 ImplRet(x.Path == y.Path && x.Position == y.Position)
73
74
75
79 using BookmarkList = vector<Bookmark::PositionType>;
80
81
87 class ReadingList : private GAccessList<Bookmark>, private noncopyable,
88 private nonmovable
89 {
90 public:
95 using GAccessList<Bookmark>::ListType;
96
97 public:
102 DefDeCtor(ReadingList)
103
104
105 explicit
106 operator ValueNode::Container() const;
107
109
110 using GAccessList<Bookmark>::IsAtBegin;
111 using GAccessList<Bookmark>::IsAtEnd;
113
118 using GAccessList<Bookmark>::Clear;
119
124 using GAccessList<Bookmark>::DropSubsequent;
125
129 void
130 Insert(const IO::Path&, size_t);
131
133 using GAccessList<Bookmark>::Switch;
134 };
135
136 } // namespace YReader;
137
138 #endif
139
YSLib::IO::Path
路径。
Definition: YSLib/Service/FileSystem.h:217
YSLib::GAccessList
访问列表。
Definition: AccessHistory.hpp:44
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:157
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
YReader
Definition: About.h:34
YReader::Bookmark
书签。
Definition: ReadingList.h:43
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:167
platform::size_t
YB_ATTR_nodiscard YF_API size_t
Definition: FileIO.h:1345
YReader::Bookmark::Position
PositionType Position
Definition: ReadingList.h:53
YReader::Bookmark::Path
IO::Path Path
Definition: ReadingList.h:51
YReader::Bookmark::Bookmark
Bookmark(const IO::Path &path, size_t pos)
Definition: ReadingList.h:55
ystdex::bases::nonmovable
不可转移对象：禁止继承此类的对象调用默认原型的转移构造函数和转移赋值操作符。
Definition: base.h:90
ImplRet
#define ImplRet(...)
Definition: YBaseMacro.h:100
platform::containers::vector
std::vector< _type, _tAlloc > vector
Definition: Container.h:102
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
YSLib::path
YB_ATTR_nodiscard YF_API const char * path
Definition: Initialization.h:116
YReader::ReadingList
阅读记录。
Definition: ReadingList.h:89
YReader::Bookmark::PositionType
size_t PositionType
文件位置类型。
Definition: ReadingList.h:49
platform::KeyCodes::DS::Insert
@ Insert
Definition: Keys.h:261
YSLib::ValueNode::Container
ystdex::mapped_set< ValueNode, ystdex::less<>, MappedSetTraits, allocator_type > Container
Definition: ValueNode.h:201
Shells.h
Shell 框架逻辑。
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:162
ystdex::bases::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: base.h:50
YReader::PDefHOp
PDefHOp(bool,==, const Bookmark &x, const Bookmark &y) ImplRet(x.Path
判断书签是否相等。