Panini 1.4.0
Header-only library for generating C++, written in C++17
panini::CommentLine Class Reference

Command for outputting a single-line comment. More...

#include <CommentLine.hpp>

Inheritance diagram for panini::CommentLine:
panini::Command

Public Member Functions

 CommentLine (const std::string &comment)
 
 CommentLine (std::string &&comment) noexcept
 
void Visit (Writer &writer) override
 
- Public Member Functions inherited from panini::Command
virtual ~Command ()=default
 

Detailed Description

Command for outputting a single-line comment.

Comment lines start with "// " in the output. Empty lines will be output as well.

Example:

writer << CommentLine("I can't believe this was generated!");
CommentLine(const std::string &comment)
Definition: CommentLine.hpp:60

Output:

// I can't believe this was generated!

Constructor & Destructor Documentation

◆ CommentLine() [1/2]

panini::CommentLine::CommentLine ( const std::string &  comment)
inlineexplicit

Construct a CommentLine with a comment that is copied to the instance.

◆ CommentLine() [2/2]

panini::CommentLine::CommentLine ( std::string &&  comment)
inlineexplicitnoexcept

Construct a CommentLine with a comment that is moved into the instance.

Member Function Documentation

◆ Visit()

void panini::CommentLine::Visit ( Writer writer)
inlineoverridevirtual

Accepts a Writer to write chunks to the output.

Implements panini::Command.


The documentation for this class was generated from the following file: