本文整理汇总了C++中CsvReader::getRow方法的典型用法代码示例。如果您正苦于以下问题:C++ CsvReader::getRow方法的具体用法?C++ CsvReader::getRow怎么用?C++ CsvReader::getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsvReader
的用法示例。
在下文中一共展示了CsvReader::getRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
//.........这里部分代码省略.........
}
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(),
sTailRow.length());
}
}
EndPaint(hWnd, &ps);
break;
case WM_VSCROLL:
switch (LOWORD(wParam)){
case SB_LINEUP:
iScollPos -= 1;
break;
case SB_LINEDOWN:
iScollPos += 1;
break;
case SB_PAGEUP:
iScollPos -= cyClient / cyChar;
break;
case SB_PAGEDOWN:
iScollPos += cyClient / cyChar;
break;
case SB_THUMBPOSITION:
iScollPos = HIWORD(wParam);
break;
default:
break;
}
iScollPos =max(0, min(iScollPos, csvReader.getRowCount()));
if (iScollPos != GetScrollPos(hWnd, SB_VERT))
{
SetScrollPos(hWnd, SB_VERT, iScollPos, TRUE);
InvalidateRect(hWnd, NULL, TRUE);
}
break;
case WM_SIZE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
//InvalidateRect(hStatusbar, NULL, TRUE);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}