Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Attribute.h
1 /*
2  * $Id$
3  * xom::Attribute class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2009, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef ELM_XOM_ATTRIBUTE_H_
23 #define ELM_XOM_ATTRIBUTE_H_
24 
25 #include <elm/xom/Node.h>
26 
27 namespace elm { namespace xom {
28 
29 // Attribute class
30 class Attribute: public Node {
31  friend class NodeFactory;
32 
33 public:
34  Attribute(Attribute *attribute);
35  Attribute(String localName, String value);
36  //Attribute(String localName, String value, Attribute.Type type)
37  Attribute(String name, String URI, String value);
38  //Attribute(String name, String URI, String value, Attribute.Type type)
39 
40  String getLocalName(void) const;
41  String getNamespacePrefix(void) const;
42  String getNamespaceURI(void) const;
43  String getQualifiedName(void) const;
44  //Attribute.Type getType()
45 
46  void setLocalName(String localName);
47  void setNamespace(String prefix, String URI);
48  //void setType(Attribute.Type type);
49  void setValue(String value);
50 
51  // Node overload
52  virtual Node *copy(void);
53  virtual String getValue(void);
54  virtual String toXML(void);
55  virtual String getBaseURI (void);
56  virtual Node *getChild (int index);
57  virtual int getChildCount (void);
58 
59 
60 private:
61  friend class Element;
62  friend class Node;
63  Attribute(void *node);
64  mutable String ns, name;
65  elm::string val;
66 };
67 
68 } } // elm::xom
69 
70 #endif /* ELM_XOM_ATTRIBUTE_H_ */
71 
elm::xom::Node::node
void * node
Definition: Node.h:60
elm::xom::Attribute::getChildCount
virtual int getChildCount(void)
Definition: xom_Attribute.cpp:195
elm::xom::NodeFactory
Definition: NodeFactory.h:27
elm::xom::String
Definition: String.h:35
elm::xom::Attribute::setNamespace
void setNamespace(String prefix, String URI)
Definition: xom_Attribute.cpp:129
elm::xom::Attribute::getChild
virtual Node * getChild(int index)
Definition: xom_Attribute.cpp:187
elm::xom::Attribute::copy
virtual Node * copy(void)
Definition: xom_Attribute.cpp:145
value
elm::xom::Attribute::getBaseURI
virtual String getBaseURI(void)
Definition: xom_Attribute.cpp:179
elm::xom::Attribute::getQualifiedName
String getQualifiedName(void) const
Definition: xom_Attribute.cpp:112
elm
Definition: adapter.h:26
elm::xom::Attribute::getNamespacePrefix
String getNamespacePrefix(void) const
Definition: xom_Attribute.cpp:93
elm::xom::Attribute::getValue
virtual String getValue(void)
Definition: xom_Attribute.cpp:153
elm::xom::Attribute::toXML
virtual String toXML(void)
Definition: xom_Attribute.cpp:163
elm::xom::Attribute::setLocalName
void setLocalName(String localName)
Definition: xom_Attribute.cpp:121
elm::xom::Attribute::getNamespaceURI
String getNamespaceURI(void) const
Definition: xom_Attribute.cpp:102
elm::String
Definition: String.h:30
elm::xom::Element
Definition: Element.h:21
elm::xom::Attribute::setValue
void setValue(String value)
Definition: xom_Attribute.cpp:137
elm::xom::Attribute::getLocalName
String getLocalName(void) const
Definition: xom_Attribute.cpp:83
elm::xom::Attribute
Definition: Attribute.h:30
elm::xom::Attribute::Attribute
Attribute(Attribute *attribute)
Definition: xom_Attribute.cpp:49
elm::xom::Node
Definition: Node.h:40