------------------------------------------------------------------------------
| 358 | |
| 359 | //------------------------------------------------------------------------------ |
| 360 | bool vtkPostgreSQLDatabase::ParseURL(const char* URL) |
| 361 | { |
| 362 | std::string urlstr(URL ? URL : ""); |
| 363 | std::string protocol; |
| 364 | std::string username; |
| 365 | std::string password; |
| 366 | std::string hostname; |
| 367 | std::string dataport; |
| 368 | std::string database; |
| 369 | |
| 370 | // Okay now for all the other database types get more detailed info |
| 371 | if (!vtksys::SystemTools::ParseURL( |
| 372 | urlstr, protocol, username, password, hostname, dataport, database)) |
| 373 | { |
| 374 | vtkErrorMacro("Invalid URL: \"" << urlstr << "\""); |
| 375 | return false; |
| 376 | } |
| 377 | |
| 378 | if (protocol == "psql") |
| 379 | { |
| 380 | this->SetUser(username.empty() ? nullptr : username.c_str()); |
| 381 | this->SetPassword(password.empty() ? nullptr : password.c_str()); |
| 382 | this->SetHostName(hostname.empty() ? nullptr : hostname.c_str()); |
| 383 | int port; |
| 384 | VTK_FROM_CHARS_IF_ERROR_RETURN(dataport, port, false); |
| 385 | this->SetServerPort(port); |
| 386 | this->SetDatabaseName(database.empty() ? nullptr : database.c_str()); |
| 387 | return true; |
| 388 | } |
| 389 | |
| 390 | return false; |
| 391 | } |
| 392 | |
| 393 | //------------------------------------------------------------------------------ |
| 394 | vtkStringArray* vtkPostgreSQLDatabase::GetTables() |
no test coverage detected