The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Public Attributes | Private Attributes | List of all members
tmp_file Class Referencefinal

Self destructive temporary file at the current directory. More...

Public Member Functions

void set (const std::string &content)
 Set file to content and close the file. More...
 
 ~tmp_file ()
 

Public Attributes

const bfs::path path = bfs::unique_path("%%%%-%%%%-%%%%-%%%%-%%%%-%%%%.tmp.out")
 Path to the temporary file. More...
 

Private Attributes

bfs::ofstream stream
 

Detailed Description

Self destructive temporary file at the current directory.

Precondition
An other user does not have a file with the same name.

Definition at line 27 of file wml_equivalence.cpp.

Constructor & Destructor Documentation

◆ ~tmp_file()

tmp_file::~tmp_file ( )
inline

Definition at line 43 of file wml_equivalence.cpp.

References image::exists(), path, and gui2::dialogs::tip::remove().

Member Function Documentation

◆ set()

void tmp_file::set ( const std::string &  content)
inline

Set file to content and close the file.

Definition at line 31 of file wml_equivalence.cpp.

References path, and stream.

Referenced by preprocess_and_parse().

Member Data Documentation

◆ path

const bfs::path tmp_file::path = bfs::unique_path("%%%%-%%%%-%%%%-%%%%-%%%%-%%%%.tmp.out")

Path to the temporary file.

Definition at line 51 of file wml_equivalence.cpp.

Referenced by preprocess_and_parse(), set(), and ~tmp_file().

◆ stream

bfs::ofstream tmp_file::stream
private

Definition at line 54 of file wml_equivalence.cpp.

Referenced by set().


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