get_Editable Method

WRAPPER_API bool get_Editable() const

 

Description

The get_Editable method indicates if the base data source can be modified.

If get_Editable returns false and a custom data source has been specified, the following will occur: New objects may always be added using Put or ImportFile, which will add the objects to the custom data source. The use of Remove or Put to alter or remove an existing custom object will succeed. The use of Remove or Put to alter or remove an existing base object will cause a GeoCalcException to be thrown with an ErrorCode specifying FileReadOnly.

If get_Editable returns false and no custom data source has been specified, the following will occur: The use of the Put or Remove methods or the ImportFile method will cause a GeoCalcException to be thrown with an ErrorCode specifying FileReadOnly.

 

Example

void DataSource_getEditable(GEOCALCPBW_NAMESPACE::DataSource & data)

{

if(data.get_IsLoaded() && data.get_Editable())

{

GEOCALCPBW_NAMESPACE::AngularUnit au;

au.get_Identifiers().Add(_towchar("GC"), _towchar("A_Super_Great_AngularUnit"));

 

if(! data.PutAngularUnit(au, TRUE))

{

AfxMessageBox("PutAngularUnit failed");

}

}

}