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

Method GetRecord

IO/SQL/vtkSQLiteDatabase.cxx:382–418  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

380
381//------------------------------------------------------------------------------
382vtkStringArray* vtkSQLiteDatabase::GetRecord(const char* table)
383{
384 vtkSQLQuery* query = this->GetQueryInstance();
385 std::string text("PRAGMA table_info ('");
386 text += table;
387 text += "')";
388
389 query->SetQuery(text.c_str());
390 bool status = query->Execute();
391 if (!status)
392 {
393 vtkErrorMacro(<< "GetRecord(" << table << "): Database returned error: "
394 << sqlite3_errmsg(this->Internal->SQLiteInstance));
395 query->Delete();
396 return nullptr;
397 }
398 else
399 {
400 // Each row in the results that come back from this query
401 // describes a single column in the table. The format of each row
402 // is as follows:
403 //
404 // columnID columnName columnType ??? defaultValue nullForbidden
405 //
406 // (I don't know what the ??? column is. It's probably maximum
407 // length.)
408 vtkStringArray* results = vtkStringArray::New();
409
410 while (query->NextRow())
411 {
412 results->InsertNextValue(query->DataValue(1).ToString());
413 }
414
415 query->Delete();
416 return results;
417 }
418}
419
420//------------------------------------------------------------------------------
421vtkStdString vtkSQLiteDatabase::GetURL()

Callers

nothing calls this directly

Calls 10

GetQueryInstanceMethod · 0.95
DeleteMethod · 0.65
NewFunction · 0.50
SetQueryMethod · 0.45
c_strMethod · 0.45
ExecuteMethod · 0.45
NextRowMethod · 0.45
InsertNextValueMethod · 0.45
ToStringMethod · 0.45
DataValueMethod · 0.45

Tested by

no test coverage detected