-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHdfObjCompoundDS.cpp
More file actions
executable file
·87 lines (67 loc) · 1.75 KB
/
Copy pathHdfObjCompoundDS.cpp
File metadata and controls
executable file
·87 lines (67 loc) · 1.75 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// HdfObjCompoundDS.cpp: implementation of the CCompoundDS class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "HDFPlugin.h"
#include "HdfObjCompoundDS.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCompoundDS::CCompoundDS(CFileFormat* fileformat, LPCTSTR name, LPCTSTR path)
:CDataset(fileformat, name, path)
{
m_nType = HDF_DATASET_COMPOUND;
m_pMemberNames = NULL;
m_pMemberTypes = NULL;
m_pMemberOrders = NULL;
}
CCompoundDS::~CCompoundDS()
{
if (m_pMemberNames) free(m_pMemberNames);
if (m_pMemberTypes) free(m_pMemberTypes);
if (m_pMemberOrders) free(m_pMemberOrders);
}
LPCTSTR CCompoundDS::GetMemberName(int index)
{
if (m_pMemberNames && index < m_nMembers)
return (LPCSTR)m_pMemberNames[index];
return NULL;
}
CString CCompoundDS::ValueToStr(int row, int col, CString strValue)
{
return strValue;
}
CString CCompoundDS::GetObjInfo()
{
if (!m_ObjInfo.IsEmpty())
return m_ObjInfo;
if (m_nRank < 0) Init();
char str[10];
m_ObjInfo += "\"";
m_ObjInfo += m_pName;
m_ObjInfo += "\"";
// data space information
if (m_nRank <=0)
m_ObjInfo += "\nDataspace:\t0";
else
{
m_ObjInfo += "\n";
sprintf(str, "%d", m_pDims[0]);
m_ObjInfo += str;
for (int i=1; i<m_nRank; i++)
{
m_ObjInfo += "x";
sprintf(str, "%d", m_pDims[i]);
m_ObjInfo += str;
}
}
// data type information
m_ObjInfo += ",\tCompound\n";
m_ObjInfo += GetDatatypeInfo();
return m_ObjInfo;
}