No longer using SmartStreams
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.26.0)
|
||||
project(gtest_Graphics VERSION 0.1.0 LANGUAGES C CXX)
|
||||
|
||||
add_executable(SmartStreamTest main.cpp)
|
||||
target_link_libraries(SmartStreamTest NBCore)
|
||||
@@ -1,41 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "SmartStreams.hpp"
|
||||
|
||||
template <typename ST>
|
||||
class TestStream : public nb::SmartOStream<ST, TestStream<ST>> {
|
||||
using Base = nb::SmartOStream<ST, TestStream<ST>>;
|
||||
public:
|
||||
TestStream(ST& stream) : Base(stream) {}
|
||||
|
||||
static const nb::SmartFormatMap Formatters;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
template<typename ST>
|
||||
const nb::SmartFormatMap TestStream<ST>::Formatters = {
|
||||
{0, [](std::string msg, std::string fmt){
|
||||
return "[0] : " + msg;
|
||||
}},
|
||||
{1, [](std::string msg, std::string fmt){
|
||||
return "\x1b[" + fmt + "m" + msg + "\x1b[0m";
|
||||
}},
|
||||
{2, [](std::string msg, std::string fmt){
|
||||
return "\x1b[1m" + msg + "\x1b[0m";
|
||||
}},
|
||||
{3, [](std::string msg, std::string fmt){
|
||||
return "\x1b[31m" + msg + "\x1b[0m";
|
||||
}}
|
||||
};
|
||||
|
||||
using nb::SmartText;
|
||||
|
||||
int main() {
|
||||
|
||||
auto tout = TestStream(std::cout);
|
||||
tout << SmartText<SmartText<const char*>>{SmartText<const char*>{"Gloop\n", {3, ""}}, {2, "32"}};
|
||||
tout << 8989 << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user