https://github.com/coralkashri/simple_file_reader_cpp
A simple single-header file reader for a better experience while reading a text file in C++
https://github.com/coralkashri/simple_file_reader_cpp
Last synced: 2 months ago
JSON representation
A simple single-header file reader for a better experience while reading a text file in C++
- Host: GitHub
- URL: https://github.com/coralkashri/simple_file_reader_cpp
- Owner: coralkashri
- License: mit
- Created: 2024-12-25T10:53:49.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-25T11:01:16.000Z (about 1 year ago)
- Last Synced: 2025-02-22T06:28:12.619Z (11 months ago)
- Language: C++
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple File Reader C++
## Usage Example
```
#include "file_reader.hpp"
int main() {
std::ifstream file("test.txt");
for (std::string_view line : file_reader<'\n'>(file)) {
std::cout << line << "\n";
}
return 0;
}
```
The file reader accepts NTTP char to define the delimiter.
## Credits
word_delimited_by usage is taken from: https://www.fluentcpp.com/2017/04/21/how-to-split-a-string-in-c/