MCPcopy Create free account
hub / github.com/DOI-USGS/ISIS3 / Size

Method Size

isis/src/base/objs/TextFile/TextFile.cpp:652–673  ·  view source on GitHub ↗

* Counts number of bytes in file. * * @return streamsize */

Source from the content-addressed store, hash-verified

650 * @return streamsize
651 */
652 streamsize TextFile::Size() {
653 OpenChk(true);
654
655 // Size () --- returns file size in bytes
656
657 bool eofStat = false;
658 if(p_stream.eof()) { // current state of stream is 'eof'
659 eofStat = true;
660 p_stream.clear();
661 }
662
663 streampos savePos = p_stream.tellg();
664 p_stream.seekg(0, ios_base::end);
665 streamsize bytes = p_stream.tellg();
666 p_stream.seekg(savePos, ios_base::beg);
667
668 if(eofStat) { // restore current state of stream 'eof'
669 p_stream.seekg(0, ios_base::end);
670 p_stream.get();
671 }
672 return bytes;
673 }
674} // end namespace isis
675
676

Callers 10

CubeStretchMethod · 0.45
SetCoefficientsMethod · 0.45
CSMCameraMethod · 0.45
mainFunction · 0.45
fromBlobMethod · 0.45
HistoryMethod · 0.45
writeLabelsMethod · 0.45
fromBlobMethod · 0.45
csminitFunction · 0.45
overlapstatsFunction · 0.45

Calls 2

clearMethod · 0.45
getMethod · 0.45

Tested by 1

mainFunction · 0.36