YSTest: ReadingList.h 源文件

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
ReadingList.h
浏览该文件的文档.
1 /*
2 © 2012-2013 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 bool
72 operator==(const Bookmark& x, const Bookmark& y)
73 {
74 return x.Path == y.Path && x.Position == y.Position;
75 }
76
77
82 using BookmarkList = vector<Bookmark::PositionType>;
83
84
90 class ReadingList : private GAccessList<Bookmark>, private noncopyable
91 {
92 public:
97 using GAccessList<Bookmark>::ListType;
98
99 public:
104 DefDeCtor(ReadingList)
105 DefDelMoveCtor(ReadingList)
106
107
108 explicit
109 operator ValueNode::Container() const;
110
111 // !\since build 404
112 using GAccessList<Bookmark>::IsAtBegin;
113 using GAccessList<Bookmark>::IsAtEnd;
114
119 using GAccessList<Bookmark>::Clear;
120
125 using GAccessList<Bookmark>::DropSubsequent;
126
130 void
131 Insert(const IO::Path&, size_t);
132
142 using GAccessList<Bookmark>::Switch;
143 };
144
145 } // namespace YReader;
146
147 #endif
148
YReader::Bookmark::Path
IO::Path Path
Definition: ReadingList.h:51
YSLib::ValueNode::Container
set< ValueNode > Container
Definition: ValueNode.h:48
YReader::Bookmark::Position
PositionType Position
Definition: ReadingList.h:53
DefDeCtor
#define DefDeCtor(_t)
Definition: YBaseMacro.h:131
DefDeCopyCtor
#define DefDeCopyCtor(_t)
Definition: YBaseMacro.h:136
YReader::Bookmark::PositionType
size_t PositionType
文件位置类型。
Definition: ReadingList.h:49
YSLib::Drawing::size_t
size_t
Definition: ygdi.h:352
ystdex::noncopyable
不可复制对象：禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
Definition: utility.hpp:75
DefDeMoveCtor
#define DefDeMoveCtor(_t)
Definition: YBaseMacro.h:141
YReader::Bookmark
书签。
Definition: ReadingList.h:42
YSLib::IO::Path
路径。
Definition: YSLib/Service/FileSystem.h:75
YSLib::ValueNode
值类型节点。
Definition: ValueNode.h:45
YReader::BookmarkList
vector< Bookmark::PositionType > BookmarkList
书签列表类型。
Definition: ReadingList.h:82
Shells.h
Shell 框架逻辑。
YReader::ReadingList
阅读记录。
Definition: ReadingList.h:90
YSLib::GAccessList
访问列表。
Definition: AccessHistory.hpp:43
DefDelMoveCtor
#define DefDelMoveCtor(_t)
Definition: YBaseMacro.h:143
YReader::Bookmark::Bookmark
Bookmark(const IO::Path &path, size_t pos)
Definition: ReadingList.h:55