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

Method BindBlobParameter

IO/SQL/vtkSQLiteQuery.cxx:733–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731//------------------------------------------------------------------------------
732
733bool vtkSQLiteQuery::BindBlobParameter(int index, const void* data, int length)
734{
735 if (!this->Private->Statement)
736 {
737 vtkErrorMacro(<< "No statement available. Did you forget to call SetQuery?");
738 return false;
739 }
740
741 if (this->Active)
742 {
743 this->Active = false;
744 sqlite3_reset(this->Private->Statement);
745 }
746
747 int status =
748 sqlite3_bind_blob(this->Private->Statement, index + 1, data, length, SQLITE_TRANSIENT);
749
750 if (status != SQLITE_OK)
751 {
752 std::ostringstream errormessage;
753 errormessage << "sqlite_bind_blob returned error: " << status;
754 this->SetLastErrorText(errormessage.str().c_str());
755 vtkErrorMacro(<< this->GetLastErrorText());
756 return false;
757 }
758 return true;
759}
760
761//------------------------------------------------------------------------------
762

Callers 1

BindParameterMethod · 0.95

Calls 3

GetLastErrorTextMethod · 0.95
c_strMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected