VTK-m  2.0
FileUtils.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_io_FileUtils_h
11 #define vtk_m_io_FileUtils_h
12 
13 #include <vtkm/io/vtkm_io_export.h>
14 
15 #include <string>
16 
17 namespace vtkm
18 {
19 namespace io
20 {
21 
23 VTKM_IO_EXPORT bool EndsWith(const std::string& value, const std::string& ending);
24 
27 VTKM_IO_EXPORT std::string Filename(const std::string& filePath);
28 
31 VTKM_IO_EXPORT std::string ParentPath(const std::string& filePath);
32 
35 VTKM_IO_EXPORT bool CreateDirectoriesFromFilePath(const std::string& filePath);
36 
40 VTKM_IO_EXPORT std::string MergePaths(const std::string& filePathPrefix,
41  const std::string& filePathSuffix);
42 
45 VTKM_IO_EXPORT std::string PrefixStringToFilename(const std::string& filePath,
46  const std::string& prefix);
47 
51 VTKM_IO_EXPORT char GetWindowsPathSeperator(const std::string& filePath);
52 
53 } // namespace vtkm::io
54 } // namespace vtkm
55 
56 #endif //vtk_m_io_FileUtils_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::io::ParentPath
VTKM_IO_EXPORT std::string ParentPath(const std::string &filePath)
Returns the directory component of a filePath string.
vtkm::io::MergePaths
VTKM_IO_EXPORT std::string MergePaths(const std::string &filePathPrefix, const std::string &filePathSuffix)
Merges two filepath strings together using the correct system filepath seperator EX: MergePaths("path...
vtkm::io::GetWindowsPathSeperator
VTKM_IO_EXPORT char GetWindowsPathSeperator(const std::string &filePath)
determine which path separator to use for windows given a provided path Should return one of either '...
vtkm::io::Filename
VTKM_IO_EXPORT std::string Filename(const std::string &filePath)
Returns the filename component of a filePath string.
vtkm::io::CreateDirectoriesFromFilePath
VTKM_IO_EXPORT bool CreateDirectoriesFromFilePath(const std::string &filePath)
Creates all the directories found in a given filePath component if they don't exist.
vtkm::io::PrefixStringToFilename
VTKM_IO_EXPORT std::string PrefixStringToFilename(const std::string &filePath, const std::string &prefix)
Takes the supplied prefix and prepends it to the filename for the provided filePath EX: PrefixStringT...
vtkm::io::EndsWith
VTKM_IO_EXPORT bool EndsWith(const std::string &value, const std::string &ending)
Checks if a provided string ends with a specific substring.