EMath++
Classes for mathematical concepts
Loading...
Searching...
No Matches
efc::Storage Class Reference

Storage class to read and write to a file. More...

Public Member Functions

 Storage (const ::std::string file) noexcept
 The main constructor.
 
const ::std::string read () const noexcept
 The read function that returns the whole file as a std:.string.
 
const int write (const ::std::string contents) const noexcept
 The write function that overwrites the whole file with a std::string.
 
bool exists () const noexcept
 This function check if the filename exists.
 
 ~Storage () noexcept=default
 Default destructor.
 

Detailed Description

Storage class to read and write to a file.

Provides some functions to read and write to a filename saved in a class variable

Definition at line 589 of file interface.cpp.

Constructor & Destructor Documentation

◆ Storage()

efc::Storage::Storage ( const ::std::string  file)
inlinenoexcept

The main constructor.

Parameters
fileThe filename to write to as a std::string

Definition at line 600 of file interface.cpp.

Member Function Documentation

◆ exists()

bool efc::Storage::exists ( ) const
inlinenoexcept

This function check if the filename exists.

Returns
(bool) True if the file exists, false otherwise

Definition at line 628 of file interface.cpp.

◆ read()

const ::std::string efc::Storage::read ( ) const
inlinenoexcept

The read function that returns the whole file as a std:.string.

Returns
(const ::std::string) The whole file as a std:.string

Definition at line 605 of file interface.cpp.

◆ write()

const int efc::Storage::write ( const ::std::string  contents) const
inlinenoexcept

The write function that overwrites the whole file with a std::string.

Parameters
contentsThe contents to write as a std::string
Returns
(int) 0 If successful, 1 otherwise

Definition at line 618 of file interface.cpp.


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