libplatform/io/FileSystem.h Source File
FileSystem.h
1#ifndef MP4V2_PLATFORM_IO_FILESYSTEM_H
2#define MP4V2_PLATFORM_IO_FILESYSTEM_H
3
4namespace mp4v2 { namespace platform { namespace io {
5
13class MP4V2_EXPORT FileSystem
14{
15public:
16 static string DIR_SEPARATOR;
17 static string PATH_SEPARATOR;
18
31
32 static bool exists( std::string name );
33
46
47 static bool isDirectory( std::string name );
48
61
62 static bool isFile( std::string name );
63
77
78 static bool getFileSize( std::string name, File::Size& size );
79
104
105 static bool rename( std::string oldname, std::string newname );
106
117
118 static void pathnameTemp( string& name, string dir = ".", string prefix = "tmp", string suffix = "" );
119
132
133 static void pathnameCleanup( string& name );
134
135#if 0
136TODO-KB: implement
150 static void pathnameOnlyDirectory( string& name, bool trailing = true );
151
163 static void pathnameOnlyFile( string& name );
164
177 static void pathnameOnlyBasename( string& name );
178#endif
179
192
193 static void pathnameOnlyExtension( string& name );
194
207
208 static void pathnameStripExtension( string& name );
209};
210
212
213}}} // namespace mp4v2::platform::io
214
215#endif // MP4V2_PLATFORM_IO_FILESYSTEM_H
int64_t Size
type used to represent all file sizes and offsets
Definition File.h:23
General file-system abstraction.
Definition FileSystem.h:14
static void pathnameStripExtension(string &name)
Remove file extension from pathname.
static bool isFile(std::string name)
Query file type.
static bool exists(std::string name)
Query file presence.
static void pathnameTemp(string &name, string dir=".", string prefix="tmp", string suffix="")
Generate temporary pathname.
static void pathnameOnlyExtension(string &name)
Remove everything except file extension.
static bool isDirectory(std::string name)
Query directory type.
static bool getFileSize(std::string name, File::Size &size)
Query file size.
static bool rename(std::string oldname, std::string newname)
Rename file or directory.
static string PATH_SEPARATOR
separator string used in search-paths
Definition FileSystem.h:17
static void pathnameCleanup(string &name)
Cleanup pathname.
static string DIR_SEPARATOR
separator string used in file pathnames
Definition FileSystem.h:16