-
Notifications
You must be signed in to change notification settings - Fork 1
/
StataHeader.cpp
68 lines (53 loc) · 1.28 KB
/
StataHeader.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* File: StataHeader.cpp
* Author: adrianmo
*
* Created on May 19, 2014, 4:41 PM
*/
#include "StataHeader.h"
StataHeader::StataHeader()
{
variables = 0;
observations = 0;
}
StataHeader::StataHeader(const StataHeader& orig)
{
}
StataHeader::~StataHeader()
{
}
string StataHeader::showHeader() {
std::ostringstream metadata;
string textRelease;
switch(fileRelease)
{
case R119:
textRelease = "119";
break;
case R118:
textRelease = "118";
break;
case R117:
textRelease = "117";
break;
case R115:
textRelease = "115";
break;
case R114:
textRelease = "114";
break;
case R113:
textRelease = "113";
break;
case R112:
textRelease = "112";
break;
}
metadata << "[Variables]: " << variables << endl
<< "[Observations]: " << observations << endl
<< "[Time Stamp]: " << ts << endl
<< "[Data Label]: " << datalabel << endl
<< "[Release]: " << textRelease << endl
<< "[Bitness]: " << (fileByteorder ? "Big Endian" : "Little Endian" ) << endl;
return string(metadata.str());
}