Cerata
A library to generate structural hardware designs
cerata::vhdl::Block Struct Reference

A block of code. More...

#include <block.h>

Public Member Functions

 Block (int indent=0)
 Block constructor.
 
std::vector< size_t > GetAlignments () const
 Return the alignment for each line.
 
BlockReverse ()
 Return the block in reverse.
 
BlockAppendBlankLineIfNotEmpty ()
 Append a blank line if the block is not empty.
 
BlockSort (std::optional< char > c=std::nullopt)
 Sort the lines in the block. Supply a character to stop sorting per line after encountering the character. More...
 
std::string ToString () const
 Return this block as a single string.
 

Public Attributes

std::vector< Linelines
 Lines in the blocks.
 
int indent = 0
 Indenting level of the block.
 

Detailed Description

A block of code.

Definition at line 50 of file block.h.

Member Function Documentation

◆ Sort()

Block & cerata::vhdl::Block::Sort ( std::optional< char >  c = std::nullopt)

Sort the lines in the block. Supply a character to stop sorting per line after encountering the character.

Parameters
cThe character.
Returns
A reference to the block itself.

Definition at line 85 of file block.cc.


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