string JsonVehicleRecord::convertToJSON(const VehicleRecord &rVehicleRecord) {
	// String to represent the vehicle record object
	string json_obj_string;

	string json_license = convertString(rVehicleRecord.getLicensePlate());
	string json_type = convertString(rVehicleRecord.getVehicleType());
	string json_speed= convertFloat(rVehicleRecord.getSpeed());
	string json_date = convertDate(rVehicleRecord.getDate());

	//Adds the initial character of a json object
	json_obj_string += OBJ_START_CHAR;
	//Adds the license plate attribute
	json_obj_string += RECORD_LICEN_ATTR + ATTR_DECLA_CHAR + json_license;
	//Adds the separator character between attributes
	json_obj_string += ATTR_SEPAR_CHAR;
	//Adds the vehicle type attribute
	json_obj_string += RECORD_TYPE_ATTR + ATTR_DECLA_CHAR + json_type;
	//Adds the separator character between attributes
	json_obj_string += ATTR_SEPAR_CHAR;
	//Adds the speed attribute
	json_obj_string += RECORD_SPEED_ATTR + ATTR_DECLA_CHAR + json_speed;
	//Adds the separator character between attributes
	json_obj_string += ATTR_SEPAR_CHAR;
	//Adds the date attribute
	json_obj_string += RECORD_DATE_ATTR + ATTR_DECLA_CHAR + json_date;
	//Adds the end character of a json object
	json_obj_string += OBJ_END_CHAR;

	return json_obj_string;
}
예제 #2
0
파일: date.c 프로젝트: JamesLinus/xinu
/**
 * Print the current date and time based on passed timezone.
 * @param dt date time (seconds since Jan. 1, 1900)
 * @param timezone timezone offset in hours
 */
