Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Small C++ library which allows to generate printable tables

License

Notifications You must be signed in to change notification settings

gflix/LibTabularasa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibTabularasa

Introduction

Small C++ library which allows to generate printable tables like this:

+-------+---------+---+
|  Foo  |     Bar | - |
+-------+---------+---+
| 12345 |       X | y |
|  123  | 12345-r | n |
| 2345  |       Y | n |
+-------+---------+---+

See unittest/TableTest.cpp for usage reference.

Features

  • Generates ASCII art tables with dynamic or fixed width columns
  • Stream output (i.e. cout, stringstream, fstream etc.)
  • Horizontal alignment based on column settings with the ability to override the alignment per cell
  • Compact output supported by omitting the upper and lower border and spaces within table cells
  • Color support using ANSI code sequences supported by the vast majority of terminals (foreground and background coloring)
  • No external dependencies other than C++ standard library

Debian/Ubuntu package

To build the Debian/Ubuntu package from these sources please clone the repository and run

dpkg-buildpackage -uc -us -b

Then install the packages using

sudo dpkg -i ../libtabularasa*.deb

Make sure you have debhelper installed (sudo apt install debhelper).

Usage

The package provides a pkg-config file which allows to integrate the library using autotools and/or cmake.

Have a look into unittest/TableTest.cpp on how to use the library.

Unittests

The unittests are using GTest (Google Test Framework) shipped with this repository (see external/gtest/LICENSE for details).

To compile and execute the unittest do the following

mkdir build && cd build
cmake -DWITH_UNITTESTS=True .. && make gtest && ./gtest

A coverage report can be generated by using i.e. gcovr as follows:

gcovr build -r tabularasa -s --html -o contrib/coverage.html

About

Small C++ library which allows to generate printable tables

Resources

License

Stars

Watchers

Forks

Packages

No packages published