-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.h
More file actions
79 lines (60 loc) · 1.49 KB
/
utility.h
File metadata and controls
79 lines (60 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// THIS IS A CUSTOM HEADER FILE
// IT IS FOR PERSONAL USE
// ANYONE CAN USE IT AND MODIFY
#pragma once
#ifndef UTILITY_H
#define UTILITY_H
// HEADER FILE INCLUSIONS
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <ctime>
#include <thread>
#include <atomic>
#include <chrono>
#include <mutex>
#include <condition_variable>
#include <limits>
#include <cstdlib>
// HEADER DECLARATIONS
using std::string;
using namespace std::chrono_literals;
// VARIABLE DECLARATIONS
static std::mutex _mtx;
static std::condition_variable _cvrbl;
// TYPEDEF ALIASES
typedef std::thread ATHREAD_t;
typedef std::string text_t;
typedef int value_t;
typedef bool switch_t;
typedef char char_t;
// MACROS
#ifdef _WIN32
#define CLEAR_COMMAND "cls"
#else
#define CLEAR_COMMAND "clear"
#endif
//UTILITY FUNTIONS
// -SYSTEM FLOW AND DESIGN
void clearScreen();
void newLine(value_t lines);
void pressToContinue();
void clearBuffer();
text_t horizontalPadding();
void verticalPadding();
void exitProgram();
// - CUSTOM USER DEFINED
void print(text_t& text);
void printMessage(text_t& message, value_t time);
void printInt(value_t& VALUE);
void printTextAndValue(text_t& text, value_t& VALUE);
void printChar(char_t& chr);
// -CUSTOM MATHEMATICAL FUNCTIONS
void incr(value_t& number);
#endif
//NOTES
//
//
// THE SEED OF <CTIME> SHOULD BE CASTED TO IUNSIGNED INT AND DECLARED IN THE SYSTEMS/MAIN FUNTION
// i.e srand(static_cast<unsigned int>(time(NULL))); => copy and paste for your seed.