Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | Static Public Member Functions | List of all members
alsutils::io::TextFileCache Class Reference

#include <alsutils/io/TextFileCache.hpp>

Public Member Functions

 TextFileCache (const TextFileCache &)=delete
 
std::string loadTextFile (const std::string &path)
 
std::vector< std::string > getAllLoadedFiles () const
 

Static Public Member Functions

static TextFileCachegetInstance ()
 

Detailed Description

Simple file cache. This is mainly use to reduce IO, but also to store the loaded .xml and .py files for later reproducibility

Usage

auto instance = TextFileCache::getInstance();
auto text = instance.loadTextFile("some_file.xml");
// Can also loop through all loaded text files
for (auto filename : instance.getAllLoadedFiles()) {
auto previouslyLoadedText = instance.loadTextFile(filename);
}

Constructor & Destructor Documentation

◆ TextFileCache()

alsutils::io::TextFileCache::TextFileCache ( const TextFileCache )
delete

Member Function Documentation

◆ getAllLoadedFiles()

std::vector< std::string > alsutils::io::TextFileCache::getAllLoadedFiles ( ) const

◆ getInstance()

TextFileCache & alsutils::io::TextFileCache::getInstance ( )
static

◆ loadTextFile()

std::string alsutils::io::TextFileCache::loadTextFile ( const std::string &  path)

The documentation for this class was generated from the following files: