Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1/// @file format.h
2/// Header file for the ANSI Escape code related functions.
3/*
4This program is free software: you can redistribute it and/or modify it under the
5terms of the GNU Lesser General Public License as published by the Free Software
6Foundation, either version 3 of the License, or (at your option) any later version.
7
8This program is distributed in the hope that it will be useful, but WITHOUT ANY
9WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
11
12You should have received a copy of the GNU Lesser General Public License along with this
13program. If not, see <https://www.gnu.org/licenses/>.
14*/
15
16#ifndef FORMAT_H
17#define FORMAT_H
18
19#include <chrono>
20#include <string>
21#include <thread>
22
23extern const std::string textClear;
24extern const std::string textReset;
25
26extern const std::string textBold;
27extern const std::string textItalic;
28extern const std::string textUnderline;
29extern const std::string textStrikethrough;
30
31extern const std::string textDefault;
32extern const std::string textBlack;
33extern const std::string textRed;
34extern const std::string textGreen;
35extern const std::string textYellow;
36extern const std::string textBlue;
37extern const std::string textMagenta;
38extern const std::string textCyan;
39extern const std::string textWhite;
40
41extern const std::string bgDefault;
42extern const std::string bgBlack;
43extern const std::string bgRed;
44extern const std::string bgGreen;
45extern const std::string bgYellow;
46extern const std::string bgBlue;
47extern const std::string bgMagenta;
48extern const std::string bgCyan;
49extern const std::string bgWhite;
50
51extern const int sleepShort;
52extern const int sleepMedium;
53extern const int sleepLong;
54
55/// @brief Mimics python sleep() behaviour, with param milliseconds.
56class time {
57 public:
58 static void sleep(int dur); // unit is in ms
59};
60
61extern std::string setCursorPosition(int offsetY, int offsetX); // same as below
62
63extern void fetchConsoleDimensions(
64 int & row, int & col); // number of characters each row and column can fit, not the
65 // number of pixels
66
67#endif
Mimics python sleep() behaviour, with param milliseconds.
Definition format.h:56
static void sleep(int dur)
Definition format.cpp:52
const std::string textDefault
Definition format.cpp:28
const std::string textCyan
Definition format.cpp:35
const std::string bgYellow
Definition format.cpp:42
const std::string textBlue
Definition format.cpp:33
const std::string bgGreen
Definition format.cpp:41
const std::string bgDefault
Definition format.cpp:38
const int sleepShort
Definition format.cpp:48
const std::string textUnderline
Definition format.cpp:25
const int sleepMedium
Definition format.cpp:49
const std::string bgWhite
Definition format.cpp:46
const std::string textReset
Definition format.cpp:21
void fetchConsoleDimensions(int &row, int &col)
Definition format.cpp:62
const std::string textStrikethrough
Definition format.cpp:26
const std::string textGreen
Definition format.cpp:31
const std::string bgBlue
Definition format.cpp:43
const std::string textClear
Definition format.cpp:20
const std::string bgBlack
Definition format.cpp:39
const std::string textItalic
Definition format.cpp:24
const std::string textYellow
Definition format.cpp:32
const std::string bgMagenta
Definition format.cpp:44
const std::string textWhite
Definition format.cpp:36
const std::string textMagenta
Definition format.cpp:34
const std::string bgCyan
Definition format.cpp:45
const std::string textRed
Definition format.cpp:30
const std::string bgRed
Definition format.cpp:40
const std::string textBold
Definition format.cpp:23
const int sleepLong
Definition format.cpp:50
const std::string textBlack
Definition format.cpp:29
std::string setCursorPosition(int offsetY, int offsetX)
Definition format.cpp:56