------------------------------------------------------------------------------
| 313 | |
| 314 | //------------------------------------------------------------------------------ |
| 315 | bool vtkMySQLDatabase::ParseURL(const char* URL) |
| 316 | { |
| 317 | std::string urlstr(URL ? URL : ""); |
| 318 | std::string protocol; |
| 319 | std::string username; |
| 320 | std::string password; |
| 321 | std::string hostname; |
| 322 | std::string dataport; |
| 323 | std::string database; |
| 324 | |
| 325 | if (!vtksys::SystemTools::ParseURL( |
| 326 | urlstr, protocol, username, password, hostname, dataport, database)) |
| 327 | { |
| 328 | vtkGenericWarningMacro("Invalid URL: \"" << urlstr << "\""); |
| 329 | return false; |
| 330 | } |
| 331 | |
| 332 | if (protocol == "mysql") |
| 333 | { |
| 334 | if (!username.empty()) |
| 335 | { |
| 336 | this->SetUser(username.c_str()); |
| 337 | } |
| 338 | if (!password.empty()) |
| 339 | { |
| 340 | this->SetPassword(password.c_str()); |
| 341 | } |
| 342 | if (!dataport.empty()) |
| 343 | { |
| 344 | int port; |
| 345 | VTK_FROM_CHARS_IF_ERROR_RETURN(dataport, port, false); |
| 346 | this->SetServerPort(port); |
| 347 | } |
| 348 | this->SetHostName(hostname.c_str()); |
| 349 | this->SetDatabaseName(database.c_str()); |
| 350 | return true; |
| 351 | } |
| 352 | return false; |
| 353 | } |
| 354 | |
| 355 | //------------------------------------------------------------------------------ |
| 356 | vtkStdString vtkMySQLDatabase::GetColumnSpecification( |
no test coverage detected