File: binaryRead.cpp

package info (click to toggle)
dmrgpp 6.06-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 113,900 kB
  • sloc: cpp: 80,986; perl: 14,772; ansic: 2,923; makefile: 83; sh: 17
file content (27 lines) | stat: -rw-r--r-- 592 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "IoBinary.h"
#include "Vector.h"

typedef std::pair<SizeType, SizeType> PairType;

int main(int argc, char* argv[])
{

	if (argc < 2)
		return 1;
	String myfile(argv[1]);
	PsimagLite::IoBinary::In fin(myfile);

	while (true) {
		String label = fin.readNextLabel();
		if (label == "NOTFOUND")
			break;
		std::cout << "label=" << label << "\n";
		char check = 0;
		SizeType total = 0;
		PairType type;
		fin.readCheckTotalAndType(check, total, type);
		int check1 = check;
		std::cout << "check=" << check1 << " total=" << total
			  << " type=" << fin.nameOfType(type) << "\n";
	}
}