Not needed
This commit is contained in:
parent
5ff269aa72
commit
1b2d012caf
1 changed files with 0 additions and 63 deletions
63
Parser.cpp
63
Parser.cpp
|
@ -1,63 +0,0 @@
|
||||||
//#include "main.cpp"
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
bool password = true; // temp for a password needed function needed later.
|
|
||||||
string pass = "admin";
|
|
||||||
|
|
||||||
void setPassword()
|
|
||||||
{
|
|
||||||
password = !password;
|
|
||||||
}
|
|
||||||
|
|
||||||
vector<string> tokenize(string ss){
|
|
||||||
string tempString;
|
|
||||||
stringstream lineStream(ss);
|
|
||||||
vector<string> output;
|
|
||||||
|
|
||||||
while (lineStream >> tempString){
|
|
||||||
output.push_back(tempString);
|
|
||||||
}
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
void parseCmd(vector<string> input){
|
|
||||||
if(password){
|
|
||||||
if(pass == input[0]){
|
|
||||||
setPassword();
|
|
||||||
cout << "Success." << endl;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
cout << "Incorrect Password." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
string cmd = toupper(input[0]);
|
|
||||||
|
|
||||||
else if(cmd == ""){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(cmd == ""){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(cmd == ""){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(cmd == ""){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(cmd == ""){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void parse(string input){
|
|
||||||
vector<string> listOfTokens = tokenize(input);
|
|
||||||
parseCmd(listOfTokens);
|
|
||||||
}
|
|
Reference in a new issue