parent
e864e14eab
commit
fd8180bc61
@ -1,7 +1,21 @@ |
|||||||
#pragma once |
#pragma once |
||||||
#include <string_view> |
#include <string_view> |
||||||
#include <SFML/Graphics.hpp> |
#include <SFML/Graphics.hpp> |
||||||
|
#include <codecvt> |
||||||
|
|
||||||
typedef std::function<void(sf::Color bgcolor, sf::Color color, wchar_t ch)> WriteCB; |
typedef std::function<void(sf::Color bgcolor, sf::Color color, wchar_t ch)> WriteCB; |
||||||
|
|
||||||
bool parse_ansi(std::wstring_view codes, sf::Color default_fg, sf::Color default_bg, WriteCB write); |
class ANSIParser { |
||||||
|
sf::Color $default_fg; |
||||||
|
sf::Color $default_bg; |
||||||
|
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> $converter; |
||||||
|
|
||||||
|
public: |
||||||
|
ANSIParser(sf::Color default_fg, sf::Color default_bg); |
||||||
|
|
||||||
|
// disable copying
|
||||||
|
ANSIParser(ANSIParser& ap) = delete; |
||||||
|
|
||||||
|
bool parse(const std::string &screen, WriteCB write); |
||||||
|
bool parse(std::wstring_view codes, WriteCB write); |
||||||
|
}; |
||||||
|
Loading…
Reference in new issue