本文整理汇总了C++中CsvReader::isOpened方法的典型用法代码示例。如果您正苦于以下问题:C++ CsvReader::isOpened方法的具体用法?C++ CsvReader::isOpened怎么用?C++ CsvReader::isOpened使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsvReader
的用法示例。
在下文中一共展示了CsvReader::isOpened方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
//.........这里部分代码省略.........
// Store the statusbar control handle as the user data associated with
// the parent window so that it can be retrieved for later use.
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)hStatusbar);
InitStatusbar(hStatusbar);
// Add 4 Header items
for (UINT i = 0; i < 4; i++)
{
HDITEM hdi = { 0 };
hdi.mask = HDI_WIDTH | HDI_FORMAT | HDI_TEXT;
hdi.cxy = rc.right / 4;
hdi.fmt = HDF_CENTER;
swprintf_s(szText, 200, L"Header %d", i);
hdi.pszText = szText;
hdi.cchTextMax = 200;
SendMessage(hHeader, HDM_INSERTITEM, i, (LPARAM)&hdi);
}
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
TCHAR buffer[20];
s += L"Text Height";
wsprintf(buffer, L"%d ", cyChar);
s.append(buffer);
s += L" Text Width";
wsprintf(buffer, L"%d ", cxChar);
s += buffer;
//TextOut(hdc, 0, 20, s.c_str(), s.length());
if (csvReader.isOpened()){
const int columnCount = csvReader.getHeadRow()->getColumnSize();
wstring *heads = new wstring[columnCount];
for (int i = 0; i < columnCount; i++){
heads[i].append(csvReader.getHeadRow()->getColumn(i));
}
TextOut(hdc, 0, 0, (LPWSTR)csvReader.getHeader(), lstrlen(csvReader.getHeader()));
int curStart = 0;
EditRow *per;
int count;
curStart = iScollPos;
int end = curStart + cyClient / cyChar;
for (int i = curStart ; i < end; i++){
csvReader.getRow(i,&per);
count = per->getColumnSize();
int j;
for (j = 0; j < count-1; j++){
TextOut(hdc, j*COLUMN_WIDTH, (i-curStart + 1)*cyChar, per->getColumn(j),lstrlen(per->getColumn(j)));
}
wstring sTailRow(per->getColumn(j));
int fpos = -1;
if (fpos = sTailRow.find(_T("\n"))){
sTailRow.erase(fpos, 2);
}
TextOut(hdc, j*COLUMN_WIDTH, (i - curStart + 1)*cyChar,
sTailRow.c_str(),