cmpslib
|
#include <cxxabi.h>
#include <bitset>
#include <time.h>
#include <string>
#include <string.h>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <stdarg.h>
#include <typeinfo>
#include <limits.h>
#include <limits>
#include <ios>
#include <float.h>
#include <math.h>
#include <iomanip>
#include <stdexcept>
#include <signal.h>
#include <random>
#include <algorithm>
Go to the source code of this file.
Functions | |
void | Prompt (string prompt, string &val) |
use to request input from the user More... | |
template<class T > | |
void | Prompt (string prompt, T &val) |
use to request input from the user More... | |
template<class T > | |
void | Prompt (string prompt, T &val, T minval, T maxval) |
use to request input from the user More... | |
bool | PromptYN (string prompt) |
for simple yes or no questions More... | |
void | WaitHundredth (int time) |
Do nothing for a period of time. More... | |
void | ClearScreen () |
clear the screen More... | |
char * | GetTime () |
get the time More... | |
string | GetDateTime () |
The DateTime as a string. More... | |
int | StringToInteger (string input) |
convert string to int More... | |
double | StringToDouble (string input) |
convert string to double More... | |
string | ToLowerCase (string input) |
convert string to lowercase More... | |
string | ToUpperCase (string input) |
convert string to uppercase More... | |
bool | StringToBool (string input) |
convert string to bool More... | |
bool | VeryClose (float A, float B, float epsilon=0.0005f) |
compare two floats More... | |
template<typename T > | |
string | NumberToString (T Number) |
convert a numveric value to string More... | |
int | CreateRandomNumber (int min, int max) |
create a random number More... | |
bool | IsNumber (string str) |
can this string be converted to a numeric value More... | |
bool | IsInteger (string input) |
can this string be converted to an integer numeric value More... | |
bool | IsDouble (string input) |
can this string be converted to an double value More... | |
string | PassFail (int in) |
convert bool value into "Pass" or "Fail" More... | |
string | PF (int in) |
same as PassFail same as PassFail More... | |
template<class T > | |
bool | IsSortedAscending (T *data, unsigned int size) |
is an array sorted a function that will tell you if an array is sorted More... | |
template<class T > | |
bool | IsSortedDescending (T *data, unsigned int size) |
is an array sorted a function that will tell you if an array is sorted More... | |
string | RED (string input) |
return a string formatted to display in color More... | |
string | GREEN (string input) |
return a string formatted to display in color More... | |
string | YELLOW (string input) |
return a string formatted to display in color More... | |
string | BLUE (string input) |
return a string formatted to display in color More... | |
string | MAGENTA (string input) |
return a string formatted to display in color More... | |
string | CYAN (string input) |
return a string formatted to display in color More... | |
string | ChangeToRed () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToGreen () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToYellow () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToBlue () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToMagenta () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToCyan () |
returns a string formated to display in a color and does not reset to white More... | |
string | ChangeToWhite () |
returns a string formated to display in a color and does not reset to white More... | |
void | PositionCursor (int row, int col) |
move the cursor to the position indcated by the row and column More... | |
template<typename T > | |
std::string | GetClassName (const T &a) |
get the class name as a string for the object More... | |
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
returns a string formated to display in a color and does not reset to white
returns a string that when pushed to std::cout will change the console output color
you will probably want to set it back white at some point
|
inline |
clear the screen
clears the screen
|
inline |
create a random number
create a random number
min | minimum value to return |
max | maximum value to return |
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white
|
inline |
get the class name as a string for the object
returns a string representation of the class name of the object
a | the object that you would like to get the class name of |
|
inline |
The DateTime as a string.
returns the date time as string YYYY-MM-DD-HH:mm:ss year-month-day-hour:minutes:seconds
|
inline |
get the time
returns the current time as a formatted char array
The returned string has the following format:
Www Mmm dd hh:mm:ss yyyy
Where Www is the weekday, Mmm the month in letters, dd the day of the month, hh:mm:ss the time, and yyyy the year.
The C string is followed by a new-line character and the terminating null-character.
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white
|
inline |
can this string be converted to an double value
tests to see if the string could be converted to a double value
retrurns true if so , false otherwise
|
inline |
can this string be converted to an integer numeric value
tests to see if the string could be converted to a integer value
retrurns true if so , false otherwise
|
inline |
can this string be converted to a numeric value
tests to see if the string could be converted to a numeric value
retrurns true if so , false otherwise
|
inline |
is an array sorted a function that will tell you if an array is sorted
data | pointer to an array |
size | the size of the array |
|
inline |
is an array sorted a function that will tell you if an array is sorted
data | pointer to an array |
size | the size of the array |
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white
|
inline |
convert a numveric value to string
this will try to convert a double,int or float to a string
may throw and exception if it cant do it
|
inline |
convert bool value into "Pass" or "Fail"
used to test some of our fuctions
simply returns a string for our tests
|
inline |
same as PassFail same as PassFail
|
inline |
move the cursor to the position indcated by the row and column
move the cursor to the position indcated by the row and column Note the offset is 1 not 0 any cout statemets after this funcion is called will start displaying at the new location
|
inline |
use to request input from the user
displays the first parameter "text" to the console
take in input from the user and store it in the second parameter
this version is specific for string datatype
it will read in an entire line of text including spaces
prompt | the value (message) to be displayed to the user |
val | the destination where the user input is stored |
|
inline |
use to request input from the user
displays the first parameter "text" to the console
take in input from the user and store it in the second parameter
if the input does not match the datatype of the second parameter
the function will request the user enter the value again
prompt | the value (message) to be displayed to the user |
val | (PBR) the destination where the user input is stored |
|
inline |
use to request input from the user
displays the first parameter "text" to the console
take in input from the user and store it in the second parameter
if the input does not match the datatype of the second parameter
the function will request the user enter the value again
prompt | the value (message) to be displayed to the user |
val | (PBR) the destination where the user input is stored |
minval | minimum acceptable value |
maxval | maximum acceptable value int puppies; Prompt("How many puppies would you like?",puppies,0,4); // the user input value is now stored in puppies // the function will only complete when the user has entered a value between 0 and 4 |
|
inline |
for simple yes or no questions
displays the first parameter "text" to the console
the function will repeat asking till the user types Y,y,N or n
prompt | the value (message) to be displayed to the user |
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white
|
inline |
convert string to bool
true,TRUE,TruE or 1 return true false,FALSE,FaLsE or 0 return false
|
inline |
convert string to double
this will try to convert a string to in double may throw and exception if it cant do it
|
inline |
convert string to int
this will try to convert a string to in integer may throw and exception if it cant do it
|
inline |
convert string to lowercase
convert an std:string to all lowercase values
|
inline |
convert string to uppercase
convert an std:string to all uppercase values
|
inline |
compare two floats
compare some floating point numbers
this should work for type double as well
it is difficult to compare for equality so this will tell us if they are within
a distance of each other the default for that value is .0005
|
inline |
Do nothing for a period of time.
used to slow the operation of programs
25 -> quarter of a second, 50 -> half a second
time | wait time will be approximatley in 100ths of a second |
|
inline |
return a string formatted to display in color
returns a string same as the input but with some tags added so it will display the text and change back to white