| 130 | TCL_Char ** const argv, Recorder **theRecorder); |
| 131 | |
| 132 | static OPS_Stream * |
| 133 | createOutputStream(OutputOptions &options) |
| 134 | { |
| 135 | OPS_Stream *theOutputStream = nullptr; |
| 136 | |
| 137 | // construct the DataHandler |
| 138 | if (options.filename != nullptr) { |
| 139 | if (options.eMode == OutputOptions::DATA_STREAM) { |
| 140 | theOutputStream = new DataFileStream( |
| 141 | options.filename, |
| 142 | openMode::OVERWRITE, 2, 0, |
| 143 | options.closeOnWrite, |
| 144 | options.precision, |
| 145 | options.doScientific); |
| 146 | |
| 147 | } else if (options.eMode == OutputOptions::DATA_STREAM_ADD) { |
| 148 | theOutputStream = new DataFileStreamAdd( |
| 149 | options.filename, |
| 150 | openMode::OVERWRITE, 2, 0, |
| 151 | options.closeOnWrite, |
| 152 | options.precision, |
| 153 | options.doScientific); |
| 154 | |
| 155 | } else if (options.eMode == OutputOptions::DATA_STREAM_CSV) { |
| 156 | theOutputStream = new DataFileStream( |
| 157 | options.filename, |
| 158 | openMode::OVERWRITE, 2, 1, |
| 159 | options.closeOnWrite, |
| 160 | options.precision, |
| 161 | options.doScientific); |
| 162 | |
| 163 | } else if (options.eMode == OutputOptions::XML_STREAM) { |
| 164 | theOutputStream = new XmlFileStream(options.filename); |
| 165 | |
| 166 | } else if (options.eMode == OutputOptions::BINARY_STREAM) { |
| 167 | theOutputStream = new BinaryFileStream(options.filename); |
| 168 | } |
| 169 | |
| 170 | } else if (options.eMode == OutputOptions::TCP_STREAM && options.inetAddr != 0) { |
| 171 | theOutputStream = new TCP_Stream(options.inetPort, options.inetAddr); |
| 172 | |
| 173 | } else if (options.eMode == OutputOptions::DATABASE_STREAM && options.tableName != 0) { |
| 174 | theOutputStream = new DatabaseStream(options.theDatabase, options.tableName); |
| 175 | |
| 176 | } else { |
| 177 | theOutputStream = new StandardStream(); |
| 178 | } |
| 179 | |
| 180 | theOutputStream->setPrecision(options.precision); |
| 181 | |
| 182 | return theOutputStream; |
| 183 | } |
| 184 | |
| 185 | static NodeData |
| 186 | getNodeDataFlag(const char *dataToStore, Domain& theDomain, int* dataIndex) |
no test coverage detected