Skip to content
/ termdb Public
forked from agauniyal/termdb

Terminfo parser for modern c++ 📠

License

Notifications You must be signed in to change notification settings

vikonix/termdb

 
 

Repository files navigation

TermDb Build Status codecov

Terminfo parser for modern c++. Docs.

#include "termdb.hpp"
#include <iostream>

using namespace tdb;

int main()
{
	TermDb parser;
	auto result = parser.parse("xterm");

	if (result) {
		auto name = parser.getName();
		auto b    = parser.get(bin::has_meta_key);
		auto n    = parser.get(num::columns);
		auto s    = parser.get(str::enter_bold_mode);

		std::cout << "\n"
		          << "Name: " << name << "\n"
		          << "Has Meta Key: " << std::boolalpha << b << "\n"
		          << "Number of columns: " << n.value_or(24) << "\n"
		          << "Bold Mode on: " << s << "I should be BOLD!"
		          << "\n";
	} else {
		std::cerr << "Couldn't parse terminfo database\n";
	}
}

About

Terminfo parser for modern c++ 📠

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.2%
  • Meson 2.1%
  • Python 1.4%
  • Shell 0.3%