14 #ifndef vtkDICOMFilePath_h
15 #define vtkDICOMFilePath_h
17 #include "vtkSystemIncludes.h"
18 #include "vtkDICOMModule.h"
19 #include "vtkDICOMConfig.h"
51 const std::string& AsString()
const {
return this->Path; }
56 bool IsEmpty()
const {
return (this->Path.length() == 0); }
73 std::string Join(
const std::string& second)
const;
78 std::string GetBack()
const;
89 std::string GetExtension()
const;
118 const wchar_t *Wide();
138 static bool IsSeparator(
char c) {
141 return (c ==
'/' || c ==
'\\');
149 static void StripTrailingSlash(std::string *path);
152 static size_t ExtensionPosition(
const std::string& path);
160 static size_t RootLength(
const std::string& path);
164 static bool HasExtendedPrefix(
const std::string& path);
167 static char DriveLetter(
const std::string& path);
170 static wchar_t *ConvertToWideChar(
const char *filename);
173 static char *ConvertToUTF8(
const wchar_t *filename);
176 static char *ConvertToLocal(
const wchar_t *filename);
A class that provides path manipulation.
Definition: vtkDICOMFilePath.h:25
vtkDICOMFilePath(const vtkDICOMFilePath &)
Copy constructor.
bool IsDirectory() const
Check whether the path is an existing directory.
vtkDICOMFilePath(const std::string &path)
Create a new path from the given string.
void PopBack()
Remove a component from the path.
void PushExtension(const std::string &path)
Add a new file extension to the current file path.
bool IsSymlink() const
Check whether the path is a symbolic link.
std::string GetRealPath() const
Get the full absolute path (or empty string if file doesn't exist).
void PushBack(const std::string &path)
Add a new component (or components) to the path.
void PopExtension()
Remove the current file extension, including the dot.
~vtkDICOMFilePath()
Destructor.
bool IsRoot() const
Check if the path is a root path.
bool IsSpecial() const
Check whether the path goes to a device, socket, or pipe.