void printDateTZ(uint dt, char timezone)
{
    struct time t;
    int tz;
    convertDate(&t, dt + (timezone * SECS_IN_HOUR));

    if (1 == t.is_dst)
    {
        convertDate(&t, dt + ((timezone + 1) * SECS_IN_HOUR));
    }

    tz = timezone;
    tz += (tz < 0) ? 24 : 0;

    printf("%02d:%02d:%02d %s%s %s, %s %d, %d\n",
           t.hour, t.minute, t.second, tz_names[tz],
           (1 == t.is_dst) ? "DT" : "ST", weekday_names[t.weekday],
           month_names[t.month], t.monthday, 1900 + t.year);
}
/***************************************************************************//*
* @par Description:
* This function is called by the readRecord function and is used to check the
* birth date field in the record. It calls the function converDate to convert
* the binary record entry to a usuable date. It first checks the month for 
* being between 1 and 12 inclusive. Then it calls the check day function that
* checks the number day based on what the month is. Finally it checks to see 
* if the year is between 1900 and 2013. An invalid month flags errors[7], an 
* invalid day flags errors[8], and an invalid year flags errors[9]. Returns 
* to checkRecord.
*
*
* @param[in] record - a structure that holds a record and its contents.
* @param[in] errors - a boolean array that holds what errors have been found.
*
*
******************************************************************************/
void checkBirthDate ( Record *record, bool errors[] )
{
    int temp1, temp2, temp3;
    convertDate ( temp1, temp2, temp3, record, 1 );
    if ( temp1 < 1 || temp1 > 12 )          //Month
        errors[7] = true;
    checkDay ( temp1, temp2, errors, 0 );   //Day
    if ( temp3 < 1900 || temp3 > 2013 )     //Year
        errors[9] = true;
}
/***************************************************************************//*
* @par Description:
* This function is called by the readRecord function and is used to check the
* License date field in the record. It calls the function converDate to convert
* the binary record entry to a usuable date. It first checks the month for
* being between 1 and 12 inclusive. Then it calls the check day function that
* checks the number day based on what the month is. Finally it checks to see if
* the year is between 1900 and 2013. An invalid month flags errors[10], an
* invalid day flags errors[11], and an invalid year flags errors[12]. Returns
* to checkRecord.
*
*
* @param[in] record - a structure that holds a record and its contents.
* @param[in] errors - a boolean array that holds what errors have been found.
*
*
******************************************************************************/
void checkLicenseDate ( Record *record, bool errors[] )
{
    int temp1, temp2, temp3;
    convertDate ( temp1, temp2, temp3, record, 2 );
    if ( temp1 < 1 || temp1 > 12 )          //Month
        errors[10] = true;
    checkDay ( temp1, temp2, errors, 1 );   //Day
    if ( temp3 < 1900 || temp3 > 2013 )     //Year
    {
        errors[12] = true;
    }
}
/***************************************************************************//*
* @par Description:
* This function is called by the readRecord function and is used to check the
* expiration date field in the record. It calls the function converDate to
* convert the binary record entry to a usuable date. It first checks the month
* for being between 1 and 12 inclusive. Then it calls the check day function
* that checks the number day based on what the month is. Finally it checks to
* see if the year is between 1900 and 2013. An invalid month flags errors[13],
* an invalid day flags errors[14], and an invalid year flags errors[15]. It
* also checks if the expiration date is after the license date and assigns
* errors[16] accordingly.
*
*
* @param[in] record - a structure that holds a record and its contents.
* @param[in] errors - a boolean array that holds what errors have been found.
*
*
******************************************************************************/
void checkExpirationDate ( Record *record, bool errors[] )
{
    int temp1, temp2, temp3;
    int tempLic1, tempLic2, tempLic3;       //Temp ints for license date
    convertDate ( temp1, temp2, temp3, record, 3 );
    if ( temp1 < 1 || temp1 > 12 )          //Month
        errors[13] = true;
    checkDay ( temp1, temp2, errors, 2 );   //Day
    if ( temp3 < 1900 || temp3 > 2013 )     //Year
    {
        errors[15] = true;
    }
    convertDate ( tempLic1, tempLic2, tempLic3, record, 2 );

    //Check that expiration is after license.
    if ( tempLic3 > temp3 )
        errors[16] = true;
    if ( tempLic3 == temp3 && tempLic1 > temp1 )
        errors[16] = true;
    if ( tempLic3 == temp3 && tempLic1 == temp1 && tempLic2 > temp2 )
        errors[16] = true;
}
예제 #6
0
QuantLib::Date convert2<QuantLib::Date, property_t>(const property_t& c) {
    return convertDate(c);
}
//--------------------------------------------------------------
void testApp::readAndParseCSV(Company &c) 
{
    string line;
    int pos;
    int index = 0; 
    int lineIndex = 0;
    
    ifstream in("data/ge.csv");
    if (!in.is_open())
    {
        printf("can't open the file");
        return;
    }
    
    while ( getline( in, line ) ) {
        index = 0;
        // init stock entry
        stock_entry entry = STOCK_ENTRY_DEFAULT;
        // skip the first line
        if ( lineIndex > 0) {
            while ( (pos = line.find(',')) >= 0 || index == 6 ) {
                string field = line.substr(0, pos);
                line = line.substr(pos+1);
                //array->push_back(field);
                switch (index) {
                    case STOCK_DATE:
                        //remove all the quotation marks
                        //fyi: string parsing and scrubbing is FUGLY in C
                        field.erase( remove(field.begin(), field.end(), '\"'), field.end() );
                        //convert string date into long date (e.g time in seconds since the epoch)
                        entry.date = convertDate(field);
                        //lets remember human date for error checking, just in case
                        entry.humanDate = field;
                        
                        break;
                    case STOCK_OPEN:
                        entry.open = atof(field.c_str());
                        break;
                    case STOCK_HIGH:
                        entry.high = atof(field.c_str());
                        break;
                    case STOCK_LOW:
                        entry.low = atof(field.c_str());
                        break;
                    case STOCK_CLOSE:
                        entry.close = atof(field.c_str());
                        break;
                    case STOCK_VOLUME:
                        entry.volume = atoi(field.c_str());
                        break;
                    case STOCK_ADJCLOSE:
                        entry.adjClose = atof(field.c_str());
                        break;
                    default:
                        break;
                }
                //cout << index << ": " << field << endl;    //debugging
                
                index++;
                //cout << "\tline: " << line << ", index: " << index << endl;   //debugging
            }
        }
        if(entry.date != 0) {
            c.history.push_back(entry);
        }
        cout << endl;
        lineIndex++;
    }
    
    return;
}
QVariant TelegramMembersListModel::data(const QModelIndex &index, int role) const
{
    QVariant result;
    const TelegramChatsMemebrsListModelItem item = id(index);
    switch(role)
    {
    case RoleDate:
        result = QDateTime::fromTime_t(item.date);
        break;
    case RoleInviter:
        result = QVariant::fromValue<UserObject*>(item.inviter.data());
        break;
    case RoleUser:
        result = QVariant::fromValue<UserObject*>(item.user.data());
        break;
    case RolePeer:
        result = QVariant::fromValue<InputPeerObject*>(item.peer.data());
        break;
    case RoleKickedBy:
        result = QVariant::fromValue<UserObject*>(item.kicker.data());
        break;
    case RoleStatus:
        result = TelegramTools::userStatus(item.user, [this](const QDateTime &dt){
            return convertDate(dt);
        });
        break;
    case RoleType:
        result = static_cast<int>(TypeUnknown);
        if(item.channelClassType)
        {
            switch(item.channelClassType)
            {
            case ChannelParticipant::typeChannelParticipant:
                result = static_cast<int>(TypeNormal);
                break;
            case ChannelParticipant::typeChannelParticipantCreator:
                result = static_cast<int>(TypeCreator);
                break;
            case ChannelParticipant::typeChannelParticipantEditor:
                result = static_cast<int>(TypeEditor);
                break;
            case ChannelParticipant::typeChannelParticipantKicked:
                result = static_cast<int>(TypeKicked);
                break;
            case ChannelParticipant::typeChannelParticipantModerator:
                result = static_cast<int>(TypeModerator);
                break;
            case ChannelParticipant::typeChannelParticipantSelf:
                result = static_cast<int>(TypeSelf);
                break;
            }
        }
        else
        if(item.chatClassType)
        {
            switch(item.chatClassType)
            {
            case ChatParticipant::typeChatParticipant:
                result = static_cast<int>(TypeNormal);
                break;
            case ChatParticipant::typeChatParticipantAdmin:
                result = static_cast<int>(TypeAdmin);
                break;
            case ChatParticipant::typeChatParticipantCreator:
                result = static_cast<int>(TypeCreator);
                break;
            }
        }
        break;
    }

    return result;
}
예제 #9
0
QuantLib::Date convert2<QuantLib::Date, ConvertOper>(const ConvertOper& c) {
    return convertDate(c);
}
예제 #10
0
qint64 SialanCalendarConverter::dateYear(const QDate &date)
{
    return convertDate(date).year;
}
예제 #11
0
int SialanCalendarConverter::dateDay(const QDate &date)
{
    return convertDate(date).day;
}
예제 #12
0
int SialanCalendarConverter::dateMonth(const QDate &date)
{
    return convertDate(date).month;
}
예제 #13
0
static int updateCertificate( INOUT PKCS11_INFO *pkcs11Info, 
							  IN_HANDLE const CRYPT_HANDLE iCryptHandle,
							  const BOOLEAN isLeafCert )
	{
	static const CK_OBJECT_CLASS certClass = CKO_CERTIFICATE;
	static const CK_CERTIFICATE_TYPE certType = CKC_X_509;
	static const CK_BBOOL bTrue = TRUE;
	CK_DATE startDate, endDate;
	CK_ATTRIBUTE certTemplate[] = {
		{ CKA_CLASS, ( CK_VOID_PTR ) &certClass, sizeof( CK_OBJECT_CLASS ) },
		{ CKA_CERTIFICATE_TYPE, ( CK_VOID_PTR ) &certType, sizeof( CK_CERTIFICATE_TYPE ) },
		{ CKA_TOKEN, ( CK_VOID_PTR ) &bTrue, sizeof( CK_BBOOL ) },
		{ CKA_ID, NULL_PTR, 0 },
		{ CKA_SUBJECT, NULL_PTR, 0 },
		{ CKA_ISSUER, NULL_PTR, 0 },
		{ CKA_SERIAL_NUMBER, NULL_PTR, 0 },
		{ CKA_VALUE, NULL_PTR, 0 },
		/* Optional fields, filled in if required and the driver supports this */
		{ CKA_NONE, NULL_PTR, 0 },	/*  8 */
		{ CKA_NONE, NULL_PTR, 0 },	/*  9 */
		{ CKA_NONE, NULL_PTR, 0 },	/* 10 */
		{ CKA_NONE, NULL_PTR, 0 },	/* 11 */
		};
	CK_OBJECT_HANDLE hObject;
	CK_RV status;
	MESSAGE_DATA msgData;
	DYNBUF subjectDB, iAndSDB, certDB;
	BYTE keyID[ CRYPT_MAX_HASHSIZE + 8 ];
	BOOLEAN hasURL = FALSE;
	time_t theTime;
	char label[ CRYPT_MAX_TEXTSIZE + 8 ], uri[ MAX_URL_SIZE + 8 ];
	int templateCount = 8, cryptStatus;

	assert( isWritePtr( pkcs11Info, sizeof( PKCS11_INFO ) ) );

	REQUIRES( isHandleRangeValid( iCryptHandle ) );

	/* Get the keyID from the certificate */
	setMessageData( &msgData, keyID, CRYPT_MAX_HASHSIZE );
	cryptStatus = krnlSendMessage( iCryptHandle, IMESSAGE_GETATTRIBUTE_S,
								   &msgData, CRYPT_IATTRIBUTE_KEYID );
	if( cryptStatusError( cryptStatus ) )
		return( CRYPT_ARGERROR_NUM1 );
	certTemplate[ 3 ].pValue = msgData.data;
	certTemplate[ 3 ].ulValueLen = msgData.length;

	/* If it's a leaf certificate, use the keyID to locate the corresponding 
	   public or private key object.  This is used as a check to ensure that 
	   the certificate corresponds to a key in the device.  In theory this 
	   would allow us to read the label from the key so that we can reuse it 
	   for the certificate, but there doesn't seem to be any good reason for 
	   this and it could lead to problems with multiple certificates with the 
	   same labels so we don't do it */
	if( isLeafCert )
		{
		static const CK_OBJECT_CLASS privkeyClass = CKO_PRIVATE_KEY;
		static const CK_OBJECT_CLASS pubkeyClass = CKO_PUBLIC_KEY;
		CK_ATTRIBUTE keyTemplate[] = {
			{ CKA_CLASS, ( CK_VOID_PTR ) &privkeyClass, sizeof( CK_OBJECT_CLASS ) },
			{ CKA_ID, NULL_PTR, 0 }
			};

		keyTemplate[ 1 ].pValue = certTemplate[ 3 ].pValue;
		keyTemplate[ 1 ].ulValueLen = certTemplate[ 3 ].ulValueLen;
		cryptStatus = findObject( pkcs11Info, &hObject, keyTemplate, 2 );
		if( cryptStatusError( cryptStatus ) )
			{
			/* Couldn't find a private key with this ID, try for a public key */
			keyTemplate[ 0 ].pValue = ( CK_VOID_PTR ) &pubkeyClass;
			cryptStatus = findObject( pkcs11Info, &hObject, keyTemplate, 2 );
			}
		if( cryptStatusError( cryptStatus ) )
			return( CRYPT_ARGERROR_NUM1 );
		}

	/* Get the validFrom and validTo dates.  These aren't currently used for
	   anything, but could be used in the future to handle superceded 
	   certificates in the same way that it's done for PKCS #15 keysets */
	setMessageData( &msgData, &theTime, sizeof( time_t ) );
	cryptStatus = krnlSendMessage( iCryptHandle, IMESSAGE_GETATTRIBUTE_S,
								   &msgData, CRYPT_CERTINFO_VALIDFROM );
	if( cryptStatusOK( cryptStatus ) )
		{
		convertDate( &startDate, theTime );
		setMessageData( &msgData, &theTime, sizeof( time_t ) );
		cryptStatus = krnlSendMessage( iCryptHandle, IMESSAGE_GETATTRIBUTE_S,
									   &msgData, CRYPT_CERTINFO_VALIDTO );
		}
	if( cryptStatusError( cryptStatus ) )
		return( cryptStatus );
	convertDate( &endDate, theTime );

	/* Get the subjectName and issuerAndSerialNumber from the certificate */
	cryptStatus = dynCreate( &subjectDB, iCryptHandle, 
							 CRYPT_IATTRIBUTE_SUBJECT );
	if( cryptStatusError( cryptStatus ) )
		return( cryptStatus );
	cryptStatus = dynCreate( &iAndSDB, iCryptHandle, 
							 CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER );
	if( cryptStatusError( cryptStatus ) )
		{
		dynDestroy( &subjectDB );
		return( cryptStatus );
		}
	certTemplate[ 4 ].pValue = dynData( subjectDB );
	certTemplate[ 4 ].ulValueLen = dynLength( subjectDB );
	cryptStatus = addIAndSToTemplate( &certTemplate[ 5 ], dynData( iAndSDB ), 
									  dynLength( iAndSDB ) );
	if( cryptStatusError( cryptStatus ) )
		{
		dynDestroy( &subjectDB );
		dynDestroy( &iAndSDB );
		return( cryptStatus );
		}

	/* Get the certificate data */
	cryptStatus = dynCreateCert( &certDB, iCryptHandle, 
								 CRYPT_CERTFORMAT_CERTIFICATE );
	if( cryptStatusError( cryptStatus ) )
		{
		dynDestroy( &subjectDB );
		dynDestroy( &iAndSDB );
		return( cryptStatus );
		}
	certTemplate[ 7 ].pValue = dynData( certDB );
	certTemplate[ 7 ].ulValueLen = dynLength( certDB );

	/* Get the certificate holder name (label) from the certificate if 
	  available */
	setMessageData( &msgData, label, CRYPT_MAX_TEXTSIZE  );
	cryptStatus = krnlSendMessage( iCryptHandle, IMESSAGE_GETATTRIBUTE_S,
								   &msgData, CRYPT_IATTRIBUTE_HOLDERNAME );
	if( cryptStatusOK( cryptStatus ) )
		{
		/* We've found a holder name, use it as the certificate object 
		   label */
		addTemplateValue( certTemplate[ templateCount ], 
						  CKA_LABEL, msgData.data, msgData.length );
		templateCount++;
		}

	/* Add the certificate dates.  These have to be located between the 
	   label and the URI so that we can selectively back out the attributes 
	   that don't work for this driver, see the comments further down for 
	   more details */
	addTemplateValue( certTemplate[ templateCount ], 
					  CKA_START_DATE, ( CK_VOID_PTR ) &startDate, sizeof( CK_DATE ) );
	templateCount++;
	addTemplateValue( certTemplate[ templateCount ], 
					  CKA_END_DATE, ( CK_VOID_PTR ) &endDate, sizeof( CK_DATE ) );
	templateCount++;

	/* Get the URI from the certificate if available */
	setMessageData( &msgData, uri, MAX_URL_SIZE );
	cryptStatus = krnlSendMessage( iCryptHandle, IMESSAGE_GETATTRIBUTE_S,
								   &msgData, CRYPT_IATTRIBUTE_HOLDERURI );
	if( cryptStatusOK( cryptStatus ) )
		{
		/* We've found a holder URI, use it as the certificate object URL */
		addTemplateValue( certTemplate[ templateCount ], 
						  CKA_URL, msgData.data, msgData.length );
		templateCount++;
		hasURL = TRUE;
		}

	/* Reset the status value, which may contain error values due to not 
	   finding various object attributes above */
	cryptStatus = CRYPT_OK;

	/* We've finally got everything available, try and update the device with
	   the certificate data.  In theory we should also set CKA_PRIVATE = FALSE
	   but the Dallas iButton driver doesn't allow this so we have to rely on
	   drivers doing the right thing with the default setting */
	status = C_CreateObject( pkcs11Info->hSession,
							 ( CK_ATTRIBUTE_PTR ) certTemplate, templateCount, 
							 &hObject );
	if( hasURL && ( status == CKR_TEMPLATE_INCONSISTENT || \
					status == CKR_ATTRIBUTE_TYPE_INVALID ) )
		{
		/* Support for the PKCS #11 v2.20 attribute CKA_URL is pretty hit-
		   and-miss, some drivers from ca.2000 support it but others from 
		   ca.2007 still don't so if we get a CKR_ATTRIBUTE_TYPE_INVALID 
		   return code we try again without the CKA_URL */
		templateCount--;
		status = C_CreateObject( pkcs11Info->hSession,
								 ( CK_ATTRIBUTE_PTR ) certTemplate, 
								 templateCount, &hObject );
		}
	if( status == CKR_TEMPLATE_INCONSISTENT || \
		status == CKR_ATTRIBUTE_TYPE_INVALID )
		{
		/* Even support for dates is hit-and-miss so if we're still getting
		   CKR_ATTRIBUTE_TYPE_INVALID we try again without the 
		   CKA_START_DATE/CKA_END_DATE */
		templateCount -= 2;
		status = C_CreateObject( pkcs11Info->hSession,
								 ( CK_ATTRIBUTE_PTR ) certTemplate, 
								 templateCount, &hObject );
		}
	if( status != CKR_OK )
		cryptStatus = pkcs11MapError( status, CRYPT_ERROR_FAILED );

	/* Clean up */
	dynDestroy( &subjectDB );
	dynDestroy( &iAndSDB );
	dynDestroy( &certDB );
	return( cryptStatus );
	}
