NRLib Namespace Reference
Enumeration Type Documentation◆ Endianess
◆ GridFileFormat◆ SurfaceFileFormatFunction Documentation◆ AddExtension()
Add an extension to the filename. ◆ BlockWell()
template<typename A >
Block the well into the grid. Possible grids to use are StormContGrid and StormFaciesGrid References index, string, exprtk::details::x(), and exprtk::details::z. ◆ CheckEndOfFile()
Check if end of file is reached. Discards all whitespace before end of file or next token.
Referenced by ReadIrapClassicAsciiSurf(), ReadMulticolumnAsciiSurf(), and ReadStormBinarySurf(). ◆ Chomp()
◆ CopyFile()
◆ CreateDirIfNotExists()
◆ DiscardRestOfLine()
Reads and discard all characters until and including next newline.
Referenced by ReadMulticolumnAsciiSurf(), and ReadStormBinarySurf(). ◆ FileExists()
◆ FindFileSize()
Finds the size of a file. Throws IOError if file not found.
◆ FindGridFileType()
Find type of file, for 3D grid files. ◆ FindLastNonEmptyLine()
Returns last non-empty line in file. Stream will be at end of file.
◆ FindMulticolumnAsciiLine()
Referenced by ReadMulticolumnAsciiSurf(). ◆ FindSurfaceFileType()
Find type of file. Referenced by NRLib::RegularSurface< A >::ReadFromFile(), and NRLib::RegularSurfaceRotated< A >::ReadFromFile(). ◆ GetExtension()
Get filename extension. ◆ GetNextNonEmptyLine()
Gets the next line that not only contains whitespace. Returns the stream. Stream will be bad if end-of-file is reached. ◆ GetPath()
Get the path from a full file name. Referenced by ReadSgriSurf(). ◆ GetQuotedTokens()
◆ GetStem()
Get the stem of the filename (filename without path and extension) Referenced by ReadIrapClassicAsciiSurf(), ReadMulticolumnAsciiSurf(), ReadSgriSurf(), and ReadStormBinarySurf(). ◆ GetSurfFormatString()
String describing file format. ◆ GetTokens()
◆ IgnoreComment()
◆ IsNumber()
◆ IsType()
template<typename T >
OBS: Negative values are recognized as unsigned integers on Windows. Works OK on Linux. (gcc 4.*) References exprtk::details::x(). ◆ OpenRead() [1/2]
◆ OpenRead() [2/2]
Open file for reading. Referenced by ReadIrapClassicAsciiSurf(), ReadMulticolumnAsciiSurf(), ReadSgriSurf(), and ReadStormBinarySurf(). ◆ OpenWrite() [1/2]
◆ OpenWrite() [2/2]
Open file for writing.
Referenced by WriteIrapClassicAsciiSurf(), and WriteStormBinarySurf(). ◆ ParseAsciiArrayFast()
template<typename I >
Not safe. Replaces whitespace in s with \0. References Catch::begin, ParseType(), and string. Referenced by ReadAsciiArrayFastRestOfFile(). ◆ ParseIBMFloatBE()
Parse IEEE double-precision float from big-endian buffer. References buffer, NRLib::NRLibPrivate::FloatAsInt::f, Ibm2Ieee(), and NRLib::NRLibPrivate::FloatAsInt::ui. Referenced by ReadBinaryIbmFloatArray(). ◆ ParseIEEEFloatBE()
Parse IEEE single-precision float from big-endian buffer. References buffer, NRLib::NRLibPrivate::FloatAsInt::f, and NRLib::NRLibPrivate::FloatAsInt::ui. Referenced by ReadBinaryFloatArray(). ◆ ParseInt16BE()
Parse unsigned 32-bit integer from big-endian buffer. References buffer. ◆ ParseInt32BE()
Parse unsigned 32-bit integer from big-endian buffer. References buffer. ◆ ParseType()
template<typename T >
OBS: Negative values are recognized as unsigned integers on Windows. Works OK on Linux. (gcc 4.*) References name, and exprtk::details::x(). Referenced by ParseAsciiArrayFast(). ◆ ParseType< std::string >()
template<>
If used in a template function, we may get string ot string parse. Will not work with the version above, so handle special case. ◆ ParseUInt16BE()
Parse unsigned 32-bit integer from big-endian buffer. References buffer. Referenced by ReadBinaryShortArray(). ◆ ParseUInt32BE()
Parse unsigned 32-bit integer from big-endian buffer. References buffer. Referenced by ReadBinaryIntArray(). ◆ PrependDir()
Prepend prefix to str. Returns str if prefix is empty, if str is empty or if str is a complete path starting with /. Adds '/' as directory seperator if missing. ◆ ReadAsciiArray()
template<typename I >
Gets sequence with elements of type T from input stream. Might be relatively slow, due to typechecking, and counting line numbers.
References Catch::begin. ◆ ReadAsciiArrayFast()
template<typename I >
Gets sequence with elements of type T from input stream. Does no type checking, and does not count line numbers.
References Catch::begin, string, and ToString(). Referenced by ReadIrapClassicAsciiSurf(). ◆ ReadAsciiArrayFastRestOfFile()
template<typename I >
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.
References Catch::begin, buffer, Opm::end, ParseAsciiArrayFast(), and string. ◆ ReadBinaryDouble()
Read a 8-byte float on standard IEEE format. ◆ ReadBinaryDoubleArray()
template<typename I >
Read an array of 8-byte floats on standard IEEE format.
References Catch::begin, buffer, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::ParseIEEEDoubleBE(), and NRLib::NRLibPrivate::ParseIEEEDoubleLE(). Referenced by ReadStormBinarySurf(). ◆ ReadBinaryFloat()
Read a 4-byte float on standard IEEE format. ◆ ReadBinaryFloatArray()
template<typename I >
Read an array of 4-byte floats on standard IEEE format.
References Catch::begin, buffer, END_BIG_ENDIAN, END_LITTLE_ENDIAN, ParseIEEEFloatBE(), and NRLib::NRLibPrivate::ParseIEEEFloatLE(). Referenced by ReadSgriSurf(). ◆ ReadBinaryIbmFloat()
Read a 4-byte float on standard IEEE format. ◆ ReadBinaryIbmFloatArray()
template<typename I >
Read an array of 4-byte floats on standard IEEE format.
References Catch::begin, buffer, END_BIG_ENDIAN, END_LITTLE_ENDIAN, Opm::error, ParseIBMFloatBE(), NRLib::NRLibPrivate::ParseIBMFloatLE(), string, and ToString(). ◆ ReadBinaryInt()
Read a 4-byte integer from a binary file. ◆ ReadBinaryIntArray()
template<typename I >
Read an array of binary 4-byte integers.
References Catch::begin, buffer, END_BIG_ENDIAN, END_LITTLE_ENDIAN, ParseUInt32BE(), and NRLib::NRLibPrivate::ParseUInt32LE(). ◆ ReadBinaryShort()
Read a 2-byte integer from a binary file. ◆ ReadBinaryShortArray()
template<typename I >
Read an array of binary 2-byte integers.
References Catch::begin, buffer, END_BIG_ENDIAN, END_LITTLE_ENDIAN, ParseUInt16BE(), and NRLib::NRLibPrivate::ParseUInt16LE(). ◆ ReadIrapClassicAsciiSurf()
template<class A >
References NRLib::Grid2D< A >::begin(), CheckEndOfFile(), exprtk::details::numeric::constant::e, NRLib::NRLibPrivate::Equal(), NRLib::Grid2D< A >::GetN(), GetStem(), IRAP_MISSING, OpenRead(), ReadAsciiArrayFast(), NRLib::RegularSurface< A >::Resize(), NRLib::RegularSurface< A >::SetDimensions(), NRLib::RegularSurface< A >::SetMissingValue(), NRLib::RegularSurface< A >::SetName(), string, and ToString(). Referenced by NRLib::RegularSurface< A >::ReadFromFile(), and NRLib::RegularSurfaceRotated< A >::ReadFromFile(). ◆ ReadMulticolumnAsciiSurf()
template<class A >
References CheckEndOfFile(), exprtk::information::data(), DiscardRestOfLine(), exprtk::details::numeric::constant::e, FindMulticolumnAsciiLine(), GetStem(), MULT_IRAP_MISSING, OpenRead(), NRLib::RegularSurface< A >::SetMissingValue(), NRLib::RegularSurface< A >::SetName(), string, ToString(), and exprtk::details::z. Referenced by NRLib::RegularSurfaceRotated< A >::ReadFromFile(). ◆ ReadMultipleSgriSurf()
◆ ReadNext()
template<typename T >
Gets next token from file, and parses it as type T Might be relatively slow, due to typechecking, and counting line numbers.
References ReadNextToken(), and string. ◆ ReadNext< std::string >()
template<>
References ReadNextToken(), and string. ◆ ReadNextQuoted()
Reads the next, possibly quoted, string. ◆ ReadNextToken()
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. Referenced by ReadNext(), and ReadNext< std::string >(). ◆ ReadSgriSurf()
template<class A >
References NRLib::Grid2D< A >::begin(), exprtk::details::numeric::constant::e, NRLib::Grid2D< A >::GetN(), GetPath(), GetStem(), OpenRead(), ReadBinaryFloatArray(), ReplaceExtension(), NRLib::RegularSurface< A >::Resize(), NRLib::RegularSurface< A >::SetDimensions(), NRLib::RegularSurface< A >::SetMissingValue(), NRLib::RegularSurface< A >::SetName(), and string. Referenced by NRLib::RegularSurface< A >::ReadFromFile(), and NRLib::RegularSurfaceRotated< A >::ReadFromFile(). ◆ ReadStormBinarySurf()
template<class A >
References NRLib::Grid2D< A >::begin(), CheckEndOfFile(), DiscardRestOfLine(), exprtk::details::numeric::constant::e, NRLib::NRLibPrivate::Equal(), NRLib::Grid2D< A >::GetN(), GetStem(), OpenRead(), ReadBinaryDoubleArray(), NRLib::RegularSurface< A >::Resize(), NRLib::RegularSurface< A >::SetDimensions(), NRLib::RegularSurface< A >::SetMissingValue(), NRLib::RegularSurface< A >::SetName(), STORM_MISSING, string, and ToString(). Referenced by NRLib::RegularSurface< A >::ReadFromFile(), and NRLib::RegularSurfaceRotated< A >::ReadFromFile(). ◆ RemoveFile()
◆ RemovePath()
Get file name only (no path) from full file name. ◆ ReplaceExtension()
Replace file extension. Referenced by ReadSgriSurf(). ◆ Seek()
Seek to given position in file, works for large files. ◆ SkipComments()
Returns next line that not only contains whitespace, or starts with the given comment token.
◆ Substitute()
In string text replace all occurences odf string "out" with string "in". ◆ ToString()
template<typename T >
Referenced by ReadAsciiArrayFast(), ReadBinaryIbmFloatArray(), NRLib::RegularSurface< A >::ReadFromFile(), NRLib::RegularSurfaceRotated< A >::ReadFromFile(), ReadIrapClassicAsciiSurf(), ReadMulticolumnAsciiSurf(), ReadStormBinarySurf(), NRLib::RegularSurface< A >::WriteToFile(), and NRLib::RegularSurfaceRotated< A >::WriteToFile(). ◆ Uppercase()
Return uppercase of input string. ◆ Whitespace()
String with different kinds of whitespace characters. ◆ WriteAsciiArray()
template<typename I >
Writes array. References Catch::begin, count, and Opm::end. ◆ WriteBinaryDouble()
Write a 8-byte float on standard IEEE format. ◆ WriteBinaryDoubleArray()
template<typename I >
Write an array of 8-byte floats on standard IEEE format. References Catch::begin, buffer, Opm::end, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::WriteIEEEDoubleBE(), and NRLib::NRLibPrivate::WriteIEEEDoubleLE(). Referenced by WriteStormBinarySurf(). ◆ WriteBinaryFloat()
Write a 4-byte float on standard IEEE format. ◆ WriteBinaryFloatArray()
template<typename I >
Write an array of 4-byte floats on standard IEEE format. References Catch::begin, buffer, Opm::end, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::WriteIEEEFloatBE(), and NRLib::NRLibPrivate::WriteIEEEFloatLE(). ◆ WriteBinaryIbmFloat()
Write a 4-byte float on standard IEEE format. ◆ WriteBinaryIbmFloatArray()
template<typename I >
Write an array of 4-byte floats on standard IEEE format. References Catch::begin, buffer, Opm::end, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::WriteIBMFloatBE(), and NRLib::NRLibPrivate::WriteIBMFloatLE(). ◆ WriteBinaryInt()
Write a 4-byte integer to a binary file. ◆ WriteBinaryIntArray()
template<typename I >
Write an array of binary 4-byte integers. References Catch::begin, buffer, Opm::end, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::WriteUInt32BE(), and NRLib::NRLibPrivate::WriteUInt32LE(). ◆ WriteBinaryShort()
Write a 2-byte integer to a binary file. ◆ WriteBinaryShortArray()
template<typename I >
Write an array of binary 2-byte integers. References Catch::begin, buffer, Opm::end, END_BIG_ENDIAN, END_LITTLE_ENDIAN, NRLib::NRLibPrivate::WriteUInt16BE(), and NRLib::NRLibPrivate::WriteUInt16LE(). ◆ WriteIrapClassicAsciiSurf()
template<class A >
References NRLib::RegularSurface< A >::GetDX(), NRLib::RegularSurface< A >::GetDY(), NRLib::RegularSurface< A >::GetMissingValue(), NRLib::Grid2D< A >::GetN(), NRLib::Grid2D< A >::GetNI(), NRLib::Grid2D< A >::GetNJ(), NRLib::RegularSurface< A >::GetXMax(), NRLib::RegularSurface< A >::GetXMin(), NRLib::RegularSurface< A >::GetYMax(), NRLib::RegularSurface< A >::GetYMin(), IRAP_MISSING, NRLib::RegularSurface< A >::IsMissing(), and OpenWrite(). Referenced by NRLib::RegularSurface< A >::WriteToFile(), and NRLib::RegularSurfaceRotated< A >::WriteToFile(). ◆ WriteStormBinarySurf()
template<class A >
References NRLib::Grid2D< A >::begin(), exprtk::information::data(), NRLib::Grid2D< A >::end(), NRLib::RegularSurface< A >::GetDX(), NRLib::RegularSurface< A >::GetDY(), NRLib::RegularSurface< A >::GetMissingValue(), NRLib::Grid2D< A >::GetN(), NRLib::Grid2D< A >::GetNI(), NRLib::Grid2D< A >::GetNJ(), NRLib::RegularSurface< A >::GetXMax(), NRLib::RegularSurface< A >::GetXMin(), NRLib::RegularSurface< A >::GetYMax(), NRLib::RegularSurface< A >::GetYMin(), OpenWrite(), STORM_MISSING, and WriteBinaryDoubleArray(). Referenced by NRLib::RegularSurface< A >::WriteToFile(), and NRLib::RegularSurfaceRotated< A >::WriteToFile(). Variable Documentation◆ IRAP_MISSING
Referenced by ReadIrapClassicAsciiSurf(), and WriteIrapClassicAsciiSurf(). ◆ MULT_IRAP_MISSING
Referenced by ReadMulticolumnAsciiSurf(). ◆ STORM_MISSING
Referenced by ReadStormBinarySurf(), and WriteStormBinarySurf(). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||