improve documentation

This commit is contained in:
pantor
2019-09-08 17:06:09 +02:00
parent d25937a85b
commit 466caeab63
12 changed files with 38 additions and 7 deletions
+6
View File
@@ -14,6 +14,9 @@ enum class ElementNotation {
Pointer
};
/*!
* \brief Class for lexer configuration.
*/
struct LexerConfig {
std::string statement_open {"{%"};
std::string statement_close {"%}"};
@@ -44,6 +47,9 @@ struct LexerConfig {
}
};
/*!
* \brief Class for parser configuration.
*/
struct ParserConfig {
ElementNotation notation {ElementNotation::Dot};
};
+3
View File
@@ -22,6 +22,9 @@ namespace inja {
using namespace nlohmann;
/*!
* \brief Class for changing the configuration.
*/
class Environment {
class Impl {
public:
+3
View File
@@ -12,6 +12,9 @@ using namespace nlohmann;
using Arguments = std::vector<const json*>;
using CallbackFunction = std::function<json(Arguments& args)>;
/*!
* \brief Class for builtin functions and user-defined callbacks.
*/
class FunctionStorage {
public:
void add_builtin(nonstd::string_view name, unsigned int num_args, Bytecode::Op op) {
+3
View File
@@ -11,6 +11,9 @@
namespace inja {
/*!
* \brief Class for lexing an inja Template.
*/
class Lexer {
enum class State {
Text,
+3
View File
@@ -58,6 +58,9 @@ class ParserStatic {
FunctionStorage functions;
};
/*!
* \brief Class for parsing an inja Template.
*/
class Parser {
public:
explicit Parser(const ParserConfig& parser_config, const LexerConfig& lexer_config, TemplateStorage& included_templates): m_config(parser_config), m_lexer(lexer_config), m_included_templates(included_templates), m_static(ParserStatic::get_instance()) { }
+3
View File
@@ -24,6 +24,9 @@ inline nonstd::string_view convert_dot_to_json_pointer(nonstd::string_view dot,
return nonstd::string_view(out.data(), out.size());
}
/*!
* \brief Class for rendering a Template with data.
*/
class Renderer {
std::vector<const json*>& get_args(const Bytecode& bc) {
m_tmp_args.clear();
+3
View File
@@ -9,6 +9,9 @@
namespace inja {
/*!
* \brief The main inja Template.
*/
struct Template {
std::vector<Bytecode> bytecodes;
std::string content;
+3
View File
@@ -6,6 +6,9 @@
namespace inja {
/*!
* \brief Helper-class for the inja Parser.
*/
struct Token {
enum class Kind {
Text,