stumpless 2.2.0
Loading...
Searching...
No Matches
Element.hpp
Go to the documentation of this file.
1#ifndef __ELEMENT_HPP
2#define __ELEMENT_HPP
3
4#include <stumpless/element.h>
5#include <stumpless/Element.hpp>
6#include <stumpless/Param.hpp>
7#include <stddef.h>
8
9namespace stumpless {
10
15 class Element {
16 public:
17
18 struct stumpless_element *equivalent;
19
25 Element( const char *name );
35 Element( struct stumpless_element *element );
43 Element( const Element & element );
44 ~Element( void );
52 Element& AddParam( Param & new_param );
60 Element& AddParam( Param *new_param );
73 Element& AddParam( const char *param_name, const char *param_value );
83 const char *GetName( void );
93 Param GetParam( size_t index );
110 Param GetParam( const char *name );
118 size_t GetParamCount( void );
137 size_t GetParamIndex( const char *name );
151 const char *GetParamName( size_t index );
165 size_t GetParamNameCount( const char *name );
178 const char *GetParamValue( size_t index );
194 const char *GetParamValue( const char *name );
204 bool HasParam( const char *name );
214 Element& SetName( const char *name );
234 Element& SetParam( size_t index, Param *param );
246 Element& SetParamValue( size_t index, const char *value );
266 Element& SetParamValue( const char *name, const char *value );
267 };
268
269}
270
271#endif
An element of structured data.
Definition Element.hpp:15
const char * GetParamValue(const char *name)
Returns the value of the first param with the given name in this Element.
Element & AddParam(Param &new_param)
Adds a Param to this Element.
Param GetParam(size_t index)
Returns the param in the given element at the specified index.
bool HasParam(const char *name)
True if this Element has a Param with the given name, false otherwise.
Param GetParam(const char *name)
Returns the first param in this element with the given name.
size_t GetParamNameCount(const char *name)
Gives the number of params with the given name found in this Element.
Element(const Element &element)
Creates an Element as a copy of another Element.
Element & SetParam(size_t index, Param *param)
Puts the param at the given index in this Element.
Element & AddParam(const char *param_name, const char *param_value)
Creates a new param with the given name and value and adds it to this Element.
Element & SetName(const char *name)
Set the name of this Element.
struct stumpless_element * equivalent
Definition Element.hpp:18
size_t GetParamCount(void)
Returns the number of params in the given element.
Element & SetParamValue(const char *name, const char *value)
Sets the value of the first Param with the given name in this element.
const char * GetName(void)
The name of this Element.
Element(struct stumpless_element *element)
Creates an Element from a stumpless_element struct.
size_t GetParamIndex(const char *name)
Gets the index of the first occurrence of a Param with the given name in this Element.
const char * GetParamName(size_t index)
Gets the name of the Param with the given index in this Element.
Element & SetParamValue(size_t index, const char *value)
Sets the value of the Param at the given index in this Element.
Element(const char *name)
Creates a new Element with the given name.
const char * GetParamValue(size_t index)
Returns the value of the param at the given index in this Element.
Element & AddParam(Param *new_param)
Adds a Param to this Element.
A parameter within a structured data element.
Definition Param.hpp:12
Definition AddressFailure.hpp:7