All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::dt::StringProperty Class Reference

The type for string types: FIXED_STRING, VAR_STRING or STRING. More...

#include <StringProperty.h>

Inheritance diagram for te::dt::StringProperty:
te::dt::SimpleProperty te::dt::Property

Public Member Functions

Propertyclone () const
 It returns a clone of the object. More...
 
te::common::CharEncoding getCharEncoding () const
 It returns the string property character encoding. More...
 
const std::string & getDatasetName () const
 It returns the name of the propery's dataset. More...
 
std::string * getDefaultValue () const
 It returns the default value associated to the property, or NULL if none is associated. More...
 
unsigned int getId () const
 It returns the property identifier. More...
 
const std::string & getName () const
 It returns the property name. More...
 
PropertygetParent () const
 It returns the parent of this property, or NULL, if it doesn't have one. More...
 
StringType getSubType () const
 It returns the string property sub type. More...
 
int getType () const
 It returns the property data type. More...
 
bool has (Property *p) const
 It checks if the Property "p" is associated to this property or any other parent. More...
 
bool isAutoNumber () const
 It returns true if the attribute is an autonumber, otherwise it returns false. More...
 
bool isRequired () const
 It returns true if the attribute is required, otherwise it returns false. More...
 
StringPropertyoperator= (const StringProperty &rhs)
 Assignment operator. More...
 
void setAutoNumber (bool a)
 It tells if the property is an autonumber or not. More...
 
void setCharEncoding (const te::common::CharEncoding &ce)
 It sets the string property character encoding. More...
 
void setDatasetName (const std::string &dsName)
 It sets the property name. More...
 
void setDefaultValue (std::string *d)
 It sets the default value associated to the property, or NULL if none is associated. More...
 
void setId (unsigned int id)
 It sets the property identifier. More...
 
void setName (const std::string &name)
 It sets the property name. More...
 
void setParent (Property *p)
 It associate this property to the informed parent. More...
 
void setRequired (bool r)
 It tells if the property is required or not. More...
 
void setSize (std::size_t s)
 It sets the maximum number of characters for a varying string, or the number of characters for a fixed length string. More...
 
void setSubtype (StringType t)
 It sets the string property sub type. More...
 
std::size_t size () const
 It returns the maximum number of characters for a varying string, or the number of characters for a fixed length string. No meaning for STRING. More...
 
 StringProperty (const std::string &name, StringType strType=STRING, std::size_t size=0, bool isRequired=false, std::string *defaultValue=0, unsigned int id=0, Property *parent=0)
 It constructs a new string property. More...
 
 StringProperty (const StringProperty &rhs)
 Copy constructor. More...
 
 ~StringProperty ()
 Destructor. More...
 

Protected Attributes

te::common::CharEncoding m_ce
 The string property character encoding. More...
 
std::string m_datasetName
 The property's dataset name. More...
 
std::string * m_defaultValue
 Default value. More...
 
unsigned int m_id
 An identification number that can be used internally. More...
 
bool m_isAutoNumber
 A flag that indicates if this is an autonumber or serial type. More...
 
bool m_isRequired
 This flag indicates if the attribute is required or not. More...
 
std::string m_name
 The property name. More...
 
Propertym_parent
 The parent property type: it must be a CompositeProperty. More...
 
std::size_t m_size
 Maximum number of characters for a varying string or the number of characters for a fixed length string. No meaning for STRING. More...
 
StringType m_strSubType
 The sub-type of this string property. More...
 
int m_type
 The property data type. More...
 

Detailed Description

The type for string types: FIXED_STRING, VAR_STRING or STRING.

See also
SimpleProperty, Property, NumericProperty, ArrayProperty, DateTimeProperty, CompositeProperty

Definition at line 47 of file StringProperty.h.

Constructor & Destructor Documentation

te::dt::StringProperty::StringProperty ( const std::string &  name,
StringType  strType = STRING,
std::size_t  size = 0,
bool  isRequired = false,
std::string *  defaultValue = 0,
unsigned int  id = 0,
Property parent = 0 
)

It constructs a new string property.

Parameters
nameThe attribute name.
strTypeThe string subtype. Must be one of: FIXED_STRING, VAR_STRING, or STRING.
sizeThe maximum size (or 0 for unlimited strings).
isRequiredIt indicates if the the property is required (mandatory) or not.
defaultValueThe default value to be used, if none is informed.
idThe property identifier.
parentA reference to the parent Property of the new object if it has one.
Postcondition
The string property will take the ownership of the defaultValue.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 32 of file StringProperty.cpp.

te::dt::StringProperty::StringProperty ( const StringProperty rhs)

