MIE::FORMAT Class Reference

The base class for all import/export modules. More...

#include <mie/format.h>

Inheritance diagram for MIE::FORMAT:
Inheritance graph
[legend]

List of all members.

Public Types

enum  SORTMETHOD { SORT_ByName = 0, SORT_ByDesc = 1, SORT_ByExtn = 2 }
enum  TESTRESULT {
  TESTRESULT_No = 0, TESTRESULT_Yes = 1, TESTRESULT_Unknown = 2, TESTRESULT_CannotTest = 3,
  TESTRESULT_CantOpen = 4, TESTRESULT_YesPreferred = 5, TESTRESULT_YesLowPriority = 6
}

Public Member Functions

virtual ~FORMAT ()
JOB_EXPORTAllocJobExport (const SETTINGS &settings) const
JOB_IMPORTAllocJobImport (OBJTYPEFLAG ObjectType, const SETTINGS &settings) const
SETTINGSAllocSettings (MODE mode, OBJTYPEFLAG ObjType=OBJTYPEFLAG_ALL) const
UI_BASEAllocUserInterface (SETTINGS &settings) const
ERRVALUE AnalyzeObjects (const RVC::OBJITEMLIST &objects, SETTINGS *settings) const
ERRVALUE AnalyzeSources (const MISTRINGLIST &sourcelist, SETTINGS *settings) const
bool CanExport (RVC::OBJTYPE objtype) const
bool CanExportSupportCRS (const SPATREF::COORDREFSYS &crs) const
bool CanExportToSingleFile (const RVC::OBJITEMLIST &objects) const
bool CanImport (RVC::OBJTYPE objtype) const
ERRVALUE Export (const RVC::OBJITEMLIST &sources, const MISTRING &dest, const SETTINGS &settings) const
bool FeatureIsOptional (FEATURE feature) const
MISTRING GetDataSourceName (const MISTRING &DataSource) const
const char * GetDefaultFileExtn () const
OBJTYPEFLAG GetEditObjType () const
void GetExportDefaultCRS (SPATREF::COORDREFSYS &crs, const DRECT3D &Extents) const
RVC::GETOBJFILTERGetExportObjectFilter () const
OBJTYPEFLAG GetExportObjTypes () const
const MISTRINGGetFixedSource () const
void GetFormatDesc (MISTRING &str) const
const char * GetFormatName () const
FORMATTYPE GetFormatType () const
GETFILEFILTERGetImportFileFilter () const
const char * GetImportFilePrompt () const
TEXTID GetImportFilePromptTEXTID () const
OBJTYPEFLAG GetImportObjTypes () const
OBJTYPEFLAG GetIntermediateObjType (OBJTYPEFLAG PreferredObjType) const
int GetObjItemList (const MISTRING &source, RVC::OBJITEMLIST &items, const SETTINGS &settings) const
SML::CLASSGetSMLClass (RVC::OBJTYPE ObjType) const
SML::CLASSMEMBERGetSMLClassMembers (RVC::OBJTYPE ObjType) const
const char * GetSMLClassName (RVC::OBJTYPE ObjType) const
const STRUTF8GetSource () const
bool HasFeature (FEATURE feature) const
ERRVALUE Import (const MISTRING &source, RVC::OBJITEMLIST &dest, const SETTINGS &settings) const
ERRVALUE ImportMulti (const MISTRINGLIST &sources, const SIMPLE_ARRAY< int > &NumObjectsInFile, const RVC::OBJITEMLIST &objitems, const SETTINGS &settings, MISTRING &ErrorLog) const
ERRVALUE SelectDataSources (MISTRINGLIST &sources, const RVC::OBJITEMLIST *objitems=0) const
void SetExportObjectFilter (RVC::GETOBJFILTER *pExportObjectFilter)
void SetImportFileFilter (GETFILEFILTER *pImportFileFilter)
bool SupportsEncoding (CHAR_ENCODING encoding) const
TESTRESULT TestFile (const FILEPATH &filepath, bool TestByExtn=true) const
TESTRESULT TestObject (const RVC::OBJITEM &objitem) const

Static Public Member Functions

static int AddFormatsAll ()
static int AddFormatsCAD ()
static int AddFormatsDatabase ()
static int AddFormatsRaster ()
static int AddFormatsShape ()
static int AddFormatsTIN ()
static int AddFormatsVector ()
static void EnableSML ()
static const FORMATFindFormat (const FILEPATH &filepath, MODE mode=MODE_Import, OBJTYPEFLAG ObjType=OBJTYPEFLAG_ALL)
static bool FindFormats (SIMPLE_ARRAY< const FORMAT * > &FormatList, const FILEPATH &filepath, MODE mode=MODE_Import, OBJTYPEFLAG ObjType=OBJTYPEFLAG_ALL)
static const FORMATGetFormat (FORMATTYPE FormatType)
static ERRVALUE GetFormatList (SIMPLE_ARRAY< const FORMAT * > &formats, MODE mode, OBJTYPEFLAG ObjectType)
static int SortFormatList (SORTMETHOD sort=SORT_ByName, bool forward=true)

