79 std::vector<std::vector<char>>
buffer;
104 void write(
char c,
long long dLine,
long long dCol,
bool updatePos =
false);
113 void write(
char c,
const Position& pos,
bool updatePos =
false);
122 void write(
const std::string& s,
const Position& pos,
bool updatePos =
false);
128 [[nodiscard]] std::string
asString()
const;
160 constexpr std::string_view
BECAUSE =
"\u2235";
169 constexpr std::string_view
SURD =
"\u221A";
181 constexpr std::string_view
SUB_0 =
"\u2080";
186 constexpr std::string_view
SUB_Z =
"\u1D69";
217 constexpr std::string_view
SUP_0 =
"\u2070";
222 constexpr std::string_view
SUP_Z =
"\u1DBB";
251 std::string
makeSurd(
const std::string& radicand);
267 std::string
ppRoot(
const std::string& radicand,
const std::string& index =
"2");
277 std::string
ppFraction(
const std::string& top,
const std::string& bottom,
bool inLine =
false);
286 std::string
ppSubscript(
const std::string& base,
const std::string& subscript);
295 std::string
ppSuperscript(
const std::string& base,
const std::string& superscript);
Position curPos
The current position.
Definition symbols.hpp:76
size_t height
The height of the buffer.
Definition symbols.hpp:82
std::vector< std::vector< char > > buffer
The buffer object.
Definition symbols.hpp:79
std::string asString() const
Gets the buffer as a string.
Definition symbols.cpp:99
size_t width
The width of the buffer.
Definition symbols.hpp:85
void write(char c, long long dLine, long long dCol, bool updatePos=false)
Writes a character to the buffer.
Definition symbols.cpp:55
ConsoleOutput(size_t height, size_t width)
Creates a new console output buffer.
Definition symbols.cpp:40
The namespace containing various unicode symbols.
Definition symbols.cpp:124
constexpr std::string_view SUB_Z
The subscript z (Unicode U+2098)
Definition symbols.hpp:186
constexpr std::string_view LARGE_DOT
The large dot symbol (Unicode U+25C9)
Definition symbols.hpp:173
constexpr std::string_view SUP_Z
The superscript z (Unicode U+1DBB)
Definition symbols.hpp:222
constexpr std::string_view THEREFORE
The therefore symbol (3 dots in a triangle, Unicode U+2234)
Definition symbols.hpp:162
constexpr std::string_view BECAUSE
The because symbol (3 dots in a triangle, Unicode U+2235)
Definition symbols.hpp:160
const std::array< std::string, 10 > & SUPERSCRIPTS
A list of subscript characters.
Definition symbols.cpp:128
constexpr int SUB_MAGIC_NUMBER
The subscript magic number (8272)
Definition symbols.hpp:191
constexpr std::string_view SUB_0
The subscript 0 (Unicode U+2080)
Definition symbols.hpp:181
constexpr std::string_view MULTIPLY
The multiply symbol (Unicode U+00D7)
Definition symbols.hpp:165
std::string makeSubscript(const std::string &normal)
Create a subscript string from a normal string.
Definition symbols.cpp:131
std::string makeSurd(const std::string &radicand)
Makes a surd expression from a radicand.
Definition symbols.cpp:164
std::string makeSuperscript(const std::string &normal)
Create a superscript string from a normal string.
Definition symbols.cpp:144
constexpr std::string_view SURD
Definition symbols.hpp:169
constexpr std::string_view ABOVE_DOT
Definition symbols.hpp:174
constexpr std::string_view COMBINE_MACRON
Definition symbols.hpp:170
constexpr std::string_view SUP_0
The superscript 0 (Unicode U+2070)
Definition symbols.hpp:217
constexpr int SUP_MAGIC_NUMBER
The superscript magic number (8304)
Definition symbols.hpp:227
constexpr std::string_view DIVIDED_BY
The divide symbol (Unicode U+00F7)
Definition symbols.hpp:167
The custom-implemented printer engines for outputting expressions.
Definition baseConvert.cpp:50
std::string ppFraction(const std::string &top, const std::string &bottom, const bool inLine)
Pretty print a fraction.
Definition fraction.cpp:52
std::string ppSubscript(const std::string &base, const std::string &subscript)
Pretty print a base expression, (aka, subscript).
Definition baseConvert.cpp:51
std::string ppRoot(const std::string &radicand, const std::string &index)
Pretty print a root expression.
Definition root.cpp:59
std::string ppSuperscript(const std::string &base, const std::string &superscript)
Pretty print a power expression, (aka, superscript).
Definition power.cpp:47
The namespace containing utilities for pretty printing.
Definition baseConvert.cpp:50
size_t getStringWidth(const std::string &s)
Gets the minimal width needed to print a string.
Definition symbols.cpp:111
size_t getStringHeight(const std::string &s)
Gets the minimal height needed to print a string.
Definition symbols.cpp:120
Represents a position in the console.
Definition symbols.hpp:51
long long x
Definition symbols.hpp:52
long long y
Definition symbols.hpp:53