bioformats  5.1.0
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Friends | List of all members
ome::common::xml::EntityResolver Class Reference

Xerces entity resolver. More...

#include <ome/common/xml/EntityResolver.h>

+ Inheritance diagram for ome::common::xml::EntityResolver:
+ Collaboration diagram for ome::common::xml::EntityResolver:

Classes

class  AutoRegisterCatalog
 Automatically register and unregister an XML catalog with the entity resolver. More...
 
class  AutoRegisterEntity
 Automatically register and unregister an entity with the entity resolver. More...
 
class  RegisterCatalog
 Register an XML catalog with the entity resolver. More...
 
class  RegisterEntity
 Register an entity with the entity resolver. More...
 

Public Member Functions

 EntityResolver ()
 Constructor.
 
 ~EntityResolver ()
 Destructor.
 
xercesc::InputSource * resolveEntity (xercesc::XMLResourceIdentifier *resource)
 Resolve an entity. More...
 

Private Types

typedef std::pair< boost::filesystem::path, std::string > entity_cache
 Cached entity (path and content).
 
typedef std::map< std::string, entity_cacheentity_map_type
 Entity mapping type.
 

Private Member Functions

xercesc::InputSource * getSource (const std::string &resource)
 Get input source from file. More...
 

Static Private Member Functions

static entity_map_typeentities ()
 Get entity mappings. More...
 

Friends

class RegisterEntity
 
class RegisterCatalog
 

Detailed Description

Xerces entity resolver.

This resolver allows replacement of URLs with local files or in-memory copies of XML schemas. This permits efficient validation without network access for commonly-used schemas.

Member Function Documentation

EntityResolver::entity_map_type & ome::common::xml::EntityResolver::entities ( )
staticprivate

Get entity mappings.

Returns
a reference to the current entity map.

Referenced by ome::common::xml::EntityResolver::AutoRegisterEntity::AutoRegisterEntity(), getSource(), and ome::common::xml::EntityResolver::AutoRegisterEntity::~AutoRegisterEntity().

+ Here is the caller graph for this function:

xercesc::InputSource * ome::common::xml::EntityResolver::getSource ( const std::string &  resource)
private

Get input source from file.

Open and read the contents of the file, then return this as an InputSource. Use cached content if possible.

Parameters
resourcethe resource to resolve.
Returns
the input source for the file, or null on failure.

References entities().

Referenced by resolveEntity().

+ Here is the caller graph for this function:

xercesc::InputSource * ome::common::xml::EntityResolver::resolveEntity ( xercesc::XMLResourceIdentifier *  resource)

Resolve an entity.

Parameters
resourcethe resource to resolve.
Returns
an input source containing the cached content, or null if the resource was not cached.

References getSource().


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