00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACEXML_ENTITY_MANAGER_H
00015 #define ACEXML_ENTITY_MANAGER_H
00016
00017 #include "ace/pre.h"
00018 #include "ACEXML/parser/parser/Parser_export.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #include "ACEXML/common/XML_Types.h"
00025 #include "ace/Hash_Map_Manager.h"
00026 #include "ace/Null_Mutex.h"
00027
00028 typedef ACE_Hash_Map_Entry<ACEXML_String,
00029 ACEXML_String> ACEXML_ENTITY_ENTRY;
00030
00031 typedef ACE_Hash_Map_Manager_Ex<ACEXML_String,
00032 ACEXML_String,
00033 ACE_Hash<ACEXML_String>,
00034 ACE_Equal_To<ACEXML_String>,
00035 ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER;
00036
00037 typedef ACE_Hash_Map_Iterator_Ex<ACEXML_String,
00038 ACEXML_String,
00039 ACE_Hash<ACEXML_String>,
00040 ACE_Equal_To<ACEXML_String>,
00041 ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER_ITER;
00042
00043 typedef ACE_Hash_Map_Reverse_Iterator_Ex<ACEXML_String,
00044 ACEXML_String,
00045 ACE_Hash<ACEXML_String>,
00046 ACE_Equal_To<ACEXML_String>,
00047 ACE_Null_Mutex> ACEXML_ENTITIES_MANAGER_REVERSE_ITER;
00048
00049 typedef ACE_Hash_Map_Bucket_Iterator<ACEXML_String,
00050 ACEXML_String,
00051 ACE_Hash<ACEXML_String>,
00052 ACE_Equal_To<ACEXML_String>,
00053 ACE_Null_Mutex> ACEXML_ENTITY_ENTRY_ITERATOR;
00054
00055
00056
00057
00058
00059
00060
00061
00062 class ACEXML_PARSER_Export ACEXML_Entity_Manager
00063 {
00064 public:
00065
00066 ACEXML_Entity_Manager (void);
00067
00068
00069 ~ACEXML_Entity_Manager (void);
00070
00071
00072 int add_entity (const ACEXML_Char *ref, const ACEXML_Char *value);
00073
00074
00075 const ACEXML_Char* resolve_entity (const ACEXML_Char *ref);
00076
00077
00078
00079 int resolve_entity (const ACEXML_Char* ref, ACEXML_Char*& systemId,
00080 ACEXML_Char*& publicId);
00081
00082
00083 size_t size(void) const;
00084
00085
00086 int reset (void);
00087
00088 private:
00089 ACEXML_ENTITIES_MANAGER* entities_;
00090 bool init_;
00091
00092 };
00093
00094 #if defined (__ACEXML_INLINE__)
00095 # include "ACEXML/parser/parser/Entity_Manager.i"
00096 #endif
00097
00098 #include "ace/post.h"
00099
00100 #endif