YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ReadingList.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2012 - 2013.
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 
33 YSL_BEGIN_NAMESPACE(YReader)
34 
35 
40 class Bookmark
41 {
42 public:
47  typedef size_t PositionType;
48 
51  PositionType Position;
52 
53  Bookmark(const IO::Path& path, size_t pos)
54  : Path(path), Position(pos)
55  {}
56  DefDeCopyCtor(Bookmark)
57  DefDeMoveCtor(Bookmark)
58 
60  explicit
61  operator ValueNode::Container() const;
62 };
63 
64 
69 inline bool
70 operator==(const Bookmark& x, const Bookmark& y)
71 {
72  return x.Path == y.Path && x.Position == y.Position;
73 }
74 
75 
80 typedef vector<Bookmark::PositionType> BookmarkList;
81 
82 
89 {
90 public:
94  typedef list<Bookmark> ListType;
95 
96 private:
104  ListType::iterator now_reading;
105 
106 public:
110  ReadingList();
113 
115  explicit
116  operator ValueNode::Container() const;
117 
122  pair<bool, bool>
123  CheckBoundary();
124 
128  PDefH(void, Clear, )
130 
135  void
136  DropSubsequent();
137 
141  void
142  Insert(const IO::Path&, size_t);
143 
152  Bookmark
153  Switch(bool);
154 };
155 
156 YSL_END_NAMESPACE(YReader)
157 
158 #endif
159