/usr/include/wibble/commandline/doc.h is in libwibble-dev 0.1.28-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #ifndef WIBBLE_COMMANDLINE_DOC_H
#define WIBBLE_COMMANDLINE_DOC_H
#include <wibble/commandline/parser.h>
#include <string>
#include <vector>
#include <ostream>
namespace wibble {
namespace commandline {
class HelpWriter;
class DocMaker
{
protected:
std::string m_app;
std::string m_ver;
public:
DocMaker(const std::string& app, const std::string& ver)
: m_app(app), m_ver(ver) {}
};
class Help : public DocMaker
{
protected:
void outputOptions(std::ostream& out, HelpWriter& writer, const Engine& cp);
public:
Help(const std::string& app, const std::string& ver)
: DocMaker(app, ver) {}
void outputVersion(std::ostream& out);
void outputHelp(std::ostream& out, const Engine& cp);
};
class Manpage : public DocMaker
{
public:
enum where { BEFORE, BEGINNING, END };
private:
struct Hook
{
std::string section;
where placement;
std::string text;
Hook(const std::string& section, where placement, const std::string& text)
: section(section), placement(placement), text(text) {}
};
int m_section;
std::string m_author;
std::vector<Hook> hooks;
std::string lastSection;
void outputParagraph(std::ostream& out, const std::string& str);
void outputOption(std::ostream& out, const Option* o);
void outputOptions(std::ostream& out, const Engine& p);
void runHooks(std::ostream& out, const std::string& section, where where);
void startSection(std::ostream& out, const std::string& name);
void endSection(std::ostream& out);
public:
Manpage(const std::string& app, const std::string& ver, int section, const std::string& author)
: DocMaker(app, ver), m_section(section), m_author(author) {}
void addHook(const std::string& section, where placement, const std::string& text)
{
hooks.push_back(Hook(section, placement, text));
}
void readHooks(const std::string& file);
void output(std::ostream& out, const Engine& cp);
};
}
}
// vim:set ts=4 sw=4:
#endif
|