Viskores  1.0
FileUtils.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_io_FileUtils_h
19 #define viskores_io_FileUtils_h
20 
22 
23 #include <string>
24 
25 namespace viskores
26 {
27 namespace io
28 {
29 
31 VISKORES_IO_EXPORT bool EndsWith(const std::string& value, const std::string& ending);
32 
35 VISKORES_IO_EXPORT std::string Filename(const std::string& filePath);
36 
39 VISKORES_IO_EXPORT std::string ParentPath(const std::string& filePath);
40 
43 VISKORES_IO_EXPORT bool CreateDirectoriesFromFilePath(const std::string& filePath);
44 
48 VISKORES_IO_EXPORT std::string MergePaths(const std::string& filePathPrefix,
49  const std::string& filePathSuffix);
50 
53 VISKORES_IO_EXPORT std::string PrefixStringToFilename(const std::string& filePath,
54  const std::string& prefix);
55 
59 VISKORES_IO_EXPORT char GetWindowsPathSeperator(const std::string& filePath);
60 
61 } // namespace viskores::io
62 } // namespace viskores
63 
64 #endif //viskores_io_FileUtils_h
viskores::io::Filename
std::string Filename(const std::string &filePath)
Returns the filename component of a filePath string.
viskores_io_export.h
viskores::io::GetWindowsPathSeperator
char GetWindowsPathSeperator(const std::string &filePath)
determine which path separator to use for windows given a provided path Should return one of either '...
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::io::MergePaths
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...
viskores::io::ParentPath
std::string ParentPath(const std::string &filePath)
Returns the directory component of a filePath string.
viskores::io::PrefixStringToFilename
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...
viskores::io::EndsWith
bool EndsWith(const std::string &value, const std::string &ending)
Checks if a provided string ends with a specific substring.
viskores::io::CreateDirectoriesFromFilePath
bool CreateDirectoriesFromFilePath(const std::string &filePath)
Creates all the directories found in a given filePath component if they don't exist.