Protected Member Functions

 FORMAT (FORMATTYPE FormatType, OBJTYPEFLAG ImportObjType, MODE Modes, const char *FormatName, const char *source, OBJTYPEFLAG ExportObjType=OBJTYPEFLAG_None)
void AddFeatures (FEATURE features)
OBJTYPEFLAG GetExportObjTypeFlag () const
OBJTYPEFLAG GetImportObjTypeFlag () const
const char * GetSMLBaseClassName (RVC::OBJTYPE objtype) const
void SetExportObjTypes (OBJTYPEFLAG objtypes)
void SetFormatName (const char *name)
void SetImportObjTypes (OBJTYPEFLAG objtypes)
void SetSource (const char *source)
virtual ERRVALUE v_AnalyzeSource (const MISTRING &source, SETTINGS *settings) const
virtual ERRVALUE v_AnalyzeSources (const MISTRINGLIST &sourcelist, SETTINGS *settings) const
virtual ERRVALUE v_ImportMulti (const MISTRINGLIST &sources, const SIMPLE_ARRAY< int > &NumObjectsInFile, const RVC::OBJITEMLIST &objitems, const SETTINGS &settings, MISTRING &ErrorLog) const

Protected Attributes

FEATURESET m_FeatureSet
FEATURESET m_OptionalFeatureSet

Private Member Functions

SML::CLASSSetupSMLClass (RVC::OBJTYPE ObjType)
void SetupSMLClasses ()
virtual JOB_EXPORTv_AllocJobExport (const SETTINGS &settings) const
virtual JOB_IMPORTv_AllocJobImport (OBJTYPEFLAG ObjectType, const SETTINGS &settings) const
virtual SETTINGSv_AllocSettings (MODE mode, OBJTYPEFLAG ObjType=OBJTYPEFLAG_ALL) const
virtual UI_BASEv_AllocUserInterface (SETTINGS &settings) const
virtual DEPRECATED ERRVALUE v_AnalyzeFile (const FILEPATH &source, SETTINGS *settings) const
virtual ERRVALUE v_AnalyzeObjects (const RVC::OBJITEMLIST &objects, SETTINGS *settings) const
virtual bool v_CanExport (RVC::OBJTYPE objtype) const
virtual bool v_CanExportSupportCRS (const SPATREF::COORDREFSYS &crs) const
virtual bool v_CanExportToSingleFile (const RVC::OBJITEMLIST &objects) const
virtual bool v_CanImport (RVC::OBJTYPE objtype) const
virtual ERRVALUE v_Export (const MISTRING &dest, const SETTINGS &settings, const SIMPLE_ARRAY< JOB_EXPORT * > &jobs) const
virtual MISTRING v_GetDataSourceName (const MISTRING &DataSource) const
virtual const char * v_GetDefaultFileExtn () const
virtual OBJTYPEFLAG v_GetEditObjType () const
virtual void v_GetExportDefaultCRS (SPATREF::COORDREFSYS &crs, const DRECT3D &Extents) const
virtual const MISTRINGv_GetFixedSource () const
virtual void v_GetFormatDesc (MISTRING &desc) const =0
virtual const char * v_GetImportFilePrompt () const
virtual TEXTID v_GetImportFilePromptTEXTID () const
OBJTYPEFLAG v_GetIntermediateObjType (OBJTYPEFLAG PreferredObjType) const
virtual int v_GetObjItemList (const MISTRING &source, RVC::OBJITEMLIST &items, const SETTINGS &settings) const
virtual SMLCLASSMEMBERv_GetSMLClassMembers (RVC::OBJTYPE ObjType) const
virtual const char * v_GetSMLClassName (RVC::OBJTYPE ObjType) const
virtual ERRVALUE v_Import (const MISTRING &source, const SETTINGS &settings, const SIMPLE_ARRAY< JOB_IMPORT * > &jobs) const
virtual ERRVALUE v_SelectDataSource (MISTRING &DataSource, const RVC::OBJITEM *objitem=0) const
virtual ERRVALUE v_SelectDataSources (MISTRINGLIST &DataSources, const RVC::OBJITEMLIST *objitems=0) const
virtual bool v_SupportsEncoding (CHAR_ENCODING encoding) const
virtual TESTRESULT v_TestFile (const FILEPATH &filepath) const
virtual TESTRESULT v_TestObject (const RVC::OBJITEM &objitem) const

Static Private Member Functions

