#include <ACEXML/parser/parser/Entity_Manager.h>
Collaboration diagram for ACEXML_Entity_Manager:

Public Member Functions | |
| ACEXML_Entity_Manager (void) | |
| Default constructor. | |
| ~ACEXML_Entity_Manager (void) | |
| Destructor. | |
| int | add_entity (const ACEXML_Char *ref, const ACEXML_Char *value) |
| Add a new entity declaration. | |
| const ACEXML_Char * | resolve_entity (const ACEXML_Char *ref) |
| Resolve an entity reference. | |
| int | resolve_entity (const ACEXML_Char *ref, ACEXML_Char *&systemId, ACEXML_Char *&publicId) |
| size_t | size (void) const |
| Number of items in the Entity Manager. | |
| int | reset (void) |
| Reset the state. | |
Private Attributes | |
| ACEXML_ENTITIES_MANAGER * | entities_ |
| bool | init_ |
Definition at line 62 of file Entity_Manager.h.
|
|
Default constructor.
Definition at line 10 of file Entity_Manager.cpp.
00011 : entities_ (0) 00012 { 00013 00014 } |
|
|
Destructor.
Definition at line 16 of file Entity_Manager.cpp. References reset().
00017 {
00018 this->reset();
00019 }
|
|
||||||||||||
|
Add a new entity declaration.
Definition at line 4 of file Entity_Manager.i. References ACE_NEW_RETURN, ACEXML_Char, ACEXML_ENTITIES_MANAGER, ACEXML_String, ACE_Hash_Map_Manager_Ex< ACEXML_String, ACEXML_String, ACE_Hash< ACEXML_String >, ACE_Equal_To< ACEXML_String >, ACE_Null_Mutex >::bind(), entities_, and v. Referenced by ACEXML_Parser::initialize().
00006 {
00007 if (!this->entities_ )
00008 ACE_NEW_RETURN (this->entities_, ACEXML_ENTITIES_MANAGER, -1);
00009 ACEXML_String name (ref, 0, 0);
00010 ACEXML_String value (v, 0, 0);
00011 return this->entities_->bind (name, value);
00012 }
|
|
|
Reset the state.
Definition at line 52 of file Entity_Manager.i. References entities_. Referenced by ~ACEXML_Entity_Manager().
|
|
||||||||||||||||
|
Resolve an entity reference and return the tuple of Definition at line 29 of file Entity_Manager.i. References ACEXML_Char, ACEXML_ENTITY_ENTRY_ITERATOR, and entities_.
00032 {
00033 if (!this->entities_)
00034 return 0;
00035
00036 publicId = systemId = 0;
00037 ACEXML_ENTITY_ENTRY_ITERATOR iter (*this->entities_, ref);
00038 ACEXML_ENTITY_ENTRY_ITERATOR end (*this->entities_, ref, 1);
00039
00040 if (iter != end)
00041 {
00042 systemId = const_cast<ACEXML_Char*> ((*iter).int_id_.c_str());
00043 ++iter;
00044 if (iter != end)
00045 publicId = const_cast<ACEXML_Char*> ((*iter).int_id_.c_str());
00046 return 0;
00047 }
00048 return -1;
00049 }
|
|
|
Resolve an entity reference.
Definition at line 15 of file Entity_Manager.i. References ACEXML_Char, ACEXML_ENTITY_ENTRY, ACEXML_String, entities_, ACE_Hash_Map_Manager_Ex< ACEXML_String, ACEXML_String, ACE_Hash< ACEXML_String >, ACE_Equal_To< ACEXML_String >, ACE_Null_Mutex >::find(), and ACE_Hash_Map_Entry< ACEXML_String, ACEXML_String >::int_id_.
00016 {
00017 if (!this->entities_)
00018 return 0;
00019
00020 ACEXML_ENTITY_ENTRY *entry = 0;
00021
00022 if (this->entities_->find (ACEXML_String (ref, 0, 0),
00023 entry) == 0)
00024 return entry->int_id_.c_str();
00025 return 0;
00026 }
|
|
|
Number of items in the Entity Manager.
Definition at line 61 of file Entity_Manager.i. References ACE_Hash_Map_Manager_Ex< ACEXML_String, ACEXML_String, ACE_Hash< ACEXML_String >, ACE_Equal_To< ACEXML_String >, ACE_Null_Mutex >::current_size(), and entities_.
00062 {
00063 if (!this->entities_)
00064 return 0;
00065 return this->entities_->current_size();
00066 }
|
|
|
Definition at line 89 of file Entity_Manager.h. Referenced by add_entity(), reset(), resolve_entity(), and size(). |
|
|
Definition at line 90 of file Entity_Manager.h. |
1.3.6