Copy constructor.

Parameters
rhsThe right-hand-side copy used to copy from.
Note
This method is used by clone().

Definition at line 46 of file StringProperty.cpp.

te::dt::StringProperty::~StringProperty ( )
inline

Destructor.

Definition at line 84 of file StringProperty.h.

Member Function Documentation

te::dt::Property * te::dt::StringProperty::clone ( ) const
virtual

It returns a clone of the object.

The new property will NOT have associations to other properties.

Returns
A clone of the object.

Reimplemented from te::dt::SimpleProperty.

Definition at line 67 of file StringProperty.cpp.

te::common::CharEncoding te::dt::StringProperty::getCharEncoding ( ) const
inline

It returns the string property character encoding.

Returns
The string property character encoding.

Definition at line 130 of file StringProperty.h.

Referenced by te::stmem::DataSet::DataSet(), te::mem::DataSet::DataSet(), and te::ogr::DataSet::getPropertyCharEncoding().

const std::string& te::dt::Property::getDatasetName ( ) const
inlineinherited

It returns the name of the propery's dataset.

Returns
The the propery's dataset name.

Definition at line 144 of file Property.h.

Referenced by te::da::GetOIDDatasetProps().

std::string* te::dt::SimpleProperty::getDefaultValue ( ) const
inlineinherited

It returns the default value associated to the property, or NULL if none is associated.

Returns
The default value associated to the property, or NULL if none is associated.
Note
The caller of this method will not take the ownership of the given string.

Definition at line 127 of file SimpleProperty.h.

Referenced by te::pgis::SetColumnDef().

unsigned int te::dt::Property::getId ( ) const
inlineinherited

It returns the property identifier.

Returns
A number used to identify the property.
Warning
The identifier value may be used by data source implementations. So, don't rely on its value!

Definition at line 109 of file Property.h.

Referenced by te::da::DataSetTypeConverter::DataSetTypeConverter(), te::pgis::Transactor::getConstraints(), te::pgis::Transactor::getIndexes(), te::pgis::Transactor::getPropertyId(), and te::serialize::xml::Save().

const std::string& te::dt::Property::getName ( ) const
inlineinherited

It returns the property name.

Returns
The property name.
Note
For DataSetTypes the name can have namespace prefix or schema name prefix, it will depend on the data source implementation.

