#include <HIOManager.h>

Public Member Functions

void CleanCallbacks ()
 
virtual HIOConnectorCreateConnector (const char *file_type)
 
virtual void FreeConnector (HIOConnector *old_connector)
 
virtual HInputHandlerGetInputHandler (const char *file_type)
 
HInputHandlerGetInputHandler (const __wchar_t *file_type)
 
virtual const char * GetInputHandlerTypes ()
 
virtual HOutputHandlerGetOutputHandler (const char *file_type)
 
virtual HOutputHandlerGetOutputHandler (const __wchar_t *file_type)
 
virtual const char * GetOutputHandlerTypes ()
 
virtual HIOConnectorRegisterConnector (const char *file_type, HIO_CREATE_FREE_FUNCTION Create, HIO_FREE_CONNECTOR_FUNCTION Free)
 
virtual void RegisterHandlers ()
 
virtual HInputHandlerRegisterInputHandler (const char *file_type, HInputHandler *handler)
 
virtual HOutputHandlerRegisterOutputHandler (const char *file_type, HOutputHandler *handler)
 

Static Public Member Functions

static HIOManagerGetCurrentHIOManager ()
 
static void GetFileOutputResultString (HFileOutputResult result, char *result_str)
 

Protected Attributes

struct vhash_s * connector_procs
 A hash of HIOConnector Create/Free functions.
 
struct vhash_s * created_connectors
 A list of created HIOConnectors.
 
struct vhash_s * input_handlers
 A hash of HInputHandlers.
 
struct vlist_s * loaded_input_handlers
 A list of dynamically loaded HInputHandlers libraries.
 
struct vlist_s * loaded_output_handlers
 A list of dynamically loaded HOutputHandlers libraries.
 
char * m_input_types
 
int m_input_types_allocated
 
char * m_output_types
 
int m_output_types_allocated
 
struct vhash_s * output_handlers
 A hash of HOutputHandlers.
 
struct vlist_s * owned_input_handlers
 A list of default HInputHandlers created by the manager.
 
struct vlist_s * owned_output_handlers
 A list of default HOutputHandlers created by the manager.
 

Detailed Description

HIOManger manages subclassed instances of HInputHandler and HOutputHandler. It maps handlers to operations based on registered associations and/or requested file extensions. It is created on demand by HDB.

Member Function Documentation

◆ CleanCallbacks()

void HIOManager::CleanCallbacks ( )

This method requests that any callbacks registered on handlers be cleaned (when the manager would othewise be deleted)

◆ CreateConnector()

virtual HIOConnector* HIOManager::CreateConnector ( const char *  file_type)
virtual

This method creates a new connector for the given type and returns a pointer to it.

Parameters
file_typeThe extension to lookup handler for example: "jpg".
Returns
An HIOConnector registered for specified file type or 0 if none.

◆ FreeConnector()

virtual void HIOManager::FreeConnector ( HIOConnector old_connector)
virtual

This method frees a connector for the file type associated with it.

Parameters
old_connectorA pointer to the HIOConnector object you wan to free from a given type.

◆ GetCurrentHIOManager()

static HIOManager* HIOManager::GetCurrentHIOManager ( )
static

This method gets the current HIOManager. It will create on if none exists.

Returns
The current manager from HDB.

◆ GetFileOutputResultString()

static void HIOManager::GetFileOutputResultString ( HFileOutputResult  result,
char *  result_str 
)
static

This method gets a string representation of the HFileOutputResults.

Parameters
resultThe HFileOutputResult that you want to get a string representation of.
result_strReturns the string representation of the result.

◆ GetInputHandler()

virtual HInputHandler* HIOManager::GetInputHandler ( const char *  file_type)
virtual
Parameters
file_typeThe extension to lookup handler for example: "jpg". See information on special cases below.
Returns
The HInputHandler registered for specified file type or 0 if none is registered.

Special Cases

Because DWG files can be imported via both HIO_DWG and HIO_Exchange, two special cases exist for the file_type parameter to tell Visualize which module to use for the import:

File Type String Import Module
"dwg" HIO_DWG
"dxf" HIO_DWG
"dwg_with_prc" HIO_Exchange
"dxf_with_prc" HIO_Exchange

◆ GetInputHandlerTypes()

virtual const char* HIOManager::GetInputHandlerTypes ( )
virtual
Returns
The list of all extensions registered with input handlers. You can part this string to create a file type list for input file dialogs. The string's format looks like "jpg;gif;tiff".

◆ GetOutputHandler()

virtual HOutputHandler* HIOManager::GetOutputHandler ( const char *  file_type)
virtual
Parameters
file_typeThe extension to lookup handler for example: "jpg"
Returns
The HOutputHandler registered for specified file type or 0 if none is registered.

Referenced by HIOUtilityPDF::Has3dSupport().

◆ GetOutputHandlerTypes()

virtual const char* HIOManager::GetOutputHandlerTypes ( )
virtual
Returns
The list of all extensions registered with output handlers. You can parse this string to create a file type list for output file dialogs. The string's format looks like "jpg;gif;tiff".

◆ RegisterConnector()

virtual HIOConnector* HIOManager::RegisterConnector ( const char *  file_type,
HIO_CREATE_FREE_FUNCTION  Create,
HIO_FREE_CONNECTOR_FUNCTION  Free 
)
virtual

This method associates a specified file type with an HIOConnector. If another another connector already exists for the file type, this method replaces it with the given connector.

Parameters
file_typeThe file extension this connector is for.
CreateA pointer to the desired Create method.
FreeA pointer to the desired Free method
Returns
A pointer to old connector for the file extension.

◆ RegisterHandlers()

virtual void HIOManager::RegisterHandlers ( )
virtual

This method registers default file handlers. This called by HDB when it creates a HIOManager. To avoid the default handlers being set, pass your own HIOManager by calling HDB::SetHIOManager().

◆ RegisterInputHandler()

virtual HInputHandler* HIOManager::RegisterInputHandler ( const char *  file_type,
HInputHandler handler 
)
virtual

This method associates a specified file type with an input handler. If another input handler already exists for the file type, this method replaces it with the given handler.

Parameters
file_typeThe file extension this to associate with the given handler.
handlerThe handler for specified extension file_type. This may be 0 to clear extension handler.
Returns
A pointer to old handler for the file extension.

◆ RegisterOutputHandler()

virtual HOutputHandler* HIOManager::RegisterOutputHandler ( const char *  file_type,
HOutputHandler handler 
)
virtual

This method associates a specified file type with an output handler. If another output handler already exists for the file type, this method replaces it with the given handler.

Parameters
file_typeThe file extension this to associate with the given handler.
handlerThe handler for specified extension file_type. This may be 0 to clear extension handler.
Returns
A pointer to old handler for the file extension.

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