Back to BeeGuid Source
void genCardTablePart(string exactGen, int maxLength)
{
char genOfBee[50];
/* Insert exactGen in genOfBee */
strncpy_s(genOfBee, exactGen.c_str(), exactGen.length() + 1);
char *istr;
istr = strstr(genOfBee, "+");
char exactGenOut[50];
int exactGenLen = exactGen.length() - 1;
if (istr != NULL)
{
strncpy_s(exactGenOut, genOfBee, exactGenLen);
int needAdd = maxLength - exactGenLen;
::cout << darkblue << exactGenOut;
for (int i = 1; i <= needAdd; i++)
{
::cout << " ";
}
::cout << aqua << "\xBA";
if (devMode == true) { ::cout << darkblue << "NA - " << needAdd - 1 << aqua; }
::cout << endl;
}
else
{
istr = strstr(genOfBee, "-");
if (istr != NULL)
{
strncpy_s(exactGenOut, genOfBee, exactGenLen);
int needAdd = maxLength - exactGenLen;
::cout << darkred << exactGenOut;
for (int i = 1; i <= needAdd; i++)
{
::cout << " ";
}
::cout << aqua << "\xBA";
if (devMode == true) { ::cout << darkblue << "NA - " << needAdd - 1 << aqua; }
::cout << endl;
}
else
{
int needAdd = maxLength - exactGenLen;
if (exactGen == "") { exactGen = "not found"; fileCorrupt = true; }
else
{
char cExactGen[255] = "";
strncpy_s(cExactGen, exactGen.c_str(), 1);
if (cExactGen == " ") { exactGen = "not found"; fileCorrupt = true; }
}
::cout << darkgreen << exactGen;
needAdd = maxLength - exactGen.length() + 1;
for (int i = 2; i <= needAdd; i++)
{
::cout << " ";
}
::cout << aqua << "\xBA";
if (devMode == true) { ::cout << darkblue << "NA - " << needAdd - 1 << aqua; }
::cout << endl;
}
}
}
|