/***************************************************************************//*
* @par Description:
* This function is called by the readRecords function and is used to open the
* bad record output file that was passed in from the command line arguements.
* It will then check to see if the file opened correctly and safely exit if it
* did not open. After confirming file is open it will save the record that was
* also passed in from readRecords in a human readable form. After it outputs
* the record it will then check the "errors" array and output what errors
* occured under the record in a readable format. It will then close the file
* and return back to the readRecords function.
*
*
* @param[in] argv - a 2d array of characters containing the arguments.
* @param[in] record - a structure that holds a record and its contents.
* @param[in] errors - a boolean array that holds what errors have been found.
*
*
******************************************************************************/
void saveBadRecord ( Record *record, char *argv1[], bool errors[] )
{
    int i = 0;
    int temp1, temp2, temp3;
    int cityStateZipSize;
    string tempstring;
    ofstream badData;
    ostringstream convert5;
    ostringstream convert4;
    //Open and Check File
    badData.open ( argv1[3], ios::app | ios ::out );
    if ( badData.is_open() == false )
    {
        cout << "Bad Entry File Could Not Be Opened" << endl;
        safeExit ( record );
    }
    //Print Bad Entry with formatting
    //Name
    badData << record[0].name;
    tempstring = record[0].name;
    temp1 = 30 - tempstring.length();
    for ( i = 0; i < temp1; i++ )
    {
        badData << " ";
    }
    i = 0;
    //BirthDate
    convertDate ( temp1, temp2, temp3, record, 1 );
    badData << "Birth Date:      ";
    badData << temp1 << "/" << temp2 << "/" << temp3;
    badData << endl;
    //Address
    badData << record[0].address;
    tempstring = record[0].address;
    temp1 = 30 - tempstring.length();
    for ( i = 0; i < temp1; i++ )
    {
        badData << " ";
    }
    i = 0;
    //LicensedDate
    convertDate ( temp1, temp2, temp3, record, 2 );
    badData << "License Date:    ";
    badData << temp1 << "/" << temp2 << "/" << temp3;
    badData << endl;
    //City
    tempstring = record[0].city;
    temp1 = tempstring.length();
    badData.write ( record[0].city, temp1 );
    badData << ", ";
    cityStateZipSize = temp1 + 2;
    //State
    badData.write ( record[0].state, 2 );
    badData << " ";
    cityStateZipSize = cityStateZipSize + 3;
    //ZipCode
    convertZipCode ( temp1, temp2, record );
    badData << temp1 << "-" << temp2;
    convert5 << temp1;
    tempstring = convert5.str();
    cityStateZipSize = cityStateZipSize + tempstring.length() + 1;
    convert4 << temp2;
    tempstring = convert4.str();
    cityStateZipSize = cityStateZipSize + tempstring.length();
    //ExpirationDate
    temp1 = 30 - cityStateZipSize;
    for ( i = 0; i < temp1; i++ )
        badData << " ";
    convertDate ( temp1, temp2, temp3, record, 3 );
    badData << "Expiration Date: ";
    badData << temp1 << "/" << temp2 << "/" << temp3;
    badData << endl;
    //Call Sign
    badData << "Call Sign: ";
    tempstring = record[0].callSign;
    tempstring.resize ( 5 );
    badData << tempstring;
    badData.flush();
    //Radio Class
    badData << "              ";
    badData << "Radio Class:     ";
    badData.write ( ( char * ) &record[0].radioClass, 1 );
    badData << endl;
    badData << endl;

    //Printing Errors

    if ( errors[0] == true )
        badData << "Name Field" << '\n' << '\t' << "-"
                << "Invalid Character in the Name Field" << endl;
    if ( errors[1] == true )
        badData << "Address Field" << '\n' << '\t' << "-"
                << "Invalid Character in the Address Field" << endl;
    if ( errors[2] == true )
        badData << "City Field" << '\n' << '\t' << "-"
                << "Invalid Character in the City Field" << endl;

    if ( errors[3] == true || errors[4] == true )
        badData << "State Field" << endl;
    if ( errors[3] == true )
        badData << '\t' << "-" << "Invalid State Code" << endl;
    if ( errors[4] == true )
        badData << '\t' << "-"
                << "First Character of the State Code not Capitalized" << endl;

    if ( errors[5] == true || errors[6] == true )
        badData << "Zip Code" << endl;
    if ( errors[5] == true )
        badData << '\t' << "-" << "Invalid 5 Digit Zip Code" << endl;
    if ( errors[6] == true )
        badData << '\t' << "-" << "Invalid 4 Digit Zip Code" << endl;

    if ( errors[7] == true || errors[8] == true || errors[9] == true )
        badData << "Birth Date" << endl;
    if ( errors[7] == true )
        badData << '\t' << "-" << "Invalid Month in Birthday" << endl;
    if ( errors[8] == true )
        badData << '\t' << "-" << "Invalid Day in Birthday" << endl;
    if ( errors[9] == true )
        badData << '\t' << "-" << "Invalid Year in Birthday" << endl;

    if ( errors[10] == true || errors[11] == true || errors[12] == true )
        badData << "License Date" << endl;
    if ( errors[10] == true )
        badData << '\t' << "-" << "Invalid Month in License Date" << endl;
    if ( errors[11] == true )
        badData << '\t' << "-" << "Invalid Day in License Date" << endl;
    if ( errors[12] == true )
        badData << '\t' << "-" << "Invalid Year in License Date" << endl;

    if ( errors[13] == true || errors[14] == true || errors[15] == true 
							|| errors[16] == true )
        badData << "Expiration Date" << endl;
    if ( errors[13] == true )
        badData << '\t' << "-" << "Invalid Month in Expiration Date" << endl;
    if ( errors[14] == true )
        badData << '\t' << "-" << "Invalid Day in Expiration Date" << endl;
    if ( errors[15] == true )
        badData << '\t' << "-" << "Invalid Year in Expiration Date" << endl;
    if ( errors[16] == true )
        badData << '\t' << "-" << "Expiration Date is not After License Date"
				<< endl;

    if ( errors[17] == true )
        badData << "Radio Class" << '\n' << '\t' << "-" 
				<< "Radio Class Code is Invalid" << endl;

    if ( errors[18] == true || errors[19] == true || errors[20] == true 
							|| errors[21] == true )
        badData << "Call Sign" << endl;
    if ( errors[18] == true )
        badData << '\t' << "-" << "Invalid First Character in Call Sign" 
				<< endl;
    if ( errors[19] == true )
        badData << '\t' << "-" 
				<< "Invalid Second, Fourth, and/or Fifth Character" << endl;
    if ( errors[20] == true )
        badData << '\t' << "-" << "Invalid Digit in Call Sign" << endl;
    if ( errors[21] == true )
        badData << '\t' << "-" << "Call Sign not Upper Case" << endl;
    badData << endl;
    badData << "---------------------------------------------" << endl;
    badData << endl;

    badData.close();
}