YSTest: ReadingList.h 源文件

YSTest PreAlpha_b800_20170810 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
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
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
platform::KeyCodes::DS::Insert
Definition: Keys.h:260
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
NPL::x
const TermNode &term ynothrow const TermNode &term ynothrow const TermNode &term ynothrow TermNode &term const TermNode &term ValueNode &node const ValueNode &node const _type & x
Definition: SContext.h:94
YSLib::GAccessList
访问列表。
Definition: AccessHistory.hpp:43
platform::size_t
YF_API size_t
Definition: FileIO.h:1353
YReader::Bookmark::PositionType
size_t PositionType
文件位置类型。
Definition: ReadingList.h:49
YReader::Bookmark
书签。
Definition: ReadingList.h:42
Shells.h
Shell 框架逻辑。
YReader::ReadingList
阅读记录。
Definition: ReadingList.h:87
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:167
YSLib::ValueNode::Container
ystdex::mapped_set< ValueNode, ystdex::less<>> Container
Definition: ValueNode.h:62
DefDeCtor
#define DefDeCtor(_t)
简单通用成员函数定义。
Definition: YBaseMacro.h:157
YReader::Bookmark::Path
IO::Path Path
Definition: ReadingList.h:51
YReader
Definition: About.h:33
ystdex::nonmovable
Definition: base.h:81
YSLib::ValueNode
值类型节点。
Definition: ValueNode.h:58
YReader::Bookmark::Position
PositionType Position
Definition: ReadingList.h:53
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:162
ystdex::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: base.h:41
YReader::Bookmark::Bookmark
Bookmark(const IO::Path &path, size_t pos)
Definition: ReadingList.h:55
YSLib::IO::Path
路径。
Definition: YSLib/Service/FileSystem.h:214
YReader::PDefHOp
PDefHOp(bool,==, const Bookmark &x, const Bookmark &y) ImplRet(x.Path
判断书签是否相等。
YSLib::path
YF_API const char * path
Definition: Initialization.h:77