Spicy
Public Member Functions | List of all members
hilti::DocString Class Reference

#include <doc-string.h>

Public Member Functions

const auto & summary () const
 
const auto & text () const
 
void addSummary (const std::string &line)
 
void addText (const std::string &line)
 
void render (std::ostream &out) const
 
void render (printer::Stream &out) const
 
 operator bool () const
 

Detailed Description

Represents an AST node's documentation string.

Member Function Documentation

◆ addSummary()

void hilti::DocString::addSummary ( const std::string &  line)
inline

Appends a line of summary text to the documentation.

Parameters
lineline to add, with optional comment prefix (which will be removed)

◆ addText()

void hilti::DocString::addText ( const std::string &  line)
inline

Appends a line of documentation text to the documentation.

Parameters
lineline to add, with optional comment prefix (which will be removed)

◆ operator bool()

hilti::DocString::operator bool ( ) const
inlineexplicit

Returns true if any summary or documentation text has been added.

◆ render() [1/2]

void DocString::render ( std::ostream &  out) const

Renders the comment back into a multi-line string. This is primarily for debugging.

◆ render() [2/2]

void DocString::render ( printer::Stream out) const

Renders the comment back into a code representation through our code printer.

◆ summary()

const auto& hilti::DocString::summary ( ) const
inline

Returns all lines of summary text added so far. The returned lines will have their comment prefixes stripped.

◆ text()

const auto& hilti::DocString::text ( ) const
inline

Returns all lines of documentation text added so far. The returned lines will have their comment prefixes stripped.


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