rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvShapeDBFReader Class Reference

This class reads attributes from .dbf files. More...

#include <ilviews/maps/format/shapefile/dbfreader.h>

List of all members.

Public Member Functions

 IlvShapeDBFReader (IL_STDPREF istream &stream)
 Initializes an IlvShapeDBFReader to read from the specified input stream.
 IlvShapeDBFReader (const char *filename)
 Initializes an IlvShapeDBFReader to read from the file whose name is specified.
int getCurrentIndex ()
 Returns the index of the next field that will be read.
const IlvFeatureAttributeInfogetInfo ()
 Returns a description of the attributes.
IlvMapsError getInitStatus ()
 Checks the initialization status of this reader.
IlvFeatureAttributePropertygetNextRecord (IlvMapsError &status)
 Reads the next record in the .dbf file. The caller is responsible for deallocation of returned data.
int getRecordCount ()
 Returns the number of records contained in the .dbf file from which the attributes are read.
IlvFeatureAttributePropertyreadRecord (int index, IlvMapsError &status)
 Reads the record corresponding to the specified index (see restrictions below).
Restrictions:.

Detailed Description

This class reads attributes from .dbf files.

Library: ilvmaps

This class can be used to read shape files with the .dbf extension. The .dbf files contain the attributes of the map objects.

This reader can be used as an iterator on a .dbf file. It can also be used to directly access the records in the file (or more precisely their index) if it was created with the constructor that takes a file name as argument.

See also:
IlvShapeFileReader

Constructor & Destructor Documentation

IlvShapeDBFReader::IlvShapeDBFReader ( const char *  filename  ) 

Initializes an IlvShapeDBFReader to read from the file whose name is specified.

Parameters:
filename The name of the input file.
IlvShapeDBFReader::IlvShapeDBFReader ( IL_STDPREF istream &  stream  ) 

Initializes an IlvShapeDBFReader to read from the specified input stream.

Parameters:
stream The input stream.

Member Function Documentation

int IlvShapeDBFReader::getCurrentIndex (  ) 

Returns the index of the next field that will be read.

Returns:
The index of the next field that will be read.
const IlvFeatureAttributeInfo* IlvShapeDBFReader::getInfo (  ) 

Returns a description of the attributes.

Returns the types and names of the field contained in the .dbf file.

Returns:
An IlvFeatureAttributeInfo that describes this attribute file.
IlvMapsError IlvShapeDBFReader::getInitStatus (  ) 

Checks the initialization status of this reader.

Returns:
IlvMaps::NoError() if the initialization of this reader is successful, or an error if an error occured during the initalization.
IlvFeatureAttributeProperty* IlvShapeDBFReader::getNextRecord ( IlvMapsError &  status  ) 

Reads the next record in the .dbf file. The caller is responsible for deallocation of returned data.

Parameters:
status An IlvMapsError to store the status of the read process.
Returns:
The read feature attributes.
int IlvShapeDBFReader::getRecordCount (  ) 

Returns the number of records contained in the .dbf file from which the attributes are read.

Returns:
The number of records.
IlvFeatureAttributeProperty* IlvShapeDBFReader::readRecord ( int  index,
IlvMapsError &  status 
)

Reads the record corresponding to the specified index (see restrictions below).
Restrictions:.

  • Since this function uses a random access to the file, this method can only be called when this dbf reader is built from a filename or a random access able input stream.
  • Since this function changes the current index, it should not be used if the reader itself is used by another feature iterator, such as the IlvShapeFileReader.
Parameters:
index The index of the record to be read, in the range [0, this->getRecordCount()].
status An IlvMapsError to store the status of the read process.
Returns:
The read feature attributes.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.