forked from CS162-Group35/GroupProject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputValidation.hpp
34 lines (28 loc) · 1.44 KB
/
inputValidation.hpp
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
/******************************************************************************
* Authors: Sean Patrick Akins
* Edmund Dea
* Trevor Rollins
* Nathan Villegas
* Group: 35
* Class: CS162-400
* Date: 10/27/2017
* Title: Group Project
* Description: header file for the input validation functions.
******************************************************************************/
#ifndef INPUTVALIDATION_H
#define INPUTVALIDATION_H
#include <string>
#include <sstream>
#include <iostream>
#include <limits>
using std::string;
using std::stringstream;
int intValidator(int low = std::numeric_limits<int>::min(), int high = std::numeric_limits<int>::max());
double doubleValidator(double low= std::numeric_limits<double>::min(), double high= std::numeric_limits<double>::max());
char charValidator(char char1, char char2 = ' ', char char3 = ' ', char char4 = ' ', char char5 = ' ');
string stringValidator(string str1, string str2="", string str3="", string str4="", string str5="");
bool checkInt(stringstream* ssInput, int& intOutput, int low, int high);
bool checkDouble(stringstream* ssInput, double& doubleOutput, double low, double high);
bool checkChar(string input, char& output, char char1, char char2, char char3, char char4, char char5);
bool checkString(string strInput, string& output, string str1, string str2, string str3, string str4, string str5);
#endif