Partial c++ implementation of .NET System.IO classes. Goal of this project is to have similar functionality from .NET System.IO available in c++. Currently (partial)implemented are:
- Directory
- DirectoryInfo
- File
- FileInfo
- FileSystemInfo
- Path
These sources contain the header files in the include directory and a set of tests to verify they are working correctly.
Here you find a few examples from tests cases which illustrate how these classes work now:
auto file = FileInfo(Path::Combine("c:\\temp", "subdir\\myfile.ext"));
cout << file.FullName();
this will result in c:\temp\subdir\myfile.ext
auto file = FileInfo("c:\\temp\\..\\subdir\\.\\myfile.ext");
cout << file.FullName();
this will result in c:\subdir\myfile.ext
auto file = FileInfo("c:\\temp/subdir\\myfile.ext");
cout << file.FullName();
this will result in c:\temp\subdir\myfile.ext
auto file = FileInfo("c:\\temp\\subdir\\myfile.ext");
auto directory = file.Directory();
cout << directory.FullName();
this will result in c:\temp\subdir
More examples can be found in the tests for FileInfo.
cout << Path::Combine("c:\\temp", "subdir\\file.txt");
this will result in c:\temp\subdir\file.txt
cout << Path::Combine("c:\\temp", "c:\\temp.txt");
this will result in c:\temp.txt
cout << Path::Combine("", "subdir\\file.txt");
this will result in subdir\file.txt
More examples can be found in the tests for Path.