OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 virtual ~NamedAttrMap(); | 46 virtual ~NamedAttrMap(); |
47 | 47 |
48 void setAttributes(const NamedAttrMap&); | 48 void setAttributes(const NamedAttrMap&); |
49 | 49 |
50 size_t length() const { return m_attributes.size(); } | 50 size_t length() const { return m_attributes.size(); } |
51 Attribute* attributeItem(unsigned index) const { return m_attributes[index].
get(); } | 51 Attribute* attributeItem(unsigned index) const { return m_attributes[index].
get(); } |
52 Attribute* getAttributeItem(const QualifiedName&) const; | 52 Attribute* getAttributeItem(const QualifiedName&) const; |
53 | 53 |
54 void shrinkToLength() { m_attributes.shrinkCapacity(length()); } | 54 void shrinkToLength() { m_attributes.shrinkCapacity(length()); } |
55 void reserveCapacity(unsigned capacity) { m_attributes.reserveCapacity(capac
ity); } | 55 void reserveInitialCapacity(unsigned capacity) { m_attributes.reserveInitial
Capacity(capacity); } |
56 | 56 |
57 // used during parsing: only inserts if not already there | 57 // used during parsing: only inserts if not already there |
58 // no error checking! | 58 // no error checking! |
59 void insertAttribute(PassRefPtr<Attribute> newAttribute, bool allowDuplicate
s) | 59 void insertAttribute(PassRefPtr<Attribute> newAttribute, bool allowDuplicate
s) |
60 { | 60 { |
61 ASSERT(!m_element); | 61 ASSERT(!m_element); |
62 if (allowDuplicates || !getAttributeItem(newAttribute->name())) | 62 if (allowDuplicates || !getAttributeItem(newAttribute->name())) |
63 addAttribute(newAttribute); | 63 addAttribute(newAttribute); |
64 } | 64 } |
65 | 65 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 Element* m_element; | 100 Element* m_element; |
101 Vector<RefPtr<Attribute> > m_attributes; | 101 Vector<RefPtr<Attribute> > m_attributes; |
102 AtomicString m_id; | 102 AtomicString m_id; |
103 }; | 103 }; |
104 | 104 |
105 } //namespace | 105 } //namespace |
106 | 106 |
107 #undef id | 107 #undef id |
108 | 108 |
109 #endif | 109 #endif |
OLD | NEW |