MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadAsciiInt

Method ReadAsciiInt

Utilities/DICOMParser/DICOMFile.cxx:258–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258int DICOMFile::ReadAsciiInt(int len)
259{
260 int ret = 0;
261
262 char* val = new char[len + 1];
263 this->Read(val, len);
264 val[len] = '\0';
265
266#if 0
267 //
268 // istrstream destroys the data during formatted input.
269 //
270 int len2 = static_cast<int> (strlen((char*) val));
271 char* val2 = new char[len2];
272 strncpy(val2, (char*) val, len2);
273
274 std::istrstream data(val2);
275 data >> ret;
276 delete [] val2;
277#else
278 ret = vtk::scan_int<int>(std::string_view(val, len))->value();
279#endif
280
281 std::cout << "Read ASCII int: " << ret << std::endl;
282
283 delete[] val;
284 return (ret);
285}
286
287char* DICOMFile::ReadAsciiCharArray(int len)
288{

Callers

nothing calls this directly

Calls 2

ReadMethod · 0.95
valueMethod · 0.45

Tested by

no test coverage detected