te::ado Namespace Reference

Namespace for the TerraLib ADO driver implementation. More...

Classes

class  Connection
 A class that implements a connection to a ADO database. More...
 
class  DataSet
 Implementation of a dataset for the ADO driver. More...
 
class  DataSource
 The ADO driver. More...
 
class  Globals
 An static class with global definitions. More...
 
class  Module
 
class  SQLVisitor
 A visitor for building an SQL statement using ADO dialect. More...
 
class  Transactor
 The transactor class for the Microsoft Access driver. More...
 

Functions

void Blob2Variant (const char *blob, int size, _variant_t &var)
 Convert a blob to a variant. More...
 
te::da::DataSourceBuild ()
 
ADOX::DataTypeEnum Convert2Ado (int terralib)
 Bind TerraLib Type to ADO Type. More...
 
void Convert2Ado (const te::gm::Geometry *geo, _variant_t &var)
 Bind TerraLib geometry to ADO variant. More...
 
int Convert2Terralib (ADOX::DataTypeEnum adoType)
 Bind ADOX Type to TerraLib Type. More...
 
int Convert2Terralib (::DataTypeEnum adoType)
 Bind ADO Type to TerraLib Type. More...
 
te::dt::PropertyConvert2Terralib (ADOX::_ColumnPtr column)
 Bind ADO column to Terralib property. More...
 
te::da::ConstraintConvert2Terralib (ADOX::_KeyPtr key)
 Bind ADO key to Terralib constraint. More...
 
std::vector< te::dt::Property * > Convert2Terralib (ADOX::ColumnsPtr columns)
 Bind ADO columns to vector of Terralib properties. More...
 
std::string GetAdoStringType (const int &terralib)
 Bind TerraLib type to an ADO valid fiel type name. More...
 
std::auto_ptr< te::dt::DateTimeGetDateTime (std::string &value, std::string &mask, std::string &sepD, std::string &sepT)
 It gets the DateTime TerraLib 5 from string. More...
 
std::string GetFormattedDateTime (te::dt::DateTime *dateTime)
 It gets a formatted DateTime string for ADO. More...
 
const std::string & GetGeometryName (te::gm::GeomType t)
 It returns the geometry OGC names. More...
 
const te::gm::GeomType GetGeometryType (std::string t)
 It returns the geometry type concerning the OGC name. More...
 
int GetMonth (const std::string &month)
 It gets the index of a month. More...
 
