NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkFileHelper.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkFileHelper_h
16 #define niftkFileHelper_h
17 
19 
20 #include <string>
21 #include <vector>
22 
23 namespace niftk
24 {
25 
32 
33 
38 
39 
45 
46 
54 
55 
59 NIFTKCOMMON_WINEXPORT bool DirectoryExists(const std::string& directoryPath);
60 
61 
67 NIFTKCOMMON_WINEXPORT bool CreateDirAndParents(const std::string& directoryPath);
68 
69 
73 NIFTKCOMMON_WINEXPORT bool FileExists(const std::string& fileName);
74 
75 
79 NIFTKCOMMON_WINEXPORT bool FileDelete(const std::string& fileName);
80 
81 
85 NIFTKCOMMON_WINEXPORT bool FileIsEmpty(const std::string& fileName);
86 
87 
91 NIFTKCOMMON_WINEXPORT int FileSize(const std::string& fileName);
92 
93 
104  const std::string& filename,
105  const std::string& prefix,
106  const std::string& extension);
107 
108 
120  const std::string& filename,
121  const std::string& prefix,
122  const std::string& middle,
123  const std::string& extension);
124 
125 
131 
132 
139 NIFTKCOMMON_WINEXPORT std::vector<std::string> GetFilesInDirectory(const std::string& fullDirectoryName);
140 
141 
148 NIFTKCOMMON_WINEXPORT std::vector<std::string> GetDirectoriesInDirectory(const std::string& fullDirectoryName);
149 
150 
158  const std::string& fullDirectoryName, std::vector<std::string> &fileNames);
159 
160 
167 NIFTKCOMMON_WINEXPORT bool NumericStringCompare(const std::string& string1, const std::string& string2);
168 
169 
175 NIFTKCOMMON_WINEXPORT std::vector<std::string> FindVideoData(const std::string& directory);
176 
177 
185 
186 
192 NIFTKCOMMON_WINEXPORT std::vector<std::string> FindFilesWithGivenExtension(
193  const std::string& fullDirectoryName, const std::string& extension);
194 
195 
202 
203 
211  std::string &fileNameWithoutSuffix );
212 
213 
221  std::string stringToAdd);
222 
223 
231  std::string newSuffix );
232 
233 
243  std::string newSuffix );
251 
252 } // end namespace
253 
254 #endif
std::vector< std::string > FindVideoData(const std::string &directory)
Definition: niftkFileHelper.cxx:443
std::string AddStringToImageFileSuffix(const std::string &fileName, std::string stringToAdd)
Definition: niftkFileHelper.cxx:610
GLsizei const GLchar ** path
Definition: glew.h:5384
std::string FindVideoFile(const std::string &directory, const std::string &mask)
Definition: niftkFileHelper.cxx:470
int FileSize(const std::string &fileName)
Definition: niftkFileHelper.cxx:249
bool FilenameHasPrefixAndExtension(const std::string &filename, const std::string &prefix, const std::string &extension)
Definition: niftkFileHelper.cxx:264
std::string Basename(const std::string &pathName)
Returns the basename.
Definition: niftkFileHelper.cxx:99
void GetRecursiveFilesInDirectory(const std::string &directoryName, std::vector< std::string > &fileNames)
Definition: niftkFileHelper.cxx:388
GLenum GLint GLuint mask
Definition: glew.h:1829
std::string CreateUniqueTempFileName(const std::string &prefix, const std::string &suffix)
Definition: niftkFileHelper.cxx:108
std::vector< std::string > FindFilesWithGivenExtension(const std::string &fullDirectoryName, const std::string &extension)
Definition: niftkFileHelper.cxx:512
std::string GetFileSeparator()
Definition: niftkFileHelper.cxx:52
bool FilenameMatches(const std::string &filename, const std::string &prefix, const std::string &middle, const std::string &extension)
Definition: niftkFileHelper.cxx:293
#define NIFTKCOMMON_WINEXPORT
Definition: niftkCommonWin32ExportHeader.h:28
std::string ExtractImageFileSuffix(const std::string &fileName)
Definition: niftkFileHelper.cxx:533
std::vector< std::string > GetFilesInDirectory(const std::string &fullDirectoryName)
Definition: niftkFileHelper.cxx:330
std::vector< std::string > GetDirectoriesInDirectory(const std::string &fullDirectoryName)
Definition: niftkFileHelper.cxx:359
bool FileDelete(const std::string &fileName)
Definition: niftkFileHelper.cxx:241
bool CreateDirAndParents(const std::string &directoryPath)
Definition: niftkFileHelper.cxx:201
std::string ConcatenatePath(const std::string &path, const std::string &name)
Definition: niftkFileHelper.cxx:59
bool DirectoryExists(const std::string &directoryPath)
Definition: niftkFileHelper.cxx:193
std::string ModifyFileSuffix(const std::string &fileName, std::string newSuffix)
Definition: niftkFileHelper.cxx:639
bool FileIsEmpty(const std::string &fileName)
Definition: niftkFileHelper.cxx:257
GLuint const GLchar * name
Definition: glew.h:1798
bool NumericStringCompare(const std::string &string1, const std::string &string2)
Definition: niftkFileHelper.cxx:432
std::string ModifyImageFileSuffix(const std::string &fileName, std::string newSuffix)
Definition: niftkFileHelper.cxx:621
std::string ConvertToFullNativePath(const std::string &pathName)
Definition: niftkFileHelper.cxx:91
std::string GetImagesDirectory()
Definition: niftkFileHelper.cxx:323
bool FileExists(const std::string &fileName)
Definition: niftkFileHelper.cxx:233
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194