static void InstallSMLClasses (SML::CALLBACKSTRUCT *cbs, void *)

Detailed Description

The base class for all import/export modules.

You must at least create a MIE::FORMAT-derived class for your module. If your module has its own format-specific settings that require a user-interface, you should also make MIE::UI_BASE and MIE::SETTINGS-derived classes. You can also derive from MIE::JOB_BASE if you have setup and/or cleanup to do for each output object / file.

You will also need to add an installer function for your module. Installing the format just means allocating it with new (don't need to return it). If your format is not available on some platform, this function should just return 0 for that platform. You also need to add a prototype for the function in mie/install.h and call the installer from the appropriate FORMAT AddFormats method in libmi/mieinstall.c.

The MIE classes are used as follows (from the Import / Export interface):

When used in an SML script (via the SML Import / Export classes), the MIE classes work the same way except that there is no MIE::UI_BASE instance. The MIE::SETTINGS members are to be modified through the SML class members.


Member Enumeration Documentation

Enumerator:
SORT_ByName 
SORT_ByDesc 
SORT_ByExtn 

Result codes for Test... methods.

Enumerator:
TESTRESULT_No 

File is not of test format.

TESTRESULT_Yes 

File is of test format.

TESTRESULT_Unknown 

Unable to determine if of specified format.

TESTRESULT_CannotTest 

Format does not support test.

TESTRESULT_CantOpen 

Unable to open file.

TESTRESULT_YesPreferred 
TESTRESULT_YesLowPriority 

< Can handle this and this is the preferred format for this type


Constructor & Destructor Documentation

virtual MIE::FORMAT::~FORMAT (  )  [virtual]

Destructor.

MIE::FORMAT::FORMAT ( FORMATTYPE  FormatType,
OBJTYPEFLAG  ImportObjType,
MODE  Modes,
const char *  FormatName,
const char *  source,
OBJTYPEFLAG  ExportObjType = OBJTYPEFLAG_None 
) [protected]

constructor

Parameters:
FormatName name used as ini key, SML Class name, etc.
source string to use for "source" in RVC objects. can pass __FILE__ (will extract out the name-only part)
ExportObjType Will be set to 'ImportObjType' if the default is used

Member Function Documentation

void MIE::FORMAT::AddFeatures ( FEATURE  features  )  [inline, protected]

Add features supported by format.

static int MIE::FORMAT::AddFormatsAll (  )  [static]
static int MIE::FORMAT::AddFormatsCAD (  )  [static]
static int MIE::FORMAT::AddFormatsDatabase (  )  [static]
static int MIE::FORMAT::AddFormatsRaster (  )  [static]
static int MIE::FORMAT::AddFormatsShape (  )  [static]
static int MIE::FORMAT::AddFormatsTIN (  )  [static]
static int MIE::FORMAT::AddFormatsVector (  )  [static]
JOB_EXPORT* MIE::FORMAT::AllocJobExport ( const SETTINGS settings  )  const [inline]

Allocate a JOB_EXPORT for this format Caller should free when done.

JOB_IMPORT* MIE::FORMAT::AllocJobImport ( OBJTYPEFLAG  ObjectType,
const SETTINGS settings 
) const [inline]

Allocate a JOB_IMPORT for this format Caller should free when done.

SETTINGS* MIE::FORMAT::AllocSettings ( MODE  mode,
OBJTYPEFLAG  ObjType = OBJTYPEFLAG_ALL 
) const

Allocate a SETTINGS for this format.

Will call settings ReadParmsIni() Caller should free when done.

UI_BASE* MIE::FORMAT::AllocUserInterface ( SETTINGS settings  )  const

Allocate a User Interface Caller should free when done.

ERRVALUE MIE::FORMAT::AnalyzeObjects ( const RVC::OBJITEMLIST objects,
SETTINGS settings 
) const [inline]

Analyze a set of objects and determine initial export settings.

ERRVALUE MIE::FORMAT::AnalyzeSources ( const MISTRINGLIST sourcelist,
SETTINGS settings 
) const [inline]

Analyze a file and determine initial import settings.

bool MIE::FORMAT::CanExport ( RVC::OBJTYPE  objtype  )  const

Return true a given object type can be exported to this format Special case: RVC::OBJTYPE_All will return true if the format supports exporting at all and false if it doesn't.

bool MIE::FORMAT::CanExportSupportCRS ( const SPATREF::COORDREFSYS crs  )  const [inline]

Given a CRS, determine if the export format can support it.

Default returns 'false'. If 'false' is returned, v_GetDefaultCRS() is called

bool MIE::FORMAT::CanExportToSingleFile ( const RVC::OBJITEMLIST objects  )  const [inline]

Test multiple objects to see if they can be exported as a unit to a single file.

This is used to determine if the "Export to single file" toggle is enabled.

bool MIE::FORMAT::CanImport ( RVC::OBJTYPE  objtype  )  const

Return true if this format can import to a given object type Special case: RVC::OBJTYPE_All will return true if the format supports importing at all and false if it doesn't.

static void MIE::FORMAT::EnableSML (  )  [static]

Function to register MIE classes and functions with SML.

Should be called once at the beginning of the program. This function replaces SML_EnableImportExpor

ERRVALUE MIE::FORMAT::Export ( const RVC::OBJITEMLIST sources,
const MISTRING dest,
const SETTINGS settings 
) const

Export data in sources list to dest. Allocates JOB_EXPORT array.

bool MIE::FORMAT::FeatureIsOptional ( FEATURE  feature  )  const [inline]

Returns whether feature is optional or not XXX Should it be named IsFeatureOptional or FeatureIsOptional?

static const FORMAT* MIE::FORMAT::FindFormat ( const FILEPATH filepath,
MODE  mode = MODE_Import,
OBJTYPEFLAG  ObjType = OBJTYPEFLAG_ALL 
) [static]

Find the most likely format for a given file.

Will return NULL if the file is not recgonized

static bool MIE::FORMAT::FindFormats ( SIMPLE_ARRAY< const FORMAT * > &  FormatList,
const FILEPATH filepath,
MODE  mode = MODE_Import,
OBJTYPEFLAG  ObjType = OBJTYPEFLAG_ALL 
) [static]

Find the list of possible formats for a given file.

Will return true if the file is recgonized by at least one format. If more than one format supports a file, we can ask the user which one to use.

MISTRING MIE::FORMAT::GetDataSourceName ( const MISTRING DataSource  )  const [inline]

Get a humanly-readable encoding of the selected data source.

const char* MIE::FORMAT::GetDefaultFileExtn (  )  const [inline]

Return the file extension to use for external files.

Extension will not contain the "." If multiple extension are allowed, returns a space-seperated list. Returns NULL if there is no extension.

OBJTYPEFLAG MIE::FORMAT::GetEditObjType (  )  const [inline]

Get flags for supported object types for editing.

void MIE::FORMAT::GetExportDefaultCRS ( SPATREF::COORDREFSYS crs,
const DRECT3D Extents 
) const [inline]

If the format cannot support the CRS under the geometric object, ask the format what default CRS it can use.

Default behavior is to return SPATREF::COORDREFSYS:: IDNUM_Geographic2D_WGS84_Deg

RVC::GETOBJFILTER* MIE::FORMAT::GetExportObjectFilter (  )  const [inline]

Get filter for selecting object to export.

Returns:
Pointer to filter instance, NULL if none set.
OBJTYPEFLAG MIE::FORMAT::GetExportObjTypeFlag (  )  const [inline, protected]
OBJTYPEFLAG MIE::FORMAT::GetExportObjTypes (  )  const

Get all objtypes that this format can export to.

const MISTRING* MIE::FORMAT::GetFixedSource (  )  const [inline]

Return the fixed data source for this format.

Will return NULL for all formats except ODBC data sources which are tied to a specific data source like an Oracle or MySQL server

static const FORMAT* MIE::FORMAT::GetFormat ( FORMATTYPE  FormatType  )  [static]

Get the format based on the unique format ID.

Returns:
The FORMAT* for the format requested or NULL if not loaded
void MIE::FORMAT::GetFormatDesc ( MISTRING str  )  const [inline]

Get the format description (new stuff will look up given TEXTID) Old stuff will use old group/key to lookup resource.

static ERRVALUE MIE::FORMAT::GetFormatList ( SIMPLE_ARRAY< const FORMAT * > &  formats,
MODE  mode,
OBJTYPEFLAG  ObjectType 
) [static]

Get a list of formats.

const char* MIE::FORMAT::GetFormatName (  )  const [inline]

Get format name (short) Used for ini lookup of defaults, SML class names, etc.

FORMATTYPE MIE::FORMAT::GetFormatType (  )  const [inline]

Gets unique numeric constant for this format.

GETFILEFILTER* MIE::FORMAT::GetImportFileFilter (  )  const [inline]

Get filter for selecting file to import.

Returns:
Pointer to filter instance, NULL if none set.
const char* MIE::FORMAT::GetImportFilePrompt (  )  const [inline]

Get the "prompt" for the import file selection dialog.

to import. If this function returns NULL, you should use the TEXTID version. (For use by the UI_BASE)

TEXTID MIE::FORMAT::GetImportFilePromptTEXTID (  )  const [inline]

Get the "prompt" for the import file selection dialog.

For use by the UI_BASE

OBJTYPEFLAG MIE::FORMAT::GetImportObjTypeFlag (  )  const [inline, protected]
OBJTYPEFLAG MIE::FORMAT::GetImportObjTypes (  )  const

Get all objtypes that this format can import to.

OBJTYPEFLAG MIE::FORMAT::GetIntermediateObjType ( OBJTYPEFLAG  PreferredObjType  )  const [inline]

Get intermediate object type to import to.

Determine if we can import directly to a specific object type or, if not, what intermediate type to import to and then convert to the desired type. Will return the preferred type if no intermediate is needed. Will return OBJTYPEFLAG_None if the conversion just can't be done (for example, TIFF can't be imported to vector)

