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

Method CheckByteCount

IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx:82–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82int vtkMultiBlockPLOT3DReaderInternals::CheckByteCount(FILE* fp)
83{
84 clearerr(fp); // clear error and EOF flags
85 fseek(fp, 0, SEEK_SET); // move to beginning
86 // Read the first integer, then skip by that many bytes, then
87 // read the value again. If the two match, it is likely that
88 // the file has byte counts.
89 int count;
90 if (!this->ReadInts(fp, 1, &count))
91 {
92 return 0;
93 }
94 if (fseek(fp, count, SEEK_CUR) != 0)
95 {
96 return 0;
97 }
98 int count2;
99 if (!this->ReadInts(fp, 1, &count2))
100 {
101 return 0;
102 }
103 if (count == count2)
104 {
105 this->Settings.HasByteCount = 1;
106 }
107 else
108 {
109 this->Settings.HasByteCount = 0;
110 }
111 return 1;
112}
113
114int vtkMultiBlockPLOT3DReaderInternals::CheckMultiGrid(FILE* fp)
115{

Callers 1

AutoDetectionCheckMethod · 0.80

Calls 1

ReadIntsMethod · 0.95

Tested by

no test coverage detected