mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 19:13:30 +01:00
make Row field names case-insensitive
This commit is contained in:
parent
736cb1fcee
commit
2f7c6b4aa5
@ -36,6 +36,7 @@
|
||||
|
||||
#include "Poco/Data/Row.h"
|
||||
#include "Poco/Data/SimpleRowFormatter.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
@ -121,12 +122,9 @@ std::size_t Row::getPosition(const std::string& name)
|
||||
NameVec::const_iterator end = _pNames->end();
|
||||
std::size_t col = 0;
|
||||
for (; it != end; ++it, ++col)
|
||||
if (name == *it) break;
|
||||
if (0 == icompare(name, *it)) return col;
|
||||
|
||||
if (it == end)
|
||||
throw NotFoundException(name);
|
||||
|
||||
return col;
|
||||
throw NotFoundException(name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -850,6 +850,12 @@ void DataTest::testRow()
|
||||
assert (row["field3"] == 3);
|
||||
assert (row["field4"] == 4);
|
||||
|
||||
assert (row["FIELD0"] == 0);
|
||||
assert (row["FIELD1"] == 1);
|
||||
assert (row["FIELD2"] == 2);
|
||||
assert (row["FIELD3"] == 3);
|
||||
assert (row["FIELD4"] == 4);
|
||||
|
||||
assert (row[0] == 0);
|
||||
assert (row[1] == 1);
|
||||
assert (row[2] == 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user