libfort
Loading...
Searching...
No Matches
fort.hpp File Reference

Main header file describing libfort C++ API . More...

#include <iomanip>
#include <memory>
#include <sstream>
#include <string>
#include <stdexcept>
#include <type_traits>
#include "fort.h"
Include dependency graph for fort.hpp:

Go to the source code of this file.

Classes

class  fort::table_manipulator
 
class  fort::property_owner< table >
 
class  fort::table< TT >
 
class  fort::table< TT >::table_cell
 
class  fort::table< TT >::table_row
 
class  fort::table< TT >::table_column
 
class  fort::table< TT >::cell_range
 
class  fort::table< TT >::default_properties
 

Typedefs

using fort::char_table = table< table_type::character >
 
using fort::utf8_table = table< table_type::utf8 >
 

Enumerations

enum class  fort::text_align { left = FT_ALIGNED_LEFT , center = FT_ALIGNED_CENTER , right = FT_ALIGNED_RIGHT }
 
enum class  fort::row_type { common = FT_ROW_COMMON , header = FT_ROW_HEADER }
 
enum class  fort::add_strategy { replace = FT_STRATEGY_REPLACE , insert = FT_STRATEGY_INSERT }
 
enum class  fort::color {
  default_color = FT_COLOR_DEFAULT , black = FT_COLOR_BLACK , red = FT_COLOR_RED , green = FT_COLOR_GREEN ,
  yellow = FT_COLOR_YELLOW , blue = FT_COLOR_BLUE , magenta = FT_COLOR_MAGENTA , cyan = FT_COLOR_CYAN ,
  light_gray = FT_COLOR_LIGHT_GRAY , dark_gray = FT_COLOR_DARK_GRAY , light_red = FT_COLOR_LIGHT_RED , light_green = FT_COLOR_LIGHT_GREEN ,
  light_yellow = FT_COLOR_LIGHT_YELLOW , light_blue = FT_COLOR_LIGHT_BLUE , light_magenta = FT_COLOR_LIGHT_MAGENTA , light_cyan = FT_COLOR_LIGHT_CYAN ,
  light_whyte = FT_COLOR_LIGHT_WHYTE
}
 
enum class  fort::text_style {
  default_style = FT_TSTYLE_DEFAULT , bold = FT_TSTYLE_BOLD , dim = FT_TSTYLE_DIM , italic = FT_TSTYLE_ITALIC ,
  underlined = FT_TSTYLE_UNDERLINED , blink = FT_TSTYLE_BLINK , inverted = FT_TSTYLE_INVERTED , hidden = FT_TSTYLE_HIDDEN
}
 
enum class  table_type { character , utf8 }
 

Functions

template<typename T >
constexpr bool fort::is_stream_manipulator () noexcept
 
bool fort::set_default_border_style (struct ft_border_style *style)
 

Variables

const table_manipulator fort::header (0)
 
const table_manipulator fort::endr (1)
 
const table_manipulator fort::separator (2)
 

Detailed Description

Main header file describing libfort C++ API .

This files contains C++ wrappers around libfort API that can be used in C++ code.

Typedef Documentation

◆ char_table

using fort::char_table = typedef table<table_type::character>

Formatted table containing common char content.

Content of the table is treated as a string where each byte represesents a character. Should work for ascii characters. In case of usage of different international symbols it is recommended to use utf8_table.

◆ utf8_table

using fort::utf8_table = typedef table<table_type::utf8>

Formatted table containing utf-8 content.

Enumeration Type Documentation

◆ add_strategy

enum class fort::add_strategy
strong

Adding strategy.

Determines what happens with old content if current cell is not empty after adding data to it. Default strategy is 'replace'.

◆ color

enum class fort::color
strong

Colors.

◆ row_type

enum class fort::row_type
strong

Type of table row. Determines appearance of row.

◆ text_align

enum class fort::text_align
strong

Alignment of cell content.

◆ text_style

enum class fort::text_style
strong

Text styles.

Function Documentation

◆ is_stream_manipulator()

template<typename T >
constexpr bool fort::is_stream_manipulator ( )
constexprnoexcept

Utility function that is used internally by the library to check if argument passed to operator<< is a manipulator. In case default behaviour is not enough write custom specialization of this function.

◆ set_default_border_style()

bool fort::set_default_border_style ( struct ft_border_style *  style)
inline

Set default border style for all new formatted tables.

Parameters
stylePointer to border style.
Returns
  • True: Success; table border style was changed.
  • False: Error

Variable Documentation

◆ endr

const table_manipulator fort::endr(1) ( 1  )

Table manipulator to move current cell to the first cell of the next row.

◆ header

const table_manipulator fort::header(0) ( 0  )

Table manipulator to set current row as a header.

◆ separator

const table_manipulator fort::separator(2) ( 2  )

Table manipulator to add separator to the table.