Singleton class to handle file operations.
More...
#include <file_operations.h>
|
| std::string | OpenFileDialog () |
| | Opens a dialog for the user to open a file on their filesystem.
|
| |
| std::string | OpenDirectoryDialog () |
| | Opens a dialog for the user to open a directory on their filesystem.
|
| |
| bool | WriteFile (const std::string &file_path, const std::string &contents) |
| | writes a string to a file
|
| |
| bool | WriteFile (const std::string &contents) |
| | writes a string to the currently opened file
|
| |
| void | SetActiveFilePath (const std::string &file_path) |
| | Sets the active file path.
|
| |
|
|
| FileOperations ()=default |
| | Prevent access to the constructor of this class.
|
| |
|
| ~FileOperations ()=default |
| | Prevent access to the destructor of this class.
|
| |
|
FileOperations & | operator= (const FileOperations &)=delete |
| | Prevent the assignment of one instance of FileOperations to another, ensuring there can only be one instance.
|
| |
|
| FileOperations (const FileOperations &)=delete |
| | Delete the copy constructor of FileOperations, preventing copies of the reference the the sole instance from being made
|
| |
|
|
std::string | active_file_path |
| |
Singleton class to handle file operations.
◆ GetSoleInstance()
The only method by which a FileOperations instance can be returned.
- Returns
- The sole instance of FileOperationsI
◆ OpenDirectoryDialog()
| std::string FileOperations::OpenDirectoryDialog |
( |
| ) |
|
Opens a dialog for the user to open a directory on their filesystem.
- Returns
- An absolute directory path or an empty string
◆ OpenFileDialog()
| std::string FileOperations::OpenFileDialog |
( |
| ) |
|
Opens a dialog for the user to open a file on their filesystem.
- Returns
- An absolute file path or an empty string
◆ SetActiveFilePath()
| void FileOperations::SetActiveFilePath |
( |
const std::string & |
file_path | ) |
|
Sets the active file path.
- Parameters
-
| [in] | file_path | The file path to set as the active path |
◆ WriteFile() [1/2]
| bool FileOperations::WriteFile |
( |
const std::string & |
contents | ) |
|
writes a string to the currently opened file
- Parameters
-
| [in] | contents | the contents to write to the given file |
- Returns
- true if successful
◆ WriteFile() [2/2]
| bool FileOperations::WriteFile |
( |
const std::string & |
file_path, |
|
|
const std::string & |
contents |
|
) |
| |
writes a string to a file
- Parameters
-
| [in] | file_path | the filepath of the file to write to |
| [in] | contents | the contents to write to the given file |
- Returns
- true if successful
The documentation for this class was generated from the following files: