YSTest: ReadingList.cpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

ReadingList.cpp
浏览该文件的文档.
1 /*
2 © 2012-2014, 2017, 2019 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 #include "ReadingList.h"
29
30 namespace YReader
31 {
32
33 Bookmark::operator ValueNode::Container() const
34 {
35 return {MakeNode("Path", string(Path)),
36 StringifyToNode("Position", Position)};
37 }
38
39
40 ReadingList::operator ValueNode::Container() const
41 {
42 ValueNode::Container con;
43
44 for(const auto& bm : GetList())
45 con.insert(MakeNode("bm" + MakeIndex(con.size()),
46 ValueNode::Container(bm)));
47 return con;
48 }
49
50 void
51 ReadingList::Insert(const IO::Path& pth, size_t pos)
52 {
53 emplace(pth, pos);
54 }
55
56 } // namespace YReader;
57
YSLib::IO::Path
路径。
Definition: YSLib/Service/FileSystem.h:217
Path
IO::Path Path
Definition: Initialization.cpp:116
YReader
Definition: About.h:34
ystdex::mapped_set::insert
std::pair< iterator, bool > insert(const value_type &x)
Definition: set.hpp:528
YSLib::MakeIndex
YB_ATTR_nodiscard YF_API YB_PURE string MakeIndex(size_t)
转换节点大小为新的节点索引值。
Definition: ValueNode.cpp:209
YSLib::StringifyToNode
YB_ATTR_nodiscard YB_PURE ValueNode StringifyToNode(_tString &&str, _tParams &&... args)
取指定名称和转换为字符串的值类型节点。
Definition: ValueNode.h:1341
ReadingList.h
阅读列表。
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
YSLib::MakeNode
YB_ATTR_nodiscard YB_PURE ValueNode MakeNode(_tString &&str, _tParams &&... args)
传递指定名称和退化值参数构造值类型节点。
Definition: ValueNode.h:1317