Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 
virtual Node * getChild(int index)
Definition: xom_Attribute.cpp:187
void setLocalName(String localName)
Definition: xom_Attribute.cpp:121
void setValue(String value)
Definition: xom_Attribute.cpp:137
value_t value(CString name, int value)
Definition: rtti.h:40
Attribute(Attribute *attribute)
Definition: xom_Attribute.cpp:49
virtual int getChildCount(void)
Definition: xom_Attribute.cpp:195
Definition: String.h:38
void * node
Definition: Node.h:60
virtual String toXML(void)
Definition: xom_Attribute.cpp:163
virtual String getValue(void)
Definition: xom_Attribute.cpp:153
void setNamespace(String prefix, String URI)
Definition: xom_Attribute.cpp:129
Definition: String.h:31
String getLocalName(void) const
Definition: xom_Attribute.cpp:83
virtual String getBaseURI(void)
Definition: xom_Attribute.cpp:179
String getQualifiedName(void) const
Definition: xom_Attribute.cpp:112
Definition: Element.h:21
Definition: Attribute.h:30
String getNamespaceURI(void) const
Definition: xom_Attribute.cpp:102
Definition: Node.h:40
virtual Node * copy(void)
Definition: xom_Attribute.cpp:145
Definition: NodeFactory.h:27
String getNamespacePrefix(void) const
Definition: xom_Attribute.cpp:93