8 #ifndef Sawyer_Document_BaseMarkup_H
9 #define Sawyer_Document_BaseMarkup_H
11 #include <Sawyer/DocumentMarkup.h>
12 #include <Sawyer/Sawyer.h>
19 std::string pageName_;
20 std::string chapterNumber_;
21 std::string chapterTitle_;
22 std::string versionStr_;
23 std::string versionDate_;
36 const std::string&
pageName()
const {
return pageName_; }
48 const std::string& chapterNumberOrDefault()
const;
60 const std::string& chapterTitleOrDefault()
const;
71 const std::string& versionStringOrDefault()
const;
80 const std::string&
versionDate()
const {
return versionDate_; }
82 const std::string& versionDateOrDefault()
const;
88 BaseMarkup& title(
const std::string &pageName,
const std::string &chapterNumber,
const std::string &chapterTitle);
93 BaseMarkup& version(
const std::string &versionString,
const std::string &versionDate);
96 virtual std::string operator()(
const std::string&) ;
99 virtual bool emit(
const std::string &doc) = 0;
102 static bool hasNonSpace(
const std::string&);
105 static std::string makeOneLine(
const std::string&);
108 static std::string leftJustify(
const std::string&,
size_t width);
111 static std::string escapeSingleQuoted(
const std::string&);
115 virtual std::string finalizeDocument(
const std::string &s) {
return s; }