BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Utility functions for data input and output.
Functions | |
IAxis * | createAxis (std::istream &input_stream) |
Creates axis of certain type from input stream. More... | |
void | fillDatafield (Datafield *data, std::istream &input_stream) |
Fills output data raw buffer from input stream. More... | |
bool | isBZipped (const std::string &name) |
Returns true if name contains *.bz2 extension. More... | |
bool | isCompressed (const std::string &name) |
Returns true if name contains *.gz extension. More... | |
bool | isGZipped (const std::string &name) |
Returns true if name contains *.gz extension. More... | |
bool | isIntFile (const std::string &file_name) |
Returns true if file name corresponds to BornAgain native format (compressed or not) More... | |
bool | isNicosFile (const std::string &file_name) |
Returns true if file name corresponds to Nicos format (compressed or not) More... | |
bool | isTiffFile (const std::string &file_name) |
Returns true if file name corresponds to tiff file (can be also compressed) More... | |
std::vector< double > | parse_doubles (const std::string &str) |
Parse double values from string to vector of double. More... | |
void | readLineOfDoubles (std::vector< double > &buffer, std::istringstream &iss) |
IAxis * DataUtils::Format::createAxis | ( | std::istream & | input_stream | ) |
Creates axis of certain type from input stream.
Definition at line 154 of file DataFormatUtils.cpp.
Referenced by ReadWriteINT::readDatafield().
void DataUtils::Format::fillDatafield | ( | Datafield * | data, |
std::istream & | input_stream | ||
) |
Fills output data raw buffer from input stream.
Definition at line 171 of file DataFormatUtils.cpp.
References readLineOfDoubles(), and Datafield::size().
Referenced by ReadWriteINT::readDatafield().
bool DataUtils::Format::isBZipped | ( | const std::string & | name | ) |
Returns true if name contains *.bz2 extension.
Definition at line 132 of file DataFormatUtils.cpp.
References BaseUtils::Filesystem::hasExtension().
Referenced by isCompressed(), IOFactory::readDatafield(), and IOFactory::writeDatafield().
bool DataUtils::Format::isCompressed | ( | const std::string & | name | ) |
Returns true if name contains *.gz extension.
Definition at line 120 of file DataFormatUtils.cpp.
References isBZipped(), and isGZipped().
Referenced by IOFactory::readDatafield(), and IOFactory::writeDatafield().
bool DataUtils::Format::isGZipped | ( | const std::string & | name | ) |
Returns true if name contains *.gz extension.
Does name contain *.gz extension?
Definition at line 127 of file DataFormatUtils.cpp.
References BaseUtils::Filesystem::hasExtension().
Referenced by isCompressed(), IOFactory::readDatafield(), and IOFactory::writeDatafield().
bool DataUtils::Format::isIntFile | ( | const std::string & | file_name | ) |
Returns true if file name corresponds to BornAgain native format (compressed or not)
Definition at line 137 of file DataFormatUtils.cpp.
References BaseUtils::Filesystem::hasExtension().
Referenced by IOFactory::fileTypeMatchesLoaderSelector(), and IOFactory::writeDatafield().
bool DataUtils::Format::isNicosFile | ( | const std::string & | file_name | ) |
Returns true if file name corresponds to Nicos format (compressed or not)
Definition at line 142 of file DataFormatUtils.cpp.
References BaseUtils::Filesystem::hasExtension().
Referenced by IOFactory::fileTypeMatchesLoaderSelector().
bool DataUtils::Format::isTiffFile | ( | const std::string & | file_name | ) |
Returns true if file name corresponds to tiff file (can be also compressed)
Definition at line 147 of file DataFormatUtils.cpp.
References BaseUtils::Filesystem::hasExtension().
Referenced by IOFactory::fileTypeMatchesLoaderSelector(), IOFactory::readDatafield(), and IOFactory::writeDatafield().
std::vector< double > DataUtils::Format::parse_doubles | ( | const std::string & | str | ) |
Parse double values from string to vector of double.
Definition at line 192 of file DataFormatUtils.cpp.
References readLineOfDoubles().
Referenced by ReadWriteNumpyTXT::readDatafield(), and ReadReflectometry::readDatafield().
void DataUtils::Format::readLineOfDoubles | ( | std::vector< double > & | buffer, |
std::istringstream & | iss | ||
) |
Definition at line 212 of file DataFormatUtils.cpp.
Referenced by fillDatafield(), and parse_doubles().