Esempio n. 1
0
StrVec CsvUtil::getRowData(const int &rIRow, const std::string &rSCsvFilePath)
{
    auto tRow = std::get<1>(getFileRowColNum(rSCsvFilePath));
    
    if(rIRow > tRow) return StrVec();
    
    return  _pCsvMap->at(rSCsvFilePath).at(rIRow);
}
Esempio n. 2
0
const int CsvUtil::findValueInWithLine( const char* chValue, int iValueCol, const char* csvFilePath )
{
    Size csvSize = getFileRowColNum(csvFilePath);
	
    int iLine = -1;
    for(int i = 0; i < (int)csvSize.width; i++)
	{
        string ID = get(i, iValueCol, csvFilePath);
        if(Value(ID).asString().compare(chValue) == 0)
		{
            iLine = i;
            break;
        }
    }
	
    return iLine;
}
Esempio n. 3
0
int CsvUtil::findValueInWithLine(const std::string &rSValue, const int &rIValueCol, const std::string &rSCsvFilePath)
{
    auto iRowCount = std::get<1>(getFileRowColNum(rSCsvFilePath));
    
    auto ret = -1;
    std::string findValue(rSValue);
    
    for (int iRow = 0; iRow < iRowCount; ++iRow)
    {
        std::string tmpValue = getText(iRow, rIValueCol, rSCsvFilePath);
        if (findValue == tmpValue)
        {
            ret = iRow;
            break;
        }
    }
    return ret;
}