9#include "MantidKernel/DllConfig.h"
29 static bool isAscii(
const std::string &filename,
const size_t nbytes = 256);
31 static bool isAscii(std::istream &data,
const size_t nbytes = 256);
33 static bool isAscii(FILE *file,
const size_t nbytes = 256);
35 static bool isEmpty(
const std::string &filename);
56 inline const std::string &
filename()
const {
return m_filename; }
62 inline const std::string &
extension()
const {
return m_extension; }
66 inline bool isAscii()
const {
return m_ascii; }
75 inline std::istream &
data() {
return m_file; }
77 void resetStreamToStart();
81 void initialize(
const std::string &filename);
Defines a wrapper around an open file.
std::string m_extension
Extension.
bool isAscii() const
Returns true if the descriptor is looking at an ascii file.
FileDescriptor(const FileDescriptor &)=delete
Disable copy operator.
FileDescriptor()=delete
Disable default constructor.
const std::string & filename() const
Access the filename.
std::istream & data()
Access the open file stream.
FileDescriptor & operator=(const FileDescriptor &)=delete
Disable assignment operator.
const std::string & extension() const
Access the file extension.
std::string m_filename
Full filename.
bool m_ascii
Flag indicating the file is pure ascii.
std::ifstream m_file
Open file stream.
Helper class which provides the Collimation Length for SANS instruments.