| 94 | |
| 95 | |
| 96 | int |
| 97 | DatabaseStream::setDatabase(FE_Datastore &database, const char *tName) |
| 98 | { |
| 99 | if (tName == 0 || strlen(tName) == 0) { |
| 100 | opserr << "DatabaseStream::DatabaseStream - no tableName passed\n"; |
| 101 | return -1; |
| 102 | } |
| 103 | |
| 104 | if (tableName != 0) |
| 105 | delete [] tableName; |
| 106 | |
| 107 | tableName = new char [strlen(tName)+1]; |
| 108 | strcpy(tableName, tName); |
| 109 | if (tableName == 0) { |
| 110 | opserr << "DatabaseStream::DatabaseStream - out of memory creating copy of tableName: " << tName << endln; |
| 111 | return -1; |
| 112 | } |
| 113 | |
| 114 | theDatabase = &database; |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | int |