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

Method AddOptionToTable

IO/SQL/vtkSQLDatabaseSchema.cxx:237–259  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

235
236//------------------------------------------------------------------------------
237int vtkSQLDatabaseSchema::AddOptionToTable(
238 int tblHandle, const char* optText, const char* optBackend)
239{
240 if (!optText)
241 {
242 vtkErrorMacro("Cannot add nullptr option to table " << tblHandle);
243 return -1;
244 }
245
246 if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables())
247 {
248 vtkErrorMacro("Cannot add option to non-existent table " << tblHandle);
249 return -1;
250 }
251
252 int optHandle = static_cast<int>(this->Internals->Tables[tblHandle].Options.size());
253 this->Internals->Tables[tblHandle].Options.resize(optHandle + 1);
254 vtkSQLDatabaseSchemaInternals::Option* optn =
255 &this->Internals->Tables[tblHandle].Options[optHandle];
256 optn->Text = optText;
257 optn->Backend = optBackend ? optBackend : VTK_SQL_ALLBACKENDS;
258 return optHandle;
259}
260
261//------------------------------------------------------------------------------
262int vtkSQLDatabaseSchema::GetPreambleHandleFromName(const char* preName)

Callers 2

AddOptionToTableFunction · 0.80

Calls 3

GetNumberOfTablesMethod · 0.95
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected