Rogue Wave Views
Maps Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvMapInput Class Reference

This class defines an input stream with extended reading capabilities. More...

#include <ilviews/maps/format/mapinput.h>

Public Member Functions

 IlvMapInput (std::istream &istr)
 Initializes an instance of IlvMapInput. More...
 
 IlvMapInput (const char *fileName)
 Initializes a new instance of IlvMapInput. More...
 
IlInt getIndex () const
 Returns the current index in the stream.
 
IlvMapsError getLastError () const
 Returns the code of last error that occurred.
 
std::istream * getStream () const
 Returns the input stream.
 
IlvMapsError read (char *data, int length)
 Reads from the input stream. More...
 
IlvMapsError readBigDouble (IlDouble &value)
 Reads a 64-bit IIIE double coded in big endian format. More...
 
IlvMapsError readBigDoubleArray (const IlDouble *values, IlInt count)
 Reads an array of 64-bit IIIE double coded in big endian format. More...
 
IlvMapsError readBigInt (IlInt &value)
 Reads a 32-bit integer coded in big endian format. More...
 
IlvMapsError readBigIntArray (const IlInt *values, IlInt count)
 Reads an array of 32-bit integer coded in big endian format. More...
 
IlvMapsError readBigShort (IlShort &value)
 Reads a 16-bit integer coded in big endian format. More...
 
IlvMapsError readBigShortArray (const IlShort *values, IlInt count)
 Reads an array of 16-bit integer coded in big endian format. More...
 
IlvMapsError readBigUnsignedInt (IlUInt &value)
 Reads a 32-bit unsigned integer coded in big endian format. More...
 
IlvMapsError readBigUnsignedIntArray (const IlUInt *values, IlInt count)
 Reads an array of 32-bit unsigned integer coded in big endian format. More...
 
IlvMapsError readBigUnsignedShort (IlUShort &value)
 Reads a 16-bit unsigned integer coded in big endian format. More...
 
IlvMapsError readByte (char &value)
 Reads and returns one input byte. More...
 
IlvMapsError readLittleDouble (IlDouble &value)
 Reads a 64-bit IIIE double coded in little endian format. More...
 
IlvMapsError readLittleDoubleArray (const IlDouble *values, IlInt count)
 Reads an array of 64-bit IIIE double coded in little endian format. More...
 
IlvMapsError readLittleInt (IlInt &value)
 Reads a 32-bit integer coded in little endian format. More...
 
IlvMapsError readLittleIntArray (const IlInt *values, IlInt count)
 Reads an array of 32-bit integer coded in little endian format. More...
 
IlvMapsError readLittleShort (IlShort &value)
 Reads a 16-bit integer coded in little endian format. More...
 
IlvMapsError readLittleShortArray (const IlShort *values, IlInt count)
 Reads an array of 16-bit integer coded in little endian format. More...
 
IlvMapsError readUnsignedByte (IlUChar &value)
 Reads and returns an unsigned byte. More...
 
IlvMapsError setLocation (IlInt loc)
 Sets the location where the next read operation will occur to the specified index. More...
 
IlvMapsError skipBytes (IlInt n)
 Skips input bytes. More...
 

Static Public Member Functions

static IlvMapsError EndOfFileError ()
 Returns the error code for End Of File.
 
static IlBoolean IsLSBFirst ()
 Queries the machine byte order (LSB or MSB). More...
 
static IlvMapsError ReadError ()
 Returns the error code for a Read Error.
 

Detailed Description

This class defines an input stream with extended reading capabilities.

Library: ilvmaps

Constructor & Destructor Documentation

§ IlvMapInput() [1/2]

IlvMapInput::IlvMapInput ( std::istream &  istr)

Initializes an instance of IlvMapInput.

Parameters
istrThe input stream.

§ IlvMapInput() [2/2]

IlvMapInput::IlvMapInput ( const char *  fileName)

Initializes a new instance of IlvMapInput.

The error flag is initially cleared.

Parameters
fileNameThe name of the input file.

Member Function Documentation

§ IsLSBFirst()

static IlBoolean IlvMapInput::IsLSBFirst ( )
static

Queries the machine byte order (LSB or MSB).

Returns
IlTrue if the machine stores internal values with the Less Significant Byte First, and IlFalse if the machine stores internal values with the Most Significant Byte First.

§ read()

IlvMapsError IlvMapInput::read ( char *  data,
int  length 
)

Reads from the input stream.

