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

Method GetIndexColumnNameFromHandle

IO/SQL/vtkSQLDatabaseSchema.cxx:404–431  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

402
403//------------------------------------------------------------------------------
404const char* vtkSQLDatabaseSchema::GetIndexColumnNameFromHandle(
405 int tblHandle, int idxHandle, int cnmHandle)
406{
407 if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables())
408 {
409 vtkErrorMacro("Cannot get column name of an index in non-existent table " << tblHandle);
410 return nullptr;
411 }
412
413 if (idxHandle < 0 ||
414 idxHandle >= static_cast<int>(this->Internals->Tables[tblHandle].Indices.size()))
415 {
416 vtkErrorMacro(
417 "Cannot get column name of non-existent index " << idxHandle << " in table " << tblHandle);
418 return nullptr;
419 }
420
421 if (cnmHandle < 0 ||
422 cnmHandle >=
423 static_cast<int>(this->Internals->Tables[tblHandle].Indices[idxHandle].ColumnNames.size()))
424 {
425 vtkErrorMacro("Cannot get column name of non-existent column "
426 << cnmHandle << " of index " << idxHandle << " in table " << tblHandle);
427 return nullptr;
428 }
429
430 return this->Internals->Tables[tblHandle].Indices[idxHandle].ColumnNames[cnmHandle].c_str();
431}
432
433//------------------------------------------------------------------------------
434int vtkSQLDatabaseSchema::GetColumnHandleFromName(const char* tblName, const char* colName)

Callers 4

GetIndexSpecificationMethod · 0.80
GetIndexSpecificationMethod · 0.80
TestMySQLDatabaseFunction · 0.80
GetIndexSpecificationMethod · 0.80

Calls 3

GetNumberOfTablesMethod · 0.95
sizeMethod · 0.45
c_strMethod · 0.45

Tested by 1

TestMySQLDatabaseFunction · 0.64