1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
// $Id$
ACEXML_INLINE int
ACEXML_Entity_Manager::add_entity (const ACEXML_Char *ref,
const ACEXML_Char *v)
{
ACEXML_String name (ref, 0, 0);
ACEXML_String value (v, 0, 0);
return this->entities_.bind (name, value);
}
ACEXML_INLINE const ACEXML_Char*
ACEXML_Entity_Manager::resolve_entity (const ACEXML_Char *ref)
{
ACEXML_ENTITY_ENTRY *entry;
if (this->entities_.find (ACEXML_String (ref, 0, 0),
entry) == 0)
return entry->int_id_.c_str();
return 0;
}
ACEXML_INLINE int
ACEXML_Entity_Manager::resolve_entity (const ACEXML_Char* ref,
ACEXML_Char*& systemId,
ACEXML_Char*& publicId)
{
publicId = systemId = 0;
ACEXML_ENTITY_ENTRY_ITERATOR iter (this->entities_, ref);
ACEXML_ENTITY_ENTRY_ITERATOR end (this->entities_, ref, 1);
if (iter != end)
{
systemId = ACE_const_cast (ACEXML_Char*, (*iter).int_id_.c_str());
++iter;
if (iter != end)
publicId = ACE_const_cast (ACEXML_Char*, (*iter).int_id_.c_str());
return 0;
}
return -1;
}
ACEXML_INLINE int
ACEXML_Entity_Manager::reset (void)
{
if (this->entities_.close() < 0 || this->entities_.open() < 0)
return -1;
return 0;
}
ACEXML_INLINE const size_t
ACEXML_Entity_Manager::size (void) const
{
return this->entities_.current_size();
}
|