7 #include "WalkerException.h"
11 size_t Article::countLinks() const
13 if(!analyzed_
&& links_
.empty()) {
14 throw WalkerException("Article not analyzed yet!");
20 Article::ArticleLinkConstIterator
Article::linkBegin() const
22 return links_
.cbegin();
25 Article::ArticleLinkConstIterator
Article::linkEnd() const
30 bool Article::addLink(link article
)
32 auto newTitle
= article
.lock()->title();
34 // check for duplicates using title
35 //! \todo Or rather compare pointers again?
37 std::none_of(links_
.cbegin(), links_
.cend(), [&newTitle
](const link x
) {
39 return p
== nullptr ? false : p
->title() == newTitle
;
43 links_
.push_back(article
);
50 void Article::analyzed(bool analyzed
)
55 bool Article::analyzed() const
60 void Article::marked(bool marked
)
65 bool Article::marked() const
69 } // namespace WikiWalker