Definition at line 127 of file Property.h.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::DataSourceGraphMetadata::addEdgeProperty(), te::ado::Transactor::addForeignKey(), te::pgis::Transactor::addForeignKey(), te::sa::AddGraphEdgeAttribute(), te::sa::AddGraphVertexAttribute(), te::ado::Transactor::addPrimaryKey(), te::mem::DataSource::addProperty(), te::ogr::Transactor::addProperty(), te::sqlite::DataSourceTransactor::addProperty(), te::ado::Transactor::addProperty(), terralib4::Transactor::addProperty(), te::pgis::Transactor::addProperty(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::da::DataSourceCatalog::addRef(), te::pgis::Transactor::addSequence(), te::ado::Transactor::addUniqueKey(), te::graph::DataSourceGraphMetadata::addVertexProperty(), te::vp::PolygonToLineOp::buildOutDataSetType(), te::vp::LineToPolygonOp::buildOutDataSetType(), te::sa::KernelMapOperation::buildTree(), te::sa::KernelRatioOperation::buildTree(), te::da::DataSourceCatalog::checkFKsDependency(), te::da::DataSourceCatalog::checkSequenceDependency(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::ConstraintWidget::ConstraintWidget(), te::ogr::Convert2OGR(), te::sqlite::Convert2SQLCreate(), te::da::Create(), te::da::CreateAdapter(), te::mem::DataSource::createDataSet(), te::gdal::Transactor::createDataSet(), te::ogr::Transactor::createDataSet(), te::sqlite::DataSourceTransactor::createDataSet(), te::ado::Transactor::createDataSet(), te::pgis::Transactor::createDataSet(), te::vp::IntersectionMemory::createDataSetType(), te::sa::GeneralizedProximityMatrix::createDataSetType(), DataSetAdapterLayerReader(), DataSetAdapterLayerWriter(), te::qt::widgets::DataSetOptionsWizardPage::datasetPressed(), te::da::DataSetType::DataSetType(), te::da::DataSetTypeConverter::DataSetTypeConverter(), te::qt::widgets::DataSetDisplay::draw(), te::map::QueryLayerRenderer::draw(), te::map::AbstractLayerRenderer::draw(), te::map::DrawGeometries(), te::map::DrawRaster(), te::da::DataSourceCatalog::dropDependentSequenceEntry(), te::da::DataSourceCatalog::dropDependentSequences(), te::ado::Transactor::dropProperty(), te::qt::widgets::DataExchangerWizard::exchange(), te::qt::widgets::DirectExchangerDialog::exchangeToDatabase(), te::qt::widgets::Selection::executeSelection(), te::qt::widgets::DataSetCategoryItem::fetchMore(), te::qt::widgets::DataSetGroupItem::fetchMore(), te::qt::widgets::DataSetAdapterWidget::fillDataSetTable(), generateLayer(), te::ado::Transactor::getCheckConstraints(), te::pgis::Transactor::getConstraints(), terralib4::Transactor::getDataSetType(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeIndex(), te::da::GetEmptyOIDSet(), te::sqlite::DataSourceCatalogLoader::getGeometryInfo(), te::pgis::Transactor::getGeometryInfo(), te::sa::GeneralizedProximityMatrix::getGPMPropertyMap(), te::sa::GetGraphEdgeAttrIndex(), te::sa::GetGraphVertexAttrIndex(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::sqlite::DataSourceCatalogLoader::getIndexes(), te::ado::Transactor::getIndexes(), te::pgis::Transactor::getIndexes(), te::qt::widgets::Info::getInfo(), te::qt::widgets::ClassifierWizardPage::getInputParams(), te::qt::widgets::ClippingWizardPage::getLayerClipping(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), te::sqlite::DataSourceCatalogLoader::getPrimaryKey(), te::ado::Transactor::getPrimaryKey(), te::ado::Transactor::getProperties(), te::pgis::Transactor::getPropertyId(), te::da::GetPropertyInfo(), te::attributefill::VectorToVectorMemory::getPropertyName(), te::stmem::Transactor::getPropertyNames(), te::da::GetPropertyPos(), te::pgis::Transactor::getRasterInfo(), te::map::QueryLayer::getSchema(), te::sqlite::DataSourceCatalogLoader::getSpatialIndexes(), te::da::GetSQLValueNames(), te::sqlite::DataSourceCatalogLoader::getUniqueKey(), te::sqlite::DataSourceCatalogLoader::getUniqueKeys(), te::ado::Transactor::getUniqueKeys(), te::da::DataSourceCatalog::indexFKs(), te::da::DataSourceCatalog::indexSequenceDependency(), te::qt::widgets::IndexWidget::IndexWidget(), te::edit::FeatureAttributesDialog::initialize(), te::ado::Transactor::insertIntoGeometryColumns(), te::qt::widgets::ChartLayerWidget::listAttributes(), te::qt::widgets::GroupingWidget::listAttributes(), te::da::LoadFull(), te::da::LoadProperties(), te::qt::widgets::GroupingWidget::onImportPushButtonClicked(), te::qt::widgets::DatapPropertiesWidget::onInputDataToolButtonTriggered(), te::qt::widgets::SHP2PostGISDialog::onOkPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::qt::widgets::DataPropertiesDialog::onOkPushButtonClicked(), te::qt::widgets::ROIManagerWidget::onPointPicked(), te::attributefill::RasterToVectorDialog::onRasterComboBoxChanged(), te::qt::widgets::DataSet2Layer::operator()(), te::da::DataSourceCatalog::remove(), te::graph::DataSourceGraphMetadata::removeEdgeProperty(), te::da::DataSourceCatalog::removeRef(), te::graph::DataSourceGraphMetadata::removeVertexProperty(), te::da::DataSourceCatalog::rename(), te::qt::widgets::DataSetTableView::retypeColumn(), te::vp::PolygonToLineMemory::run(), te::vp::LineToPolygonMemory::run(), te::vp::AggregationQuery::run(), te::vp::IntersectionQuery::run(), te::vp::BufferQuery::run(), te::vp::AggregationMemory::run(), te::attributefill::VectorToRaster::run(), te::attributefill::RasterToVector::run(), te::addressgeocoding::AddressGeocodingOp::run(), te::attributefill::VectorToVectorMemory::run(), te::serialize::xml::Save(), te::qt::widgets::DataSetOptionsWizardPage::set(), te::qt::widgets::PropertyConverterDialog::set(), te::attributefill::VectorToVectorDialog::setFunctionsByLayer(), and terralib4::TableDataSet::TableDataSet().

StringType te::dt::StringProperty::getSubType ( ) const
inline

It returns the string property sub type.

Returns
The string property sub type.

Definition at line 100 of file StringProperty.h.

Referenced by te::pgis::SetColumnDef().

int te::dt::Property::getType ( ) const
inlineinherited

It returns the property data type.

Returns
The property data type.

Definition at line 161 of file Property.h.

Referenced by te::ado::Transactor::addForeignKey(), te::ado::Transactor::addPrimaryKey(), te::mem::DataSource::addProperty(), te::ogr::Transactor::addProperty(), te::sqlite::DataSourceTransactor::addProperty(), te::ado::Transactor::addProperty(), terralib4::Transactor::addProperty(), te::pgis::Transactor::addProperty(), te::ado::Transactor::addUniqueKey(), te::ogr::Transactor::changePropertyDefinition(), te::graph::LayerRenderer::checkEdgeGeometryProperty(), te::da::DataSourceCatalog::checkSequenceDependency(), te::graph::LayerRenderer::checkVertexGeometryProperty(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::ogr::Convert2OGR(), te::da::CreateAdapter(), te::sqlite::DataSourceTransactor::createDataSet(), te::graph::DataSourceGraphMetadata::createGraphTableEdgeModel(), te::graph::DataSourceGraphMetadata::createVertexAttrTable(), te::da::DataSetTypeConverter::DataSetTypeConverter(), te::da::DataSourceCatalog::dropDependentSequenceEntry(), te::da::DataSourceCatalog::dropDependentSequences(), te::ado::Transactor::dropProperty(), te::qt::widgets::DataSetCategoryItem::fetchMore(), te::qt::widgets::DataSetGroupItem::fetchMore(), te::qt::widgets::DataSetAdapterWidget::fillDataSetTable(), te::dt::CompositeProperty::findFirstPropertyOfType(), te::sqlite::DataSourceCatalogLoader::getDataSetType(), te::da::GetEmptyOIDSet(), te::qt::widgets::WhereClauseWidget::getExpression(), te::da::GetFirstSpatialProperty(), te::vp::MultipartToSinglepart::getOutDst(), te::attributefill::VectorToVectorMemory::getOutputDataSetType(), te::pgis::Transactor::getProperties(), te::pgis::Transactor::getProperty(), te::pgis::Transactor::getPropertyId(), te::da::GetPropertyInfo(), te::sqlite::DataSourceCatalogLoader::getSpatialIndexes(), te::sqlite::GetSQLType(), te::pgis::GetSQLValue(), te::vp::IntersectionOp::getTabularProps(), te::da::DataSourceCatalog::indexSequenceDependency(), te::qt::widgets::ChartLayerWidget::listAttributes(), te::qt::widgets::GroupingWidget::listAttributes(), te::da::DataSetTypeConverter::needConverter(), te::qt::widgets::GroupingWidget::onImportPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::qt::widgets::DataSetTableView::retypeColumn(), te::attributefill::VectorToVectorMemory::run(), te::graph::DataSourceGraphMetadata::saveProperty(), te::vp::GeometricOpMemory::SetAggregByAttribute(), te::pgis::SetColumnDef(), and te::attributefill::VectorToVectorDialog::setFunctionsByLayer().

bool te::dt::SimpleProperty::has ( Property p) const
virtualinherited

It checks if the Property "p" is associated to this property or any other parent.

This method can be used to ask if a given Property belongs to a more complex type (like: CompositeProperty or DataSetType).

Parameters
pThe Property we are checking.
Returns
True if the given Property "p" is associated to to this Property, otherwise, returns false.

Implements te::dt::Property.

Definition at line 80 of file SimpleProperty.cpp.

bool te::dt::SimpleProperty::isAutoNumber ( ) const
inlineinherited

It returns true if the attribute is an autonumber, otherwise it returns false.

Returns
True if the attribute is an autonumber, otherwise it returns false.

Definition at line 111 of file SimpleProperty.h.

Referenced by te::pgis::SetColumnDef().

bool te::dt::SimpleProperty::isRequired ( ) const
inlineinherited

It returns true if the attribute is required, otherwise it returns false.

Returns
True if the attribute is required, otherwise it returns false.

Definition at line 97 of file SimpleProperty.h.

Referenced by te::sqlite::DataSourceTransactor::addProperty(), te::ado::Transactor::addProperty(), te::sqlite::Convert2SQLCreate(), and te::pgis::SetColumnDef().

te::dt::StringProperty & te::dt::StringProperty::operator= ( const StringProperty rhs)

Assignment operator.

Parameters
rhsThe right-hand-side copy used to copy from.
Returns
A reference to this object.

Definition at line 53 of file StringProperty.cpp.

References m_size, m_strSubType, and te::dt::SimpleProperty::operator=().

void te::dt::StringProperty::setCharEncoding ( const te::common::CharEncoding ce)
inline

It sets the string property character encoding.

Parameters
ceThe character encoding type.

Definition at line 137 of file StringProperty.h.

Referenced by te::ogr::Convert2TerraLib().

void te::dt::Property::setDatasetName ( const std::string &  dsName)
inlineinherited

It sets the property name.

Parameters
nameThe new property name.
Warning
Take care when calling this method for a DataSetType associated to a DataSourceCatalog. Prefer using the rename method on the DataSourceCatalog API instead of using this method.

Definition at line 154 of file Property.h.

void te::dt::SimpleProperty::setDefaultValue ( std::string *  d)
inherited

It sets the default value associated to the property, or NULL if none is associated.

Parameters
dThe default value associated to the property, or NULL if none is associated.
Note
The SimpleProperty qill take the ownership of the given string.

Definition at line 74 of file SimpleProperty.cpp.

void te::dt::Property::setName ( const std::string &  name)
inlineinherited
void te::dt::SimpleProperty::setRequired ( bool  r)
inlineinherited

It tells if the property is required or not.

Parameters
rIf true the property is marked as required, otherwise it is not required.

Definition at line 104 of file SimpleProperty.h.

Referenced by te::attributefill::VectorToVectorMemory::getOutputDataSetType(), and te::ado::Transactor::getProperties().

void te::dt::StringProperty::setSize ( std::size_t  s)
inline

It sets the maximum number of characters for a varying string, or the number of characters for a fixed length string.

This value has no meaning for a STRING.

Parameters
sizeThe maximum size.

Definition at line 123 of file StringProperty.h.

Referenced by te::graph::DataSourceGraphMetadata::createGraphAttributesTable(), te::graph::DataSourceGraphMetadata::createGraphMetadataTable(), te::qt::widgets::StringPropertyWidget::fillProperty(), and te::ado::Transactor::getProperties().

void te::dt::StringProperty::setSubtype ( StringType  t)
inline

It sets the string property sub type.

Parameters
tThe string property sub type.

Definition at line 107 of file StringProperty.h.

Referenced by te::qt::widgets::StringPropertyWidget::fillProperty().

std::size_t te::dt::StringProperty::size ( ) const
inline

It returns the maximum number of characters for a varying string, or the number of characters for a fixed length string. No meaning for STRING.

Returns
The maximum number of characters for a varying string, or the number of characters for a fixed length string. No meaning for STRING.

Definition at line 114 of file StringProperty.h.

Referenced by te::ado::Transactor::addProperty(), and te::pgis::SetColumnDef().

Member Data Documentation

te::common::CharEncoding te::dt::StringProperty::m_ce
protected

The string property character encoding.

Definition at line 152 of file StringProperty.h.

std::string te::dt::Property::m_datasetName
protectedinherited

The property's dataset name.

Definition at line 208 of file Property.h.

Referenced by te::dt::Property::operator=().

std::string* te::dt::SimpleProperty::m_defaultValue
protectedinherited

Default value.

Definition at line 164 of file SimpleProperty.h.

Referenced by te::dt::SimpleProperty::operator=(), and te::dt::SimpleProperty::SimpleProperty().

unsigned int te::dt::Property::m_id
protectedinherited

An identification number that can be used internally.

Definition at line 205 of file Property.h.

Referenced by te::dt::Property::operator=().

bool te::dt::SimpleProperty::m_isAutoNumber
protectedinherited

A flag that indicates if this is an autonumber or serial type.

Definition at line 163 of file SimpleProperty.h.

Referenced by te::dt::SimpleProperty::operator=().

bool te::dt::SimpleProperty::m_isRequired
protectedinherited

This flag indicates if the attribute is required or not.

Definition at line 162 of file SimpleProperty.h.

Referenced by te::dt::SimpleProperty::operator=().

std::string te::dt::Property::m_name
protectedinherited

The property name.

Definition at line 207 of file Property.h.

Referenced by te::dt::Property::operator=().

Property* te::dt::Property::m_parent
protectedinherited

The parent property type: it must be a CompositeProperty.

Definition at line 204 of file Property.h.

std::size_t te::dt::StringProperty::m_size
protected

Maximum number of characters for a varying string or the number of characters for a fixed length string. No meaning for STRING.

Definition at line 150 of file StringProperty.h.

Referenced by operator=().

StringType te::dt::StringProperty::m_strSubType
protected

The sub-type of this string property.

Definition at line 151 of file StringProperty.h.

Referenced by operator=().

int te::dt::Property::m_type
protectedinherited

The property data type.

Definition at line 206 of file Property.h.

Referenced by te::dt::Property::operator=().


The documentation for this class was generated from the following files: