#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using Topology.Geometries;
namespace OSGeo.MapGuide.MaestroAPI.Feature
{
///
/// Provides a forward-only, read-only iterator for reading data. You must call
/// before you can access any data
///
public interface IReader : IDisposable, IRecord
{
///
/// Advances the reader to the next item and determines whether there is another object to read.
///
///
bool ReadNext();
///
/// Closes the object, freeing any resources it may be holding.
///
void Close();
}
///
/// Defines the types of readers
///
public enum ReaderType : int
{
///
/// The reader is a Data Reader
///
Data = 1,
///
/// The reader is a SQL Reader
///
Sql = 2,
///
/// The reader is a Feature Reader
///
Feature = 0
}
///
/// Provides a means for resetting a
/// instance
///
public interface IRecordReset
{
void Update(IRecord record);
}
///
/// Provides a means for initializing a
/// instance with instances
///
public interface IRecordInitialize
{
///
/// Gets the specified property value by name
///
///
///
PropertyValue GetValue(string name);
///
/// Adds the specified property value
///
///
///
void PutValue(string name, PropertyValue value);
}
///
/// Provides access to the property values within each result for a
///
public interface IRecord
{
///
/// Gets the number of fields in this record
///
int FieldCount { get; }
///
/// Gets the name of the field at the specified index
///
///
///
string GetName(int index);
///
/// Gets the CLR type of the field at the specified index
///
///
///
Type GetFieldType(int i);
///
/// Gets whether the specified property name has a null property value
///
///
///
bool IsNull(string name);
///
/// Gets whether the property value at the specified index has a null property value. You must
/// call this method first to determine if it is safe to call the corresponding GetXXX() methods
///
///
///
bool IsNull(int index);
///
/// Gets the boolean value of the specified property
///
///
///
bool GetBoolean(string name);
///
/// Gets the byte value of the specified property
///
///
///
byte GetByte(string name);
///
/// Gets the blob value of the specified property
///
///
///
byte[] GetBlob(string name);
///
/// Gets the clob value of the specified property
///
///
///
char[] GetClob(string name);
///
/// Gets the double value of the specified property
///
///
///
double GetDouble(string name);
///
/// Gets the datetime value of the specified property
///
///
///
DateTime GetDateTime(string name);
///
/// Gets the int16 value of the specified property
///
///
///
short GetInt16(string name);
///
/// Gets the int32 value of the specified property
///
///
///
int GetInt32(string name);
///
/// Gets the int64 value of the specified property
///
///
///
long GetInt64(string name);
///
/// Gets the single value of the specified property
///
///
///
float GetSingle(string name);
///
/// Gets the string value of the specified property
///
///
///
string GetString(string name);
///
/// Gets the geometry value of the specified property
///
///
///
IGeometry GetGeometry(string name);
///
/// Gets the boolean value at the specified index
///
///
///
bool GetBoolean(int index);
///
/// Gets the byte value at the specified index
///
///
///
byte GetByte(int index);
///
/// Gets the blob value at the specified index
///
///
///
byte[] GetBlob(int index);
///
/// Gets the clob value at the specified index
///
///
///
char[] GetClob(int index);
///
/// Gets the double value at the specified index
///
///
///
double GetDouble(int index);
///
/// Gets the datetime value at the specified index
///
///
///
DateTime GetDateTime(int index);
///
/// Gets the int16 value at the specified index
///
///
///
short GetInt16(int index);
///
/// Gets the int32 value at the specified index
///
///
///
int GetInt32(int index);
///
/// Gets the int64 value at the specified index
///
///
///
long GetInt64(int index);
///
/// Gets the single value at the specified index
///
///
///
float GetSingle(int index);
///
/// Gets the string value at the specified index
///
///
///
string GetString(int index);
///
/// Gets the geometry value at the specified index
///
///
///
IGeometry GetGeometry(int index);
//byte[] GetRaster(string name);
//byte[] GetRaster(int index);
///
/// Gets the object at the specified index
///
///
///
object this[int index] { get; }
///
/// Gets the object value for the specified property
///
///
///
object this[string name] { get; }
}
}