int MIE::FORMAT::GetObjItemList ( const MISTRING source,
RVC::OBJITEMLIST items,
const SETTINGS settings 
) const

Determine the number and types of objects that a given source file or datasource contains.

Returns the number of items in the list

const char* MIE::FORMAT::GetSMLBaseClassName ( RVC::OBJTYPE  objtype  )  const [protected]
SML::CLASS* MIE::FORMAT::GetSMLClass ( RVC::OBJTYPE  ObjType  )  const

Return the SMLCLASS for the specified RVC::OBJTYPE.

If not defined, returns NULL.

SML::CLASSMEMBER* MIE::FORMAT::GetSMLClassMembers ( RVC::OBJTYPE  ObjType  )  const

Return an array of SMLCLASSMEMBERs for the derived class's SETTINGS.

const char* MIE::FORMAT::GetSMLClassName ( RVC::OBJTYPE  ObjType  )  const [inline]

Return the SML Class name for this format.

Returns NULL if default name (from SetupSMLClass) should be used.

const STRUTF8& MIE::FORMAT::GetSource (  )  const [inline]

Get the "source" name to use when creating objects NOTE: This used to return a const FIXEDSTRING<16>&, but we found that most places that used it needed const char* instead.

So it's now a STRUTF8. If you find any code that converts it to an MISTRING and then to STRUTF8, it can be simplified now.

bool MIE::FORMAT::HasFeature ( FEATURE  feature  )  const [inline]

Returns whether the format has a particular feature.

ERRVALUE MIE::FORMAT::Import ( const MISTRING source,
RVC::OBJITEMLIST dest,
const SETTINGS settings 
) const

Import data referenced by source.

Creates JOB array from dest OBJITEMLIST, calls v_Import, and then deletes JOB array.

ERRVALUE MIE::FORMAT::ImportMulti ( const MISTRINGLIST sources,
const SIMPLE_ARRAY< int > &  NumObjectsInFile,
const RVC::OBJITEMLIST objitems,
const SETTINGS settings,
MISTRING ErrorLog 
) const [inline]

Import data referenced by sources.

NumObjectsInFile has already been determined by v_GetObjItemList if importing to multiple output objects. Otherwise, it can be ignored.

Parameters:
ErrorLog Will contain string of all errors encountered (if any) during import.
static void MIE::FORMAT::InstallSMLClasses ( SML::CALLBACKSTRUCT cbs,
void *   
) [static, private]
ERRVALUE MIE::FORMAT::SelectDataSources ( MISTRINGLIST sources,
const RVC::OBJITEMLIST objitems = 0 
) const [inline]

Used by ODBC formats which require their own selection procedure Only called if the format has the FEATURE_SelectODBCSource feature set.

The objitem parameter is NULL for import selection. For export, it will point to an the item being exported. This can be used to pull default names or whatever.

void MIE::FORMAT::SetExportObjectFilter ( RVC::GETOBJFILTER pExportObjectFilter  )  [inline]

Set filter for export object selection.

void MIE::FORMAT::SetExportObjTypes ( OBJTYPEFLAG  objtypes  )  [inline, protected]
void MIE::FORMAT::SetFormatName ( const char *  name  )  [inline, protected]
void MIE::FORMAT::SetImportFileFilter ( GETFILEFILTER pImportFileFilter  )  [inline]

Set filter for import file selection.

void MIE::FORMAT::SetImportObjTypes ( OBJTYPEFLAG  objtypes  )  [inline, protected]
void MIE::FORMAT::SetSource ( const char *  source  )  [inline, protected]
SML::CLASS* MIE::FORMAT::SetupSMLClass ( RVC::OBJTYPE  ObjType  )  [private]

The SML Class name is "Mie" followed by the return value of GetFormatName().

If the format supports more than one element type, it also appends "VECTOR", "RASTER", "CAD", etc.

void MIE::FORMAT::SetupSMLClasses (  )  [private]
static int MIE::FORMAT::SortFormatList ( SORTMETHOD  sort = SORT_ByName,
bool  forward = true 
) [static]

Sort the format list.

bool MIE::FORMAT::SupportsEncoding ( CHAR_ENCODING  encoding  )  const [inline]

Supports encodings.

