implemented appendPage
This commit is contained in:
parent
36e73ecb0d
commit
12ce38327f
@ -29,6 +29,8 @@ class DokuWiki
|
||||
void putPage(const std::string &pageName, const std::string &content);
|
||||
void addPage(const std::string &pageName, const std::string &content);
|
||||
|
||||
void appendToPage(const std::string &pageName, const std::string &content);
|
||||
|
||||
private:
|
||||
class impl;
|
||||
std::unique_ptr<impl> pimpl;
|
||||
|
@ -52,3 +52,7 @@ void DokuWiki::addPage(const std::string &pageName, const std::string &content)
|
||||
pimpl->addPage(pageName, content);
|
||||
}
|
||||
|
||||
void DokuWiki::appendToPage(const std::string &pageName, const std::string &content)
|
||||
{
|
||||
pimpl->appendToPage(pageName, content);
|
||||
}
|
||||
|
@ -180,3 +180,13 @@ void DokuWiki::impl::addPage(const std::string &pageName, const std::string &con
|
||||
putPage(pageName, content);
|
||||
}
|
||||
|
||||
void DokuWiki::impl::appendToPage(const std::string &pageName, const std::string &content)
|
||||
{
|
||||
if (!executeCommand<bool>("dokuwiki.appendPage", { pageName, content },
|
||||
{{ "sum", xmlrpc_c::value_string("Added automatically") },
|
||||
{"minor", xmlrpc_c::value_boolean(false) }}))
|
||||
{
|
||||
throw std::runtime_error("failed to append to page");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,8 @@ class DokuWiki::impl
|
||||
void putPage(const std::string &pageName, const std::string &content);
|
||||
void addPage(const std::string &pageName, const std::string &content);
|
||||
|
||||
void appendToPage(const std::string &pageName, const std::string &content);
|
||||
|
||||
template <typename ReturnType>
|
||||
ReturnType executeCommand(const std::string &command,
|
||||
const std::list<std::string> ¶ms = {},
|
||||
|
Reference in New Issue
Block a user