GDCM  2.4.5
gdcmFilename.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMFILENAME_H
15 #define GDCMFILENAME_H
16 
17 #include "gdcmTypes.h"
18 
19 #include <string>
20 
21 namespace gdcm
22 {
28 {
29 public:
30  Filename(const char* filename = ""):FileName(filename ? filename : ""),Path(),Conversion() {}
31 
33  const char *GetFileName() const { return FileName.c_str(); }
35  const char *GetPath();
37  const char *GetName();
39  const char *GetExtension();
41  const char *ToUnixSlashes();
43  const char *ToWindowsSlashes();
44 
47  static const char *Join(const char *path, const char *filename);
48 
50  bool IsEmpty() const { return FileName.empty(); }
51 
55  operator const char * () const { return GetFileName(); }
56 
57  // FIXME: I don't like this function
58  // It hides the realpath call (maybe usefull)
59  // and it forces file to exist on the disk whereas Filename
60  // should be independant from file existence.
61  bool IsIdentical(Filename const &fn) const;
62 
64  bool EndWith(const char ending[]) const;
65 
66 private:
67  std::string FileName;
68  std::string Path;
69  std::string Conversion;
70 };
71 
72 } // end namespace gdcm
73 
74 #endif //GDCMFILENAME_H
bool IsEmpty() const
return whether the filename is empty
Definition: gdcmFilename.h:50
const char * GetFileName() const
Return the full filename.
Definition: gdcmFilename.h:33
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
Class to manipulate file name's.
Definition: gdcmFilename.h:27
Filename(const char *filename="")
Definition: gdcmFilename.h:30
Definition: gdcmASN1.h:20

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo