MCPcopy Create free account
hub / github.com/Kitware/VTK / GetFieldIndex

Method GetFieldIndex

IO/SQL/vtkRowQuery.cxx:26–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int vtkRowQuery::GetFieldIndex(const char* name)
27{
28 std::string lcSearchName(name);
29 std::transform(
30 lcSearchName.begin(), lcSearchName.end(), lcSearchName.begin(), (int (*)(int))tolower);
31
32 int index;
33 bool found = false;
34 for (index = 0; index < this->GetNumberOfFields(); index++)
35 {
36 if (this->CaseSensitiveFieldNames)
37 {
38 if (!strcmp(name, this->GetFieldName(index)))
39 {
40 found = true;
41 break;
42 }
43 }
44 else
45 {
46 std::string fieldName(this->GetFieldName(index));
47 std::transform(fieldName.begin(), fieldName.end(), fieldName.begin(), (int (*)(int))tolower);
48 if (lcSearchName == fieldName)
49 {
50 found = true;
51 break;
52 }
53 }
54 }
55 if (found)
56 {
57 return index;
58 }
59 return -1;
60}
61
62bool vtkRowQuery::NextRow(vtkVariantArray* rowArray)
63{

Callers 3

RequestDataMethod · 0.45
RequestDataMethod · 0.45

Calls 5

transformFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
GetNumberOfFieldsMethod · 0.45
GetFieldNameMethod · 0.45

Tested by

no test coverage detected