https://github.com/heimskr/formicine
A C++ library for doing things with ANSI.
https://github.com/heimskr/formicine
ansi ansi-escape-codes library
Last synced: about 1 year ago
JSON representation
A C++ library for doing things with ANSI.
- Host: GitHub
- URL: https://github.com/heimskr/formicine
- Owner: heimskr
- License: lgpl-3.0
- Created: 2019-05-19T02:32:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T20:04:05.000Z (almost 5 years ago)
- Last Synced: 2025-02-15T09:31:33.629Z (over 1 year ago)
- Topics: ansi, ansi-escape-codes, library
- Language: C++
- Homepage:
- Size: 95.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Formicine
A simple C++ library that wraps ostreams for use with ANSI escapes.
### Example
##### Code
```cpp
#include
#include "ansi.h"
int main(int, char **) {
ansi::ansistream as(std::cout, std::cerr);
as << "Normal text\n";
as << ansi::bold << "Bold text" << ansi::reset << "\n";
as << fg(ansi::green) << "Green text" << ansi::reset << "\n";
as << ansi::underline << "Underlined text,"
<< ansi::italic << " italic+underlined text"
>> ansi::underline << " and just italic text."
<< ansi::reset << "\n";
}
```
##### Output
> Normal text
**Bold text**
Green text
Underlined text, italic+underlined text and just italic text.