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

Method SetQuery

IO/SQL/vtkSQLQuery.cxx:215–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213//------------------------------------------------------------------------------
214
215bool vtkSQLQuery::SetQuery(const char* queryString)
216{
217 // This is just vtkSetStringMacro from vtkSetGet.h
218
219 vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting Query to "
220 << (queryString ? queryString : "(null)"));
221
222 if (this->Query == nullptr && queryString == nullptr)
223 {
224 return true;
225 }
226 if (this->Query && queryString && (!strcmp(this->Query, queryString)))
227 {
228 return true; // query string isn't changing
229 }
230 delete[] this->Query;
231 if (queryString)
232 {
233 size_t n = strlen(queryString) + 1;
234 char* cp1 = new char[n];
235 const char* cp2 = (queryString);
236 this->Query = cp1;
237 do
238 {
239 *cp1++ = *cp2++;
240 } while (--n);
241 }
242 else
243 {
244 this->Query = nullptr;
245 }
246 this->Modified();
247 return true;
248}
249
250// As above, this is a copy of vtkGetStringMacro from vtkGetSet.h.
251

Callers 15

~vtkSQLQueryMethod · 0.95
WriteDataMethod · 0.45
RequestDataMethod · 0.45
EffectSchemaMethod · 0.45
RequestDataMethod · 0.45
GetTablesMethod · 0.45
GetRecordMethod · 0.45
RequestDataMethod · 0.45
TestSQLiteDatabaseFunction · 0.45
TestSQLiteTableReadWriteFunction · 0.45
TestSQLGraphReaderFunction · 0.45
WriteDataMethod · 0.45

Calls 2

GetClassNameMethod · 0.45
ModifiedMethod · 0.45

Tested by 7

TestSQLiteDatabaseFunction · 0.36
TestSQLiteTableReadWriteFunction · 0.36
TestSQLGraphReaderFunction · 0.36
TestPostgreSQLDatabaseFunction · 0.36
TestQtSQLDatabaseFunction · 0.36
TestNetworkViewsFunction · 0.36