Connect++ 0.6.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
vic_strings.cpp
1/*
2
3Copyright © 2023-24 Sean Holden. All rights reserved.
4
5*/
6/*
7
8This file is part of Connect++.
9
10Connect++ is free software: you can redistribute it and/or modify it
11under the terms of the GNU General Public License as published by the
12Free Software Foundation, either version 3 of the License, or (at your
13option) any later version.
14
15Connect++ is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18more details.
19
20You should have received a copy of the GNU General Public License along
21with Connect++. If not, see <https://www.gnu.org/licenses/>.
22
23*/
24
25#include "vic_strings.hpp"
26
27namespace unicode_symbols {
28 std::string LogSym::neg = std::string("\u00ac");
29 std::string LogSym::unicode_space = std::string("\u00a0");
30 std::string LogSym::or_sym = std::string("\u22c1");
31 std::string LogSym::and_sym = std::string("\u22c0");
32 std::string LogSym::true_sym = std::string("\u22a4");
33 std::string LogSym::false_sym = std::string("\u22a5");
34 std::string LogSym::forall = std::string("\u2200");
35 std::string LogSym::exists = std::string("\u2203");
36 std::string LogSym::ifthen = std::string("\u2192");
37 std::string LogSym::iff = std::string("\u2194");
38 std::string LogSym::neq = std::string("\u2260");
39 std::string LogSym::subbed = std::string("\u21e6");
40}
41//--------------------------------------------------------------
42namespace ansi_escape_colours {
43 uint8_t Colour::num_colours = 10;
44 std::string Colour::nocol = std::string("\033[0m");
45 std::string Colour::red = std::string("\033[38;5;9m");
46 std::string Colour::green = std::string("\033[38;5;10m");
47 std::string Colour::blue = std::string("\033[38;5;12m");
48 std::string Colour::lblue = std::string("\033[38;5;14m");
49 std::string Colour::orange = std::string("\033[38;5;208m");
50 std::string Colour::yellow = std::string("\033[38;5;11m");
51 std::string Colour::purple = std::string("\033[38;5;13m");
52 std::string Colour::grey = std::string("\033[38;5;242m");
53 std::string Colour::lgrey = std::string("\033[38;5;248m");
54
55 std::string Colour::name_to_string(const ColourName& name) {
56 switch(name) {
57 case ColourName::NOCOL:
58 return Colour::nocol;
59 break;
60 case ColourName::RED:
61 return Colour::red;
62 break;
63 case ColourName::GREEN:
64 return Colour::green;
65 break;
66 case ColourName::BLUE:
67 return Colour::blue;
68 break;
69 case ColourName::LBLUE:
70 return Colour::lblue;
71 break;
72 case ColourName::ORANGE:
73 return Colour::orange;
74 break;
75 case ColourName::YELLOW:
76 return Colour::yellow;
77 break;
78 case ColourName::PURPLE:
79 return Colour::purple;
80 break;
81 case ColourName::GREY:
82 return Colour::grey;
83 break;
84 case ColourName::LGREY:
85 return Colour::lgrey;
86 break;
87 default:
88 return Colour::nocol;
89 break;
90 }
91 }
92}
93//--------------------------------------------------------------
94namespace verbose_print {
95
96uint8_t VPrint::verbosity = 0;
97
98//--------------------------------------------------------------
108void VPrint::operator()(uint8_t v, const string& s, bool n, uint8_t nl) {
109 if (v <= verbosity) {
110 std::cout << s;
111 if (n) {
112 for (uint8_t i = 0; i < nl; i++) {
113 std::cout << std::endl;
114 }
115 }
116 }
117}
118//--------------------------------------------------------------
128void VPrint::operator()(uint8_t v, char* s, bool n, uint8_t nl) {
129 if (v <= verbosity) {
130 std::cout << s;
131 if (n) {
132 for (uint8_t i = 0; i < nl; i++) {
133 std::cout << std::endl;
134 }
135 }
136 }
137}
138//--------------------------------------------------------------
142void VPrint::nl(uint8_t v, uint8_t nl) {
143 if (v <= verbosity) {
144 for (uint8_t i = 0; i < nl; i++) {
145 std::cout << std::endl;
146 }
147 }
148}
149}
void nl(uint8_t, uint8_t=1)
void operator()(uint8_t, const string &, bool=false, uint8_t=1)
vic_string - "verbose/indented/coloured"