Mantid
|
File object type. More...
#include <ScopedFileHelper.h>
Public Member Functions | |
std::string | getFileName () const |
Getter for the filename with path. More... | |
ScopedFile & | operator= (const ScopedFile &other) |
Assignement. More... | |
void | release () const |
Release the resource from management. More... | |
ScopedFile (const ScopedFile &other) | |
Copy construction. More... | |
ScopedFile (const std::string &fileContents, const std::string &fileName) | |
Constructor generates the file. More... | |
ScopedFile (const std::string &fileContents, const std::string &fileName, const std::string &fileDirectory) | |
Constructor generates the file. More... | |
~ScopedFile () | |
Free up resources. More... | |
Private Member Functions | |
void | doCreateFile (const std::string &fileContents, const Poco::Path &fileNameAndPath) |
Common method used by all constructors. More... | |
void | operator delete (void *) |
void | operator delete[] (void *) |
void * | operator new (size_t) |
void * | operator new[] (size_t) |
Private Attributes | |
std::ofstream | m_file |
std::string | m_filename |
File object type.
Provides exception save file creation/destruction.
This is a resource management type. Objects of this type are limited to stack allocation.
Definition at line 24 of file ScopedFileHelper.h.
ScopedFileHelper::ScopedFile::ScopedFile | ( | const std::string & | fileContents, |
const std::string & | fileName | ||
) |
Constructor generates the file.
Sets location to be the temp directory
Definition at line 21 of file ScopedFileHelper.cpp.
References doCreateFile(), and Mantid::Kernel::SingletonHolder< T >::Instance().
ScopedFileHelper::ScopedFile::ScopedFile | ( | const std::string & | fileContents, |
const std::string & | fileName, | ||
const std::string & | fileDirectory | ||
) |
Constructor generates the file.
Sets location as defined by the fileDirectory.
Definition at line 30 of file ScopedFileHelper.cpp.
References doCreateFile().
ScopedFileHelper::ScopedFile::ScopedFile | ( | const ScopedFile & | other | ) |
ScopedFileHelper::ScopedFile::~ScopedFile | ( | ) |
Free up resources.
Definition at line 78 of file ScopedFileHelper.cpp.
References m_file, and m_filename.
|
private |
Common method used by all constructors.
Creates a file containing the ASCII file contents and 'remembers' the location of that file.
Definition at line 61 of file ScopedFileHelper.cpp.
References m_file, and m_filename.
Referenced by ScopedFile().
std::string ScopedFileHelper::ScopedFile::getFileName | ( | ) | const |
Getter for the filename with path.
Definition at line 75 of file ScopedFileHelper.cpp.
References m_filename.
|
private |
|
private |
|
private |
|
private |
ScopedFile & ScopedFileHelper::ScopedFile::operator= | ( | const ScopedFile & | other | ) |
void ScopedFileHelper::ScopedFile::release | ( | ) | const |
Release the resource from management.
Definition at line 39 of file ScopedFileHelper.cpp.
References m_filename.
|
private |
Definition at line 38 of file ScopedFileHelper.h.
Referenced by doCreateFile(), operator=(), and ~ScopedFile().
|
mutableprivate |
Definition at line 37 of file ScopedFileHelper.h.
Referenced by doCreateFile(), getFileName(), operator=(), release(), ScopedFile(), and ~ScopedFile().