------------------------------------------------------------------------------
| 498 | |
| 499 | //------------------------------------------------------------------------------ |
| 500 | void vtkXMLCompositeDataWriter::SplitFileName() |
| 501 | { |
| 502 | std::string fileName = this->FileName; |
| 503 | std::string name; |
| 504 | |
| 505 | // Split the file name and extension from the path. |
| 506 | std::string::size_type pos = fileName.find_last_of("/\\"); |
| 507 | if (pos != std::string::npos) |
| 508 | { |
| 509 | // Keep the slash in the file path. |
| 510 | this->Internal->FilePath = fileName.substr(0, pos + 1); |
| 511 | name = fileName.substr(pos + 1); |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | this->Internal->FilePath = "./"; |
| 516 | name = fileName; |
| 517 | } |
| 518 | |
| 519 | // Split the extension from the file name. |
| 520 | pos = name.find_last_of('.'); |
| 521 | if (pos != std::string::npos) |
| 522 | { |
| 523 | this->Internal->FilePrefix = name.substr(0, pos); |
| 524 | } |
| 525 | else |
| 526 | { |
| 527 | this->Internal->FilePrefix = name; |
| 528 | |
| 529 | // Since a subdirectory is used to store the files, we need to |
| 530 | // change its name if there is no file extension. |
| 531 | this->Internal->FilePrefix += "_data"; |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | //------------------------------------------------------------------------------ |
| 536 | const char* vtkXMLCompositeDataWriter::GetFilePrefix() |