Some more refactoring of the documentation feature

This commit is contained in:
Alexander Bock
2017-05-11 13:56:06 -04:00
parent 1d024dfff3
commit d597750398
20 changed files with 388 additions and 1022 deletions

View File

@@ -27,6 +27,8 @@
#include <openspace/documentation/documentation.h>
#include <openspace/util/documented.h>
#include <ghoul/designpattern/singleton.h>
#include <ghoul/misc/exception.h>
@@ -38,7 +40,9 @@ namespace documentation {
* produced in the application an write them out as a documentation file for human
* consumption.
*/
class DocumentationEngine : public ghoul::Singleton<DocumentationEngine> {
class DocumentationEngine : public ghoul::Singleton<DocumentationEngine>
, public Documented
{
public:
/**
* This exception is thrown by the addDocumentation method if a provided Documentation
@@ -57,16 +61,7 @@ public:
Documentation documentation;
};
/**
* Write the collected Documentation%s to disk at the \p filename in the specified
* \p type. A new file is created and silently overwritten in the location that
* \p filename is pointed to.
* \param filename The file that is to be created containing all the Documentation
* information.
* \param type The type of documentation that is written. Currently allowed values are
* \c text and \c html
*/
void writeDocumentation(const std::string& filename, const std::string& type);
DocumentationEngine();
/**
* Adds the \p documentation to the list of Documentation%s that are written to a
@@ -90,6 +85,8 @@ public:
static DocumentationEngine& ref();
private:
std::string generateJson() const override;
/// The list of all Documentation%s that are stored by the DocumentationEngine
std::vector<Documentation> _documentations;