本文整理汇总了C++中DataSetHeader::GetColumnInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSetHeader::GetColumnInfo方法的具体用法?C++ DataSetHeader::GetColumnInfo怎么用?C++ DataSetHeader::GetColumnInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSetHeader
的用法示例。
在下文中一共展示了DataSetHeader::GetColumnInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteColumnTypes
void DataSetHeaderWriter::WriteColumnTypes(std::ofstream &os, const DataSetHeader &dc) const
{
int32_t sz = dc.GetColumnCnt();
// Write the types
for(int i = 0; i < sz; i++)
{
ColumnInfo col = dc.GetColumnInfo(i);
FileOutput::WriteString16(os, col.GetName());
FileOutput::WriteInt8(os, col.GetColumnType());
FileOutput::WriteInt32(os, col.GetSize());
}
}
示例2: AssignmentTest
void DataSetHeaderTest::AssignmentTest()
{
header->SetName(L"pixel data");
header->AddUShortColumn(L"Intensity");
header->SetRowCnt(101);
ParameterNameValueType t1;
t1.SetName(L"Scanner");
t1.SetValueText(L"M10");
header->AddNameValParam(t1);
ParameterNameValueType t2;
t2.SetName(L"Pixel Size");
t2.SetValueText(L"0.051");
header->AddNameValParam(t2);
DataSetHeader assignee;
assignee = *header;
// Check that the assignment worked
CPPUNIT_ASSERT(assignee.GetName() == header->GetName());
CPPUNIT_ASSERT(assignee.GetColumnCnt() == header->GetColumnCnt());
CPPUNIT_ASSERT(assignee.GetNameValParamCnt() == header->GetNameValParamCnt());
CPPUNIT_ASSERT(assignee.GetRowCnt() == header->GetRowCnt());
CPPUNIT_ASSERT(assignee.GetColumnInfo(0) == header->GetColumnInfo(0));
ParameterNameValueTypeConstIt nvpAssigneeBegin, nvpAssigneeEnd;
assignee.GetNameValIterators(nvpAssigneeBegin, nvpAssigneeEnd);
ParameterNameValueTypeConstIt nvpHeaderBegin, nvpHeaderEnd;
assignee.GetNameValIterators(nvpHeaderBegin, nvpHeaderEnd);
CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
++nvpAssigneeBegin;
++nvpHeaderBegin;
CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
++nvpAssigneeBegin;
++nvpHeaderBegin;
CPPUNIT_ASSERT(nvpAssigneeBegin == nvpAssigneeEnd);
CPPUNIT_ASSERT(nvpHeaderBegin == nvpHeaderEnd);
// TBD: no test of row offset array.
}