Parameters
dataThe string buffer where the read bytes are stored.
lengthThe number of bytes to read.
Returns
The error code if an error occurred, or IlvMaps::NoError.
Exceptions
IOExceptionif an exception occurs while reading the data.

§ readBigDouble()

IlvMapsError IlvMapInput::readBigDouble ( IlDouble value)

Reads a 64-bit IIIE double coded in big endian format.

Parameters
valueStores the return value.
Exceptions
IOExceptionif an exception occurs while reading the data.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigDoubleArray()

IlvMapsError IlvMapInput::readBigDoubleArray ( const IlDouble values,
IlInt  count 
)

Reads an array of 64-bit IIIE double coded in big endian format.

Parameters
valuesAn allocated array of IlDouble to store the result.
countThe number of double to read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigInt()

IlvMapsError IlvMapInput::readBigInt ( IlInt value)

Reads a 32-bit integer coded in big endian format.

Parameters
valueStores the return value.
Exceptions
IOExceptionif an exception occurs while reading.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigIntArray()

IlvMapsError IlvMapInput::readBigIntArray ( const IlInt values,
IlInt  count 
)

Reads an array of 32-bit integer coded in big endian format.

Parameters
valuesAn allocated array of IlvInt to store the result.
countThe number of integer to be read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigShort()

IlvMapsError IlvMapInput::readBigShort ( IlShort value)

Reads a 16-bit integer coded in big endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigShortArray()

IlvMapsError IlvMapInput::readBigShortArray ( const IlShort values,
IlInt  count 
)

Reads an array of 16-bit integer coded in big endian format.

Parameters
valuesAn allocated array of IlvShort to store the result.
countThe number of integer to be read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigUnsignedInt()

IlvMapsError IlvMapInput::readBigUnsignedInt ( IlUInt value)

Reads a 32-bit unsigned integer coded in big endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigUnsignedIntArray()

IlvMapsError IlvMapInput::readBigUnsignedIntArray ( const IlUInt values,
IlInt  count 
)

Reads an array of 32-bit unsigned integer coded in big endian format.

Parameters
valuesAn allocated array of IlvInt to store the result.
countThe number of integer to be read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readBigUnsignedShort()

IlvMapsError IlvMapInput::readBigUnsignedShort ( IlUShort value)

Reads a 16-bit unsigned integer coded in big endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readByte()

IlvMapsError IlvMapInput::readByte ( char &  value)

Reads and returns one input byte.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleDouble()

IlvMapsError IlvMapInput::readLittleDouble ( IlDouble value)

Reads a 64-bit IIIE double coded in little endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleDoubleArray()

IlvMapsError IlvMapInput::readLittleDoubleArray ( const IlDouble values,
IlInt  count 
)

Reads an array of 64-bit IIIE double coded in little endian format.

Parameters
valuesAn allocated array of IlDouble to store the result.
countThe number of double to read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleInt()

IlvMapsError IlvMapInput::readLittleInt ( IlInt value)

Reads a 32-bit integer coded in little endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleIntArray()

IlvMapsError IlvMapInput::readLittleIntArray ( const IlInt values,
IlInt  count 
)

Reads an array of 32-bit integer coded in little endian format.

Parameters
valuesAn allocated array of IlvInt to store the result.
countThe number of integer to be read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleShort()

IlvMapsError IlvMapInput::readLittleShort ( IlShort value)

Reads a 16-bit integer coded in little endian format.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readLittleShortArray()

IlvMapsError IlvMapInput::readLittleShortArray ( const IlShort values,
IlInt  count 
)

Reads an array of 16-bit integer coded in little endian format.

Parameters
valuesAn allocated array of IlvShort to store the result.
countThe number of integer to be read.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ readUnsignedByte()

IlvMapsError IlvMapInput::readUnsignedByte ( IlUChar value)

Reads and returns an unsigned byte.

Parameters
valueStores the return value.
Returns
The error code if an error occurred, or IlvMaps::NoError.

§ setLocation()

IlvMapsError IlvMapInput::setLocation ( IlInt  loc)

Sets the location where the next read operation will occur to the specified index.

Parameters
locThe index where the next read operation will occur.
Returns
The error code if an error occurred, or IlvMaps::NoError.
See also
getIndex().

§ skipBytes()

IlvMapsError IlvMapInput::skipBytes ( IlInt  n)

Skips input bytes.

Parameters
nThe number of bytes to be skipped.
Returns
The error code if an error occurred, or IlvMaps::NoError.

© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.