BeeGuid Source version 0.3
// BeeGuid.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <string>
#include <cmath>
#include <fstream>
#include <windows.h>
#include "ConsoleColor.h"
using namespace std;
const int NotUsed = ::system("color F3"),
consoleTextLength = 77,
parametersAmount = 23;
bool devMode = false,
restartProgram = false,
fastMode = false,
res = false,
stop = false,
fileCorrupt = false;
string beeFile[290],
parameterDB[24],
msValueGen[290],
msBeeWithChosenGen[290];
class beeFileClass { . . };
beeFileClass ftb;
//"Utility"
void welcomeTitle() { . . }
void fastMessage() { . . }
string fastModeConf(int nOfCin) { . . }
void clearData() { . . }
bool restartMode(bool error, string message) { . . }
void buildTable(string elementOfTable[250], int amountOfElements, string tableParameter) { . . }
int scanFiles() { . . }
void filesTable() { . . }
int paramWriter(string getInfo, int paramFor) { . . }
void genCardTablePart(string exactGen, int maxLength) { . . }
void genCardTable(int stringLength) { . . }
string wordOut(int numberOfWord) { . . }
void tableOfAvailableTypesOfGen() { . . }
int scanOfAvailableValuesOfGen(int nNumberOfGenInTableFun) { . . }
int scanForBeesUsingGen(int numberOfValue, int nNumberOfGenInTable) { . . }
//Functions of program
void fistMode() { . . }
void secondMode() { . . }
void thirdMode() { . . }
//Main function
int main(int nNumberofArgs, char* pszArgs[])
{
::SetConsoleTitle(_T("BeeGuid v0.3")); //Setting console title
for (int i = 0; i < nNumberofArgs; i++) //Checking arguments
{
string argCheck = pszArgs[i];
if (argCheck == "-dev") { devMode = true; }
if (argCheck == "-f") { fastMode = true; }
}
string mainCommand; //Init command
int mode; //Init mode (func of program)
do
{
clearData(); //Clearing data
mode = 15; //Set wrong mode
welcomeTitle(); // "New page"
::cout << " 1 - genetic cards\n"
<< " 2 - search bees from specific gene\n"
<< " help - get some extra commands\n"
<< " Type here: ";
::cin >> mainCommand; //Reading command
if (mainCommand == "help") //Extra commands
{
welcomeTitle();
::cout << " stop - will stop program\n"
<< " res - will restart program\n";
for (int i = 1; i <= 80; i++) { ::cout << "\xC4"; }
::cout << " b - back\n"
<< " Type here: ";
::cin >> mainCommand;
}
if (mainCommand == "1") { mode = 1; } //First mode
if (mainCommand == "2") { mode = 2; } //Second mode
if ((mainCommand == "stop") | (stop == true)) { mode = 3; } //Third mode (emergency stop)
if ((mainCommand == "res") | (mainCommand == "b")) { restartProgram = true; }
switch (mode)
{
case 1: { firstMode(); break; }
case 2: { secondMode(); break; }
case 3: { thirdMode(); break; }
default:
{
welcomeTitle();
::cout << "Console: Error" << endl;
break;
}
}
if (stop == true) { thirdMode(); break; }
if (res == true) { restartProgram = true; }
res = false;
stop = false;
} while (restartProgram != false);
::cout << "Console: Program will end" << endl;
::system("PAUSE");
return 0;
}
|