bool WriteScriptDescriptor::SaveFile() { if (IsFileOpen() == false) { PRINT_ERROR << "could not save the file because it was not open" << std::endl; return false; } if (SCRIPT_DEBUG && IsErrorDetected()) { PRINT_WARNING << "SCRIPT WARNING: In WriteScriptDescriptor::CloseFile(), the file " << _filename << " had error messages remaining. They are as follows:" << std::endl << _error_messages.str() << std::endl; } _outfile.flush(); return _outfile.bad(); }
void ReadScriptDescriptor::CloseFile() { if (IsFileOpen() == false) { IF_PRINT_WARNING(SCRIPT_DEBUG) << "could not close the file because it was not open." << endl; return; } // Probably not needed. Script errors should be printed immediately. if (IsErrorDetected()) { IF_PRINT_WARNING(SCRIPT_DEBUG) << "the file " << _filename << " had the following error messages remaining:" << endl; cerr << _error_messages.str() << endl; } _lstack = NULL; _error_messages.clear(); _open_tables.clear(); _access_mode = SCRIPT_CLOSED; ScriptManager->_RemoveOpenFile(this); }
void ModifyScriptDescriptor::CloseFile() { if (IsFileOpen() == false) { if (SCRIPT_DEBUG) cerr << "SCRIPT ERROR: ModifyScriptDescriptor::CloseFile() could not close the " << "file because it was not open." << endl; return; } if (SCRIPT_DEBUG && IsErrorDetected()) { cerr << "SCRIPT WARNING: In ModifyScriptDescriptor::CloseFile(), the file " << _filename << " had error messages remaining. They are as follows:" << endl; cerr << _error_messages.str() << endl; } _lstack = NULL; _error_messages.clear(); _open_tables.clear(); _access_mode = SCRIPT_CLOSED; ScriptManager->_RemoveOpenFile(this); }
void WriteScriptDescriptor::CloseFile() { if (IsFileOpen() == false) { IF_PRINT_WARNING(SCRIPT_DEBUG) << "SCRIPT ERROR: in WriteScriptDescriptor::CloseFile(), could not close the " << "file because it was not open." << std::endl; return; } if (SCRIPT_DEBUG && IsErrorDetected()) { PRINT_WARNING << "SCRIPT WARNING: In WriteScriptDescriptor::CloseFile(), the file " << _filename << " had error messages remaining. They are as follows:" << std::endl << _error_messages.str() << std::endl; } _outfile.close(); _error_messages.clear(); _open_tables.clear(); _access_mode = SCRIPT_CLOSED; ScriptManager->_RemoveOpenFile(this); }