Essentia  2.1-beta5-dev
AsciiBox Class Reference

#include <asciidag.h>

Public Member Functions

 AsciiBox (const std::vector< std::string > &network, int x, int y)
bool borderContains (int x, int y) const

Static Public Member Functions

static bool isBox (const std::vector< std::string > &network, int x, int y)
static std::vector< AsciiBoxfindBoxes (const std::vector< std::string > &network)

Public Attributes

int posX
int posY
int width
int height
std::string title

Detailed Description

This class represents a box in an ASCII canvas. At the moment, the only chars allowed for drawing boxes are:

  • '+' for corners
  • '-' for horizontal lines
  • '|' for vertical lines

Constructor & Destructor Documentation

◆ AsciiBox()

AsciiBox ( const std::vector< std::string > &  network,
int  x,
int  y 

This constructs a box that is supposedly anchored at pos (x, y) in the given network. If that is not the case, the result is undefined.

Member Function Documentation

◆ borderContains()

bool borderContains ( int  x,
int  y 
) const

Return whether the given position is located on the border (frame) of this box.

◆ findBoxes()

static std::vector<AsciiBox> findBoxes ( const std::vector< std::string > &  network)

Find and return all the boxes in the given ascii network representation. This function does not do any checking of any sort, so an ill-formed box will simply be ignored and no exception will be thrown

◆ isBox()

static bool isBox ( const std::vector< std::string > &  network,
int  x,
int  y 

Return whether there is a box which top-left corner is located at (x, y).

Member Data Documentation

◆ height

int height

◆ posX

int posX

◆ posY

int posY

◆ title

std::string title

◆ width

int width

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