TESTRESULT MIE::FORMAT::TestFile ( const FILEPATH filepath,
bool  TestByExtn = true 
) const

Test a file to see if this format can import it Note: In testing a file, any filter which first assumes that the file is the correct format and tries to read it one line at a time parsing out its header is EVIL! You WILL be passed files that are not your format -- that's the whole purpose for the test.

Trying to parse a 100 Meg raster as if it were a text file is SLOW!

TESTRESULT MIE::FORMAT::TestObject ( const RVC::OBJITEM objitem  )  const

Test an object to see if this format can export it Will first check if type is allowed, then if has ExportObjectFilter will use the filter, finally will call v_TestObject.

virtual JOB_EXPORT* MIE::FORMAT::v_AllocJobExport ( const SETTINGS settings  )  const [private, virtual]

Allocate a JOB_EXPORT for this format.

Will be temporary during the actual export. Default implementation uses format's m_ObjType to determine which JOB_EXPORT class to allocate. This may not be appropriate for geometric formats.

Reimplemented in MIE::FORMAT_GDAL, and MIE::FORMAT_RDBMS_SPATIAL.

virtual JOB_IMPORT* MIE::FORMAT::v_AllocJobImport ( OBJTYPEFLAG  ObjectType,
const SETTINGS settings 
) const [private, virtual]

Allocate a JOB_EXPORT for this format.

Will be temporary during the actual import Note, the ObjectType parameter is not redundant. In the case of importing a CAD format and then converting to vector, ObjectType will be CAD and settings.ObjTypeSelected will be Vector

Reimplemented in MIE::FORMAT_DBLINKABLE, MIE::FORMAT_GDAL, and MIE::FORMAT_LINKABLE.

virtual SETTINGS* MIE::FORMAT::v_AllocSettings ( MODE  mode,
OBJTYPEFLAG  ObjType = OBJTYPEFLAG_ALL 
) const [private, virtual]

Allocate a JOB_IMPORT for this format Default implementation just allocates an MIE::SETTINGS, The optional ObjType parameter allows you to limit the settings to a particular object type.

This is required to keep the SML implementation compatible with previous code.

Reimplemented in MIE::FORMAT_DBLINKABLE, and MIE::FORMAT_GDAL.

virtual UI_BASE* MIE::FORMAT::v_AllocUserInterface ( SETTINGS settings  )  const [private, virtual]

Allocate a User Interface.

Default implementation allocates a UI_BASE. Only override if you have your own UI_BASE-derived class

virtual DEPRECATED ERRVALUE MIE::FORMAT::v_AnalyzeFile ( const FILEPATH source,
SETTINGS settings 
) const [private, virtual]

Analyze a file and determine "default" import settings.

Deprecated - use v_AnalyzeSource instead of this.

Reimplemented in MIE::FORMAT_GDAL.

virtual ERRVALUE MIE::FORMAT::v_AnalyzeObjects ( const RVC::OBJITEMLIST objects,
SETTINGS settings 
) const [private, virtual]

Analyze a set of objects and determine initial export settings.

Default implementation does nothing.

virtual ERRVALUE MIE::FORMAT::v_AnalyzeSource ( const MISTRING source,
SETTINGS settings 
) const [protected, virtual]

Analyze a file and determine initial import settings.

Reimplemented in MIE::FORMAT_LINKABLE, and MIE::FORMAT_RDBMS_SPATIAL.

virtual ERRVALUE MIE::FORMAT::v_AnalyzeSources ( const MISTRINGLIST sourcelist,
SETTINGS settings 
) const [protected, virtual]

Default implementation just calls v_AnalyzeSource for the first source in the list.

Reimplemented in MIE::FORMAT_LINKMULTI.

virtual bool MIE::FORMAT::v_CanExport ( RVC::OBJTYPE  objtype  )  const [private, virtual]

Return true if a given object type can be exported to this format.

Default implementation checks objtype against the FORMAT's OBJTYPEFLAG and mode, which were both set by constructor.

Reimplemented in MIE::FORMAT_DBLINKABLE, and MIE::FORMAT_GDAL.

virtual bool MIE::FORMAT::v_CanExportSupportCRS ( const SPATREF::COORDREFSYS crs  )  const [private, virtual]

Given a CRS, determine if the export format can support it.

Default returns 'false'. If 'false' is returned, v_GetDefaultCRS() is called

Reimplemented in MIE::FORMAT_RDBMS_SPATIAL.

virtual bool MIE::FORMAT::v_CanExportToSingleFile ( const RVC::OBJITEMLIST objects  )  const [private, virtual]

Test multiple objects to see if they can be exported as a unit to a single file.

This is used to determine if the "Export to single file" toggle is enabled. Override this if a format supports multiple objects but has restrictions such as maximum # of objects, must be same size, etc. The default implementation returns true if the format has the FEATURE_NeedMultiSingle feature set.

