Skip to content

Partial c++ implementation of .NET System.IO classes

Notifications You must be signed in to change notification settings

wtrsltnk/system.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

System.IO

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.

Example

Here you find a few examples from tests cases which illustrate how these classes work now:

Example #1 Path & FileInfo

auto file = FileInfo(Path::Combine("c:\\temp", "subdir\\myfile.ext"));
cout << file.FullName();

this will result in c:\temp\subdir\myfile.ext

Example #2 FileInfo

auto file = FileInfo("c:\\temp\\..\\subdir\\.\\myfile.ext");
cout << file.FullName();

this will result in c:\subdir\myfile.ext

Example #3 FileInfo

auto file = FileInfo("c:\\temp/subdir\\myfile.ext");
cout << file.FullName();

this will result in c:\temp\subdir\myfile.ext

Example #4 FileInfo

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.

Example #5 Path

cout << Path::Combine("c:\\temp", "subdir\\file.txt");

this will result in c:\temp\subdir\file.txt

Example #6 Path

cout << Path::Combine("c:\\temp", "c:\\temp.txt");

this will result in c:\temp.txt

Example #7 Path

cout << Path::Combine("", "subdir\\file.txt");

this will result in subdir\file.txt

More examples can be found in the tests for Path.