| 37 | #include <Message.h> |
| 38 | |
| 39 | DataOutputFileHandler::DataOutputFileHandler(const char *theFileName, |
| 40 | echoMode theEMode, |
| 41 | openMode theOMode) |
| 42 | :DataOutputHandler(DATAHANDLER_TAGS_DataOutputFileHandler), |
| 43 | fileName(0), theEchoMode(theEMode), theOpenMode(theOMode), numColumns(-1) |
| 44 | { |
| 45 | if (theFileName != 0) { |
| 46 | fileName = new char [strlen(theFileName)+1]; |
| 47 | if (fileName == 0) { |
| 48 | opserr << "DataOutputFileHandler::DataOutputFileHandler() - out of memory\n"; |
| 49 | } else |
| 50 | strcpy(fileName, theFileName); |
| 51 | } |
| 52 | |
| 53 | if (fileName != 0 && outputFile.setFile(fileName, theOpenMode) < 0) { |
| 54 | opserr << "DataOutputFileHandler::DataOutputFileHandler() - setFile() failed\n"; |
| 55 | if (fileName != 0) { |
| 56 | delete [] fileName; |
| 57 | fileName = 0; |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | DataOutputFileHandler::~DataOutputFileHandler() |
| 63 | { |