libplatform/io/FileSystem.h Source File
FileSystem.h
1 #ifndef MP4V2_PLATFORM_IO_FILESYSTEM_H
2 #define MP4V2_PLATFORM_IO_FILESYSTEM_H
3 
4 namespace mp4v2 { namespace platform { namespace io {
5 
13 class MP4V2_EXPORT FileSystem
14 {
15 public:
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
136 TODO-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
mp4v2::platform::io::FileSystem::getFileSize
static bool getFileSize(std::string name, File::Size &size)
Query file size.
mp4v2::platform::io::FileSystem::isFile
static bool isFile(std::string name)
Query file type.
mp4v2::platform::io::FileSystem::exists
static bool exists(std::string name)
Query file presence.
mp4v2::platform::io::FileSystem::isDirectory
static bool isDirectory(std::string name)
Query directory type.
mp4v2::platform::io::FileSystem::pathnameStripExtension
static void pathnameStripExtension(string &name)
Remove file extension from pathname.
mp4v2::platform::io::FileSystem::rename
static bool rename(std::string oldname, std::string newname)
Rename file or directory.
mp4v2::platform::io::FileProvider::Size
int64_t Size
type used to represent all file sizes and offsets
Definition: File.h:23
mp4v2::platform::io::FileSystem
General file-system abstraction.
Definition: FileSystem.h:14
mp4v2::platform::io::FileSystem::DIR_SEPARATOR
static string DIR_SEPARATOR
separator string used in file pathnames
Definition: FileSystem.h:16
mp4v2::platform::io::FileSystem::pathnameTemp
static void pathnameTemp(string &name, string dir=".", string prefix="tmp", string suffix="")
Generate temporary pathname.
mp4v2::platform::io::FileSystem::pathnameCleanup
static void pathnameCleanup(string &name)
Cleanup pathname.
mp4v2::platform::io::FileSystem::pathnameOnlyExtension
static void pathnameOnlyExtension(string &name)
Remove everything except file extension.
mp4v2::platform::io::FileSystem::PATH_SEPARATOR
static string PATH_SEPARATOR
separator string used in search-paths
Definition: FileSystem.h:17