Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtrsltnk/system.io
Partial c++ implementation of .NET System.IO classes
https://github.com/wtrsltnk/system.io
cpp directoryinfo fileinfo io path system system-io systemio
Last synced: about 13 hours ago
JSON representation
Partial c++ implementation of .NET System.IO classes
- Host: GitHub
- URL: https://github.com/wtrsltnk/system.io
- Owner: wtrsltnk
- Created: 2016-09-04T14:33:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T20:09:25.000Z (about 1 year ago)
- Last Synced: 2023-11-16T21:53:41.122Z (about 1 year ago)
- Topics: cpp, directoryinfo, fileinfo, io, path, system, system-io, systemio
- Language: C++
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
* PathThese 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
```cpp
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
```cpp
auto file = FileInfo("c:\\temp\\..\\subdir\\.\\myfile.ext");
cout << file.FullName();
```
this will result in `c:\subdir\myfile.ext`### Example #3 FileInfo
```cpp
auto file = FileInfo("c:\\temp/subdir\\myfile.ext");
cout << file.FullName();
```
this will result in `c:\temp\subdir\myfile.ext`### Example #4 FileInfo
```cpp
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](https://github.com/wtrsltnk/system.io/blob/master/tests/test-fileinfo.cpp).
### Example #5 Path
```cpp
cout << Path::Combine("c:\\temp", "subdir\\file.txt");
```
this will result in `c:\temp\subdir\file.txt`### Example #6 Path
```cpp
cout << Path::Combine("c:\\temp", "c:\\temp.txt");
```
this will result in `c:\temp.txt`### Example #7 Path
```cpp
cout << Path::Combine("", "subdir\\file.txt");
```
this will result in `subdir\file.txt`More examples can be found in the tests for [Path](https://github.com/wtrsltnk/system.io/blob/master/tests/test-path.cpp).