|
void | NRLib::OpenRead (std::ifstream &stream, const std::string &filename, std::ios_base::openmode mode=std::ios_base::in) |
| Open file for reading. More...
|
|
void | NRLib::OpenRead (std::fstream &stream, const std::string &filename, std::ios_base::openmode mode=std::ios_base::in) |
|
void | NRLib::OpenWrite (std::ofstream &stream, const std::string &filename, std::ios_base::openmode mode=std::ios_base::out, bool create_dir=true) |
| Open file for writing. More...
|
|
void | NRLib::OpenWrite (std::fstream &stream, const std::string &filename, std::ios_base::openmode mode=std::ios_base::out, bool create_dir=true) |
|
void | NRLib::CopyFile (const std::string &from_path, const std::string &to_path, bool allow_overwrite) |
|
bool | NRLib::FileExists (const std::string &filename) |
|
void | NRLib::CreateDirIfNotExists (const std::string &filename) |
|
void | NRLib::RemoveFile (const std::string &filename) |
|
unsigned long long | NRLib::FindFileSize (const std::string &filename) |
| Finds the size of a file. Throws IOError if file not found. More...
|
|
int | NRLib::FindGridFileType (const std::string &filename) |
| Find type of file, for 3D grid files. More...
|
|
void | NRLib::DiscardRestOfLine (std::istream &stream, int &line_num, bool throw_if_non_whitespace) |
| Reads and discard all characters until and including next newline. More...
|
|
std::istream & | NRLib::GetNextNonEmptyLine (std::istream &stream, int &line_num, std::string &line) |
| Gets the next line that not only contains whitespace. Returns the stream. Stream will be bad if end-of-file is reached. More...
|
|
std::string | NRLib::FindLastNonEmptyLine (std::istream &stream, const std::ios::pos_type &max_line_len=1000) |
| Returns last non-empty line in file. Stream will be at end of file. More...
|
|
void | NRLib::SkipComments (std::istream &stream, char comment_token, int &line_num) |
| Returns next line that not only contains whitespace, or starts with the given comment token. More...
|
|
bool | NRLib::CheckEndOfFile (std::istream &stream) |
| Check if end of file is reached. Discards all whitespace before end of file or next token. More...
|
|
std::istream & | NRLib::ReadNextToken (std::istream &stream, std::string &s, int &line) |
| Read next white-space seperated token from file. Updates line number when new line is read in. If end of file is reached the state of stream is set to eof. If ReadNextToken is called with a stream that is not good, the state is set to fail. More...
|
|
template<typename T > |
T | NRLib::ReadNext (std::istream &stream, int &line) |
| Gets next token from file, and parses it as type T Might be relatively slow, due to typechecking, and counting line numbers. More...
|
|
void | NRLib::ReadNextQuoted (std::istream &stream, char quote, std::string &s, int &line) |
| Reads the next, possibly quoted, string. More...
|
|
template<typename I > |
void | NRLib::WriteAsciiArray (std::ostream &stream, I begin, I end, int n_per_line=6) |
| Writes array. More...
|
|
template<typename I > |
I | NRLib::ReadAsciiArray (std::istream &stream, I begin, size_t n, int &line) |
| Gets sequence with elements of type T from input stream. Might be relatively slow, due to typechecking, and counting line numbers. More...
|
|
template<typename I > |
I | NRLib::ReadAsciiArrayFast (std::istream &stream, I begin, size_t n) |
| Gets sequence with elements of type T from input stream. Does no type checking, and does not count line numbers. More...
|
|
template<typename I > |
I | NRLib::ReadAsciiArrayFastRestOfFile (std::istream &stream, I begin, size_t n) |
| Gets sequence with elements of type T from input stream. Does no type checking, and does not count line numbers. Reads the rest of the file, and does no type checking at all. If a double is attempted read as an int, the first integer part of the double is read, while the fraction part is discarded. For int, float or double this function is 10x as fast as GetAsciiArrayFast on Windows. More...
|
|
void | NRLib::WriteBinaryShort (std::ostream &stream, short s, Endianess number_representation=END_BIG_ENDIAN) |
| Write a 2-byte integer to a binary file. More...
|
|
short | NRLib::ReadBinaryShort (std::istream &stream, Endianess number_representation=END_BIG_ENDIAN) |
| Read a 2-byte integer from a binary file. More...
|
|
template<typename I > |
void | NRLib::WriteBinaryShortArray (std::ostream &stream, I begin, I end, Endianess number_representation=END_BIG_ENDIAN) |
| Write an array of binary 2-byte integers. More...
|
|
template<typename I > |
I | NRLib::ReadBinaryShortArray (std::istream &stream, I begin, size_t n, Endianess number_representation=END_BIG_ENDIAN) |
| Read an array of binary 2-byte integers. More...
|
|
void | NRLib::WriteBinaryInt (std::ostream &stream, int i, Endianess number_representation=END_BIG_ENDIAN) |
| Write a 4-byte integer to a binary file. More...
|
|
int | NRLib::ReadBinaryInt (std::istream &stream, Endianess number_representation=END_BIG_ENDIAN) |
| Read a 4-byte integer from a binary file. More...
|
|
template<typename I > |
void | NRLib::WriteBinaryIntArray (std::ostream &stream, I begin, I end, Endianess number_representation=END_BIG_ENDIAN) |
| Write an array of binary 4-byte integers. More...
|
|
template<typename I > |
I | NRLib::ReadBinaryIntArray (std::istream &stream, I begin, size_t n, Endianess number_representation=END_BIG_ENDIAN) |
| Read an array of binary 4-byte integers. More...
|
|
void | NRLib::WriteBinaryFloat (std::ostream &stream, float f, Endianess number_representation=END_BIG_ENDIAN) |
| Write a 4-byte float on standard IEEE format. More...
|
|
float | NRLib::ReadBinaryFloat (std::istream &stream, Endianess number_representation=END_BIG_ENDIAN) |
| Read a 4-byte float on standard IEEE format. More...
|
|
template<typename I > |
void | NRLib::WriteBinaryFloatArray (std::ostream &stream, I begin, I end, Endianess number_representation=END_BIG_ENDIAN) |
| Write an array of 4-byte floats on standard IEEE format. More...
|
|
template<typename I > |
I | NRLib::ReadBinaryFloatArray (std::istream &stream, I begin, size_t n, Endianess number_representation=END_BIG_ENDIAN) |
| Read an array of 4-byte floats on standard IEEE format. More...
|
|
void | NRLib::WriteBinaryDouble (std::ostream &stream, double d, Endianess number_representation=END_BIG_ENDIAN) |
| Write a 8-byte float on standard IEEE format. More...
|
|
double | NRLib::ReadBinaryDouble (std::istream &stream, Endianess number_representation=END_BIG_ENDIAN) |
| Read a 8-byte float on standard IEEE format. More...
|
|
template<typename I > |
void | NRLib::WriteBinaryDoubleArray (std::ostream &stream, I begin, I end, Endianess number_representation=END_BIG_ENDIAN) |
| Write an array of 8-byte floats on standard IEEE format. More...
|
|
template<typename I > |
I | NRLib::ReadBinaryDoubleArray (std::istream &stream, I begin, size_t n, Endianess number_representation=END_BIG_ENDIAN) |
| Read an array of 8-byte floats on standard IEEE format. More...
|
|
void | NRLib::WriteBinaryIbmFloat (std::ostream &stream, float f, Endianess number_representation=END_BIG_ENDIAN) |
| Write a 4-byte float on standard IEEE format. More...
|
|
float | NRLib::ReadBinaryIbmFloat (std::istream &stream, Endianess number_representation=END_BIG_ENDIAN) |
| Read a 4-byte float on standard IEEE format. More...
|
|
template<typename I > |
void | NRLib::WriteBinaryIbmFloatArray (std::ostream &stream, I begin, I end, Endianess number_representation=END_BIG_ENDIAN) |
| Write an array of 4-byte floats on standard IEEE format. More...
|
|
template<typename I > |
I | NRLib::ReadBinaryIbmFloatArray (std::istream &stream, I begin, size_t n, Endianess number_representation=END_BIG_ENDIAN) |
| Read an array of 4-byte floats on standard IEEE format. More...
|
|
bool | NRLib::IgnoreComment (std::ifstream &file, char chin) |
|
int | NRLib::Seek (FILE *file, long long offset, int origin) |
| Seek to given position in file, works for large files. More...
|
|
void | NRLib::ParseInt16BE (const char *buffer, short &ui) |
| Parse unsigned 32-bit integer from big-endian buffer. More...
|
|
void | NRLib::ParseInt32BE (const char *buffer, int &ui) |
| Parse unsigned 32-bit integer from big-endian buffer. More...
|
|
void | NRLib::ParseUInt16BE (const char *buffer, unsigned short &ui) |
| Parse unsigned 32-bit integer from big-endian buffer. More...
|
|
void | NRLib::ParseUInt32BE (const char *buffer, unsigned int &ui) |
| Parse unsigned 32-bit integer from big-endian buffer. More...
|
|
void | NRLib::ParseIEEEFloatBE (const char *buffer, float &f) |
| Parse IEEE single-precision float from big-endian buffer. More...
|
|
void | NRLib::ParseIBMFloatBE (const char *buffer, float &f) |
| Parse IEEE double-precision float from big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseUInt16LE (const char *buffer, unsigned short &ui) |
| Parse unsigned 32-bit integer from little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteUInt16BE (char *buffer, unsigned short us) |
| Write unsigned 32-bit integer to big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteUInt16LE (char *buffer, unsigned short us) |
| Write unsigned 32-bit integer to little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseUInt32LE (const char *buffer, unsigned int &ui) |
| Parse unsigned 32-bit integer from little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteUInt32BE (char *buffer, unsigned int ui) |
| Write unsigned 32-bit integer to big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteUInt32LE (char *buffer, unsigned int ui) |
| Write unsigned 32-bit integer to little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseIEEEFloatLE (const char *buffer, float &f) |
| Parse IEEE single-precision float from little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIEEEFloatBE (char *buffer, float f) |
| Write IEEE single-precision float to big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIEEEFloatLE (char *buffer, float f) |
| Write IEEE single-precision float to little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseIEEEDoubleBE (const char *buffer, double &d) |
| Parse IEEE double-precision float from big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseIEEEDoubleLE (const char *buffer, double &d) |
| Parse IEEE double-precision float from little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIEEEDoubleBE (char *buffer, double d) |
| Write IEEE double-precision float to big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIEEEDoubleLE (char *buffer, double d) |
| Write IEEE double-precision float to little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::ParseIBMFloatLE (const char *buffer, float &f) |
| Parse IEEE double-precision float from little-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIBMFloatBE (char *buffer, float f) |
| Write IEEE double-precision float to big-endian buffer. More...
|
|
void | NRLib::NRLibPrivate::WriteIBMFloatLE (char *buffer, float f) |
| Write IEEE double-precision float to little-endian buffer. More...
|
|
template<> |
std::string | NRLib::ReadNext< std::string > (std::istream &stream, int &line) |
|
static void | Ibm2Ieee (unsigned int &in) |
| Converts Ieee float (represented as 32-bit int) to IBM float. More...
|
|
static void | Ieee2Ibm (unsigned int &in) |
| Converts Ieee float (represented as 32-bit int) to IBM float. More...
|
|