Entity_Manager.i

Go to the documentation of this file.
00001 // Entity_Manager.i,v 1.7 2005/04/18 14:09:57 jwillemsen Exp
00002 
00003 ACEXML_INLINE int
00004 ACEXML_Entity_Manager::add_entity (const ACEXML_Char *ref,
00005                                    const ACEXML_Char *v)
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 }
00013 
00014 ACEXML_INLINE const ACEXML_Char*
00015 ACEXML_Entity_Manager::resolve_entity (const ACEXML_Char *ref)
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 }
00027 
00028 ACEXML_INLINE int
00029 ACEXML_Entity_Manager::resolve_entity (const ACEXML_Char* ref,
00030                                        ACEXML_Char*& systemId,
00031                                        ACEXML_Char*& publicId)
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 }
00050 
00051 ACEXML_INLINE int
00052 ACEXML_Entity_Manager::reset (void)
00053 {
00054   delete this->entities_;
00055   this->entities_ = 0;
00056   return 0;
00057 }
00058 
00059 
00060 ACEXML_INLINE size_t
00061 ACEXML_Entity_Manager::size (void) const
00062 {
00063   if (!this->entities_)
00064     return 0;
00065   return this->entities_->current_size();
00066 }

Generated on Thu Nov 9 11:45:36 2006 for ACEXML by doxygen 1.3.6