Reimplemented in MIE::FORMAT_GDAL.

virtual bool MIE::FORMAT::v_CanImport ( RVC::OBJTYPE  objtype  )  const [private, virtual]

Return true if this format can import to a given object type.

Default implementation checks objtype against the FORMAT's OBJTYPEFLAG and mode, which were both set by constructor.

Reimplemented in MIE::FORMAT_DBLINKABLE, and MIE::FORMAT_GDAL.

virtual ERRVALUE MIE::FORMAT::v_Export ( const MISTRING dest,
const SETTINGS settings,
const SIMPLE_ARRAY< JOB_EXPORT * > &  jobs 
) const [private, virtual]

Virtual method to do the actual export.

Called once for each object selected for export if settings.GetSingleFile() is false (in which case the sources list contains a single item). Otherwise this method is called only once, and the sources list contains all the objects selected for export.

If you are exporting a raster, you should use MIE::JOB_EXPORT::SetRastObj() and MIE::JOB_EXPORT::ReadRaster() instead of the RVC::RASTER methods. This will convert the null mask of the raster (if any) to the null value specified by the user. Handles cell value conflicts.

Parameters:
jobs each JOB contains a source OBJITEM to be exported

Reimplemented in MIE::FORMAT_DBLINKABLE, MIE::FORMAT_GDAL, and MIE::FORMAT_RDBMS_SPATIAL.

virtual MISTRING MIE::FORMAT::v_GetDataSourceName ( const MISTRING DataSource  )  const [private, virtual]

Get a humanly-readable encoding of the selected data source.

Default implementation just returns the data source name.

virtual const char* MIE::FORMAT::v_GetDefaultFileExtn (  )  const [private, virtual]

Return the default extension for files of this format Extension should not contain the "." If multiple extension are allowed, returns a space-seperated list Returns NULL if there is no extension Default implementation returns NULL.

Reimplemented in MIE::FORMAT_DBLINKABLE.

virtual OBJTYPEFLAG MIE::FORMAT::v_GetEditObjType (  )  const [private, virtual]

Flags for supported object types for editing.

virtual void MIE::FORMAT::v_GetExportDefaultCRS ( SPATREF::COORDREFSYS crs,
const DRECT3D Extents 
) const [private, virtual]

If the format cannot support the CRS under the geometric object, ask the format what default CRS it can use.

Default behavior is to return SPATREF::COORDREFSYS:: IDNUM_Geographic2D_WGS84_Deg

Parameters:
Extents Extents of the object to export
virtual const MISTRING* MIE::FORMAT::v_GetFixedSource (  )  const [private, virtual]

Implemented by ODBC formats which are tied to a specific data source.

virtual void MIE::FORMAT::v_GetFormatDesc ( MISTRING desc  )  const [private, pure virtual]

Get the format description (new stuff will look up given TEXTID) Old stuff will use old group/key to lookup resource.

Implemented in MIE::FORMAT_DBLINKABLE.

virtual const char* MIE::FORMAT::v_GetImportFilePrompt (  )  const [private, virtual]

Get the "prompt" for the import file selection dialog.

to import. Default implementation returns NULL, causing the caller to use the TEXTID version below. This method should only be implemented by the wrappers around legacy formats.

virtual TEXTID MIE::FORMAT::v_GetImportFilePromptTEXTID (  )  const [private, virtual]

Get the "prompt" for the import file selection dialog.

If you implement this method, you do NOT need to implement the non-TEXTID version above.

OBJTYPEFLAG MIE::FORMAT::v_GetIntermediateObjType ( OBJTYPEFLAG  PreferredObjType  )  const [private]

Get intermediate object type to import to.

Determine if we can import directly to a specific object type or, if not, what intermediate type to import to and then convert to the desired type. There is a default implementation which should be accurate 99% of the time. It's can be overridden to handle any exceptions to the norm.

virtual int MIE::FORMAT::v_GetObjItemList ( const MISTRING source,
RVC::OBJITEMLIST items,
const SETTINGS settings 
) const [private, virtual]

Determine the number and types of objects that a given source file or datasource contains.

Should return the number of items. If you want MIE to supply default object names, just return the number of objects without filling in the items (or you can push blank OBJITEMs to the list) Default implementation returns one default OBJITEM.

Reimplemented in MIE::FORMAT_DBLINKABLE, and MIE::FORMAT_GDAL.

virtual SMLCLASSMEMBER* MIE::FORMAT::v_GetSMLClassMembers ( RVC::OBJTYPE  ObjType  )  const [private, virtual]

Return an array of SMLCLASSMEMBERs for your derived class's SETTINGS.

