|
|
|
|
|
|
|
|
void TokenMatrix::Load(const char* FileName) { // Initializes the token matrix by file name. |
|
|
void TokenMatrix::Load(const char* FileName) { // Initializes the token matrix by file name. |
|
|
|
|
|
|
|
|
ifstream MatrixFile(FileName,ios::binary); // Open the file. |
|
|
ifstream MatrixFile(FileName,ios::binary); // Open the file. |
|
|
if(MatrixFile == NULL || MatrixFile.bad()) // If anything is wrong with the file |
|
|
|
|
|
throw BadFile("TokenMatrix::Load()(MatrixFile==NULL || MatrixFile.bad())"); // then throw a bad file exception. |
|
|
|
|
|
|
|
|
if(!MatrixFile.good()) // If anything is wrong with the file |
|
|
|
|
|
throw BadFile("TokenMatrix::Load()(!MatrixFile.good())"); // then throw a bad file exception. |
|
|
|
|
|
|
|
|
Load(MatrixFile); // Load the matrix from the file. |
|
|
Load(MatrixFile); // Load the matrix from the file. |
|
|
MatrixFile.close(); // Be nice and clean up our file. |
|
|
MatrixFile.close(); // Be nice and clean up our file. |