File system wrapper, supported only with c++20.
- Folders
fs::Folder cfg("cfg");
if (cfg.exists)
{
for (const auto& file : cfg.read())
if (file->getFileType() == fs::enums::DOCUMENT)
{
const auto document = file->translate<fs::Document>();
// Log file & content
std::clog << "Path: " << document->path << "\nContents: " << document->read().str().c_str() << std::endl;
std::stringstream toWrite{ "New contents" };
document->write(toWrite);
}
}
- Normal files
fs::Document document("cfg/not ignored 1")
// Log document content
std::clog << document->read().str().c_str() << std::endl;