You should implement this if you are rewriting a module that has SML class members. Your SML members should have the same names as they did in the legacy module so that existing scripts don't break. Otherwise, if you have no need for format-specific SETTINGS, you don't need to implement this.

Recomended practice is to have this call a static method on your derived SETTINGS class which sets up the SML classes (see miemrsid.c for an example of this). You can either write your own SML write and read functions (as in mielegacy.c), or just use SML::CLASSWriteSimple and SML::CLASSReadSimple if you need to modify "simple" settings members.

SML::CLASSMEMBERs that you return will not be freed, so define your SML classes statically in your module. The SETTINGS members that they reference can be modified by SML even if they are const.

Reimplemented in MIE::FORMAT_DBLINKABLE.

virtual const char* MIE::FORMAT::v_GetSMLClassName ( RVC::OBJTYPE  ObjType  )  const [private, virtual]

Return the SML Class name for this format.

Default implementation returns NULL. Override only if you want your SML class name to be something other than that created by SetupSMLClass.

Reimplemented in MIE::FORMAT_DBLINKABLE.

virtual ERRVALUE MIE::FORMAT::v_Import ( const MISTRING source,
const SETTINGS settings,
const SIMPLE_ARRAY< JOB_IMPORT * > &  jobs 
) const [private, virtual]

Virtual method to do the actual import.

Called once for each input file. The jobs array contains a job for each output object.

Your derived class should NOT do any of the "standard" operations such as optimizing a vector, creating standard attribute tables, setting raster compression, etc. The main interface will do that for you.

Note: in order to create your destination object, use the Make method from the appropriate JOB_IMPORT-derived class if one is available (JOB_RASTER::MakeRaster instead of RVC::RASTER::Make, for example).

If the JOB class you are using does not have its own Make method, or if you want to make the object yourself, you can retrieve the destination RVC::OBJITEM via JOB::GetObjItem(). Note that you must update each job's objitem after creating your output objects (possibly using RVC::OBJECT::GetObjectItem()). In the case of creating rasters, you must also either disable compression options (FEATURE_NeedRasterCompressOptions), or import to a temp file (FEATURE_TempFileIfCompressing).

Parameters:
source Either a filename (from FILEPATH::GetMioPath()) or an ODBC connection string.
settings The import settings. If you implement v_AllocSettings, and have it return a class derived from MIE::SETTINGS, you can safely static_cast the settings to your own derived class.
jobs An array of MIE::JOB_IMPORT-derived classes, one for each OBJITEM in dest. If you implement v_AllocJobImport, and have it return a derived class, you can sefely static_cast the job to your own derived class. The jobs are allocated for you and will be freed when the import is done. Note, if the user "skipped" any of the output objects for this file, the "job" pointer for that object will be NULL

Reimplemented in MIE::FORMAT_DBLINKABLE, MIE::FORMAT_GDAL, and MIE::FORMAT_LINKABLE.

virtual ERRVALUE MIE::FORMAT::v_ImportMulti ( const MISTRINGLIST sources,
const SIMPLE_ARRAY< int > &  NumObjectsInFile,
const RVC::OBJITEMLIST objitems,
const SETTINGS settings,
MISTRING ErrorLog 
) const [protected, virtual]

Do the import.

Default implementation sets up JOBs array and calls Import for each source using NumObjectsInFile to determine size of JOBs array.

Parameters:
ErrorLog Will contain string of all errors encountered (if any) during import.
virtual ERRVALUE MIE::FORMAT::v_SelectDataSource ( MISTRING DataSource,
const RVC::OBJITEM objitem = 0 
) const [private, virtual]

Used by Database formats which require their own selection procedure Only called if the format has the FEATURE_SelectRDBMSSource feature set.

The objitem parameter is NULL for import selection. For export, it will point to an the item being exported. This can be used to pull default names or whatever.

virtual ERRVALUE MIE::FORMAT::v_SelectDataSources ( MISTRINGLIST DataSources,
const RVC::OBJITEMLIST objitems = 0 
) const [private, virtual]
virtual bool MIE::FORMAT::v_SupportsEncoding ( CHAR_ENCODING  encoding  )  const [private, virtual]
virtual TESTRESULT MIE::FORMAT::v_TestFile ( const FILEPATH filepath  )  const [private, virtual]

Test a file to see if this format can import it Default implementation returns TESTRESULT_CannotTest.

Reimplemented in MIE::FORMAT_GDAL, and MIE::FORMAT_LINKABLE.

virtual TESTRESULT MIE::FORMAT::v_TestObject ( const RVC::OBJITEM objitem  )  const [private, virtual]

Test an object to see if this format can export it Default implementation returns TESTRESULT_Yes.


Member Data Documentation

Set of features this format supports.

Set of features that are optional.


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

Generated on Sun Oct 7 21:36:24 2012 for TNTsdk 2012 by  doxygen 1.6.1