int GetSRID (_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
 Read the geometry_columns table end return a SRID. More...
 
std::string GetSystemDateTimeFormat (std::string &indAM, std::string &indPM, std::string &sepD, std::string &sepT)
 It gets the system Date and Time format. More...
 
te::gm::GeomType GetType (_ConnectionPtr adoConn, std::string tableName, std::string geomPropName)
 Read the geometry_columns table end return a geometry type. More...
 
bool IsGeomProperty (_ConnectionPtr adoConn, std::string tableName, std::string columnName)
 Verifies whether is in the geometry_columns table. More...
 
bool IsZProperty (te::gm::GeomType type)
 Verifies whether Z property. More...
 
std::string MakeConnectionStr (const std::map< std::string, std::string > &dsInfo)
 Create a connection string based on a map. More...
 
void Variant2Blob (const _variant_t var, int size, char *&blob)
 Convert a variant to a blob. More...
 

Detailed Description

Namespace for the TerraLib ADO driver implementation.

Function Documentation

void te::ado::Blob2Variant ( const char *  blob,
int  size,
_variant_t &  var 
)

Convert a blob to a variant.

Parameters
blobBlob
sizeBlob size
varResult variant

Definition at line 56 of file Utils.cpp.

Referenced by Convert2Ado().

te::da::DataSource* te::ado::Build ( )
inline

Definition at line 36 of file DataSourceFactory.h.

Referenced by te::ado::Module::startup().

void te::ado::Convert2Ado ( const te::gm::Geometry geo,
_variant_t &  var 
)

Bind TerraLib geometry to ADO variant.

Parameters
geoTerraLib Geometry.
varAdo variant

Definition at line 208 of file Utils.cpp.

References Blob2Variant(), te::gm::Geometry::getSRID(), te::gm::Geometry::getWkb(), te::gm::Geometry::getWkbSize(), and te::common::NDR.

int te::ado::Convert2Terralib ( ::DataTypeEnum  adoType)
te::dt::Property * te::ado::Convert2Terralib ( ADOX::_ColumnPtr  column)

Bind ADO column to Terralib property.

Parameters
columnAdo Column.
Returns
TerraLib Property

Definition at line 405 of file Utils.cpp.

References Convert2Terralib(), te::dt::DATE, TE_TR, te::dt::TIME_DURATION, and te::dt::TIME_INSTANT.

te::da::Constraint * te::ado::Convert2Terralib ( ADOX::_KeyPtr  key)

Bind ADO key to Terralib constraint.

Parameters
keyAdo key.
Returns
TerraLib Constraint

Definition at line 496 of file Utils.cpp.

References Convert2Terralib(), te::da::PrimaryKey::setProperties(), te::da::UniqueKey::setProperties(), te::da::ForeignKey::setProperties(), and TE_TR.

std::vector< te::dt::Property * > te::ado::Convert2Terralib ( ADOX::ColumnsPtr  columns)

Bind ADO columns to vector of Terralib properties.

Parameters
columnsAdo columns.
Returns
Vector of TerraLib properties

Definition at line 486 of file Utils.cpp.

References Convert2Terralib().

std::string te::ado::GetAdoStringType ( const int &  terralib)

Bind TerraLib type to an ADO valid fiel type name.

TerraLib data type.

Returns
Valid ADO field type as string value.

Definition at line 174 of file Utils.cpp.

References Convert2Ado().

Referenced by te::ado::Transactor::changePropertyDefinition().

std::auto_ptr< te::dt::DateTime > te::ado::GetDateTime ( std::string &  value,
std::string &  mask,
std::string &  sepD,
std::string &  sepT 
)

It gets the DateTime TerraLib 5 from string.

Parameters
valueString value to be read.
maskSystem DateTime mask;
sepDDate separator.
sepTTime separator.
Returns
The TerraLib 5 DateTime.

Definition at line 1093 of file Utils.cpp.

References TE_TR, and te::common::Tokenize().

Referenced by te::ado::DataSet::getDateTime().

std::string te::ado::GetFormattedDateTime ( te::dt::DateTime dateTime)
int te::ado::GetMonth ( const std::string &  month)

It gets the index of a month.

Parameters
monthMonth name.
Returns
The month index.

Definition at line 1062 of file Utils.cpp.

References te::common::Convert2UCase().

Referenced by GetFormattedDateTime().

int te::ado::GetSRID ( _ConnectionPtr  adoConn,
std::string  tableName,
std::string  geomPropName 
)

Read the geometry_columns table end return a SRID.

Parameters
adoConnAdo connection.
tableNameThe table name.
geomPropNameThe geometry property name.
Returns
SRID of the geometry

Definition at line 828 of file Utils.cpp.

References TESTHR().

Referenced by te::ado::Transactor::getProperties().

std::string te::ado::GetSystemDateTimeFormat ( std::string &  indAM,
std::string &  indPM,
std::string &  sepD,
std::string &  sepT 
)

It gets the system Date and Time format.

Parameters
indAMAM indicator string.
indPMPM indicator string.
sepDDate separator.
sepTTime separator.
Returns
The full DateTime format.

Definition at line 924 of file Utils.cpp.

References te::common::Convert2UCase().

Referenced by te::ado::DataSet::getDateTime(), and GetFormattedDateTime().

te::gm::GeomType te::ado::GetType ( _ConnectionPtr  adoConn,
std::string  tableName,
std::string  geomPropName 
)

Read the geometry_columns table end return a geometry type.

Parameters
adoConnAdo connection.
tableNameThe table name.
geomPropNameThe geometry property name.
Returns
The geometry type

Definition at line 852 of file Utils.cpp.

References GetGeometryType(), and TESTHR().

Referenced by te::ado::Transactor::getProperties().

bool te::ado::IsGeomProperty ( _ConnectionPtr  adoConn,
std::string  tableName,
std::string  columnName 
)

Verifies whether is in the geometry_columns table.

Parameters
adoConnAdo connection
tableNameAdo table name
columnNameAdo column name
Returns
if is in geometry_columns table

Definition at line 878 of file Utils.cpp.

References TESTHR().

bool te::ado::IsZProperty ( te::gm::GeomType  type)

Verifies whether Z property.

Parameters
typegeometry type
Returns
if is Z property

Definition at line 917 of file Utils.cpp.

Referenced by te::ado::Transactor::insertIntoGeometryColumns().

std::string te::ado::MakeConnectionStr ( const std::map< std::string, std::string > &  dsInfo)

Create a connection string based on a map.

Parameters
dsInfoInformation Map.
Returns
ADO connection string

Definition at line 75 of file Utils.cpp.

Referenced by te::ado::DataSource::create(), te::ado::DataSource::open(), and te::ado::Transactor::Transactor().

void te::ado::Variant2Blob ( const _variant_t  var,
int  size,
char *&  blob 
)

Convert a variant to a blob.

Parameters
varVariant
sizeVariant size
blobResult variant

Definition at line 102 of file Utils.cpp.