Main Page | Data Structures | File List | Data Fields | Globals

xmlobjectfactory.c File Reference

#include <glib.h>
#include <glib-object.h>
#include <libxml/tree.h>
#include <string.h>
#include "xmlobjectfactory.h"
#include "xml-common.h"
#include "object.h"
#include "debug.h"

Include dependency graph for xmlobjectfactory.c:

Go to the source code of this file.

Enumerations

enum  Type {
  T_ELEMENT,
  T_ATTRIBUTE,
  T_TYPE,
  T_COUNT
}
 This file is part of alarmd. More...
enum  Element {
  E_OBJECT,
  E_PARAMETER,
  E_COUNT
}
enum  Attributes {
  A_TYPE,
  A_NAME,
  A_COUNT
}

Functions

static int get_id (enum Type type, const unsigned char *const name)
static gchar * get_element_text (xmlNode *node)
GParameter * elements_to_parameters (xmlNode *object_node, guint *n_params)
 elements_to_parameters: : Node whose children should be handled.
AlarmdObjectobject_factory (xmlNode *object_node)
 object_factory: : The node in the tree, which describes the object to be.

Variables

static const char *const element_names [E_COUNT]
static const char *const attribute_names [A_COUNT]
static const char *const
*const 
names [T_COUNT]
static const unsigned int counts [T_COUNT]


Enumeration Type Documentation

enum Attributes
 

Enumeration values:
A_TYPE 
A_NAME 
A_COUNT 

Definition at line 44 of file xmlobjectfactory.c.

enum Element
 

Enumeration values:
E_OBJECT 
E_PARAMETER 
E_COUNT 

Definition at line 38 of file xmlobjectfactory.c.

enum Type
 

This file is part of alarmd.

Contact Person: David Weinehall <david.weinehall@nokia.com>

Copyright (C) 2006 Nokia Corporation alarmd and libalarm are free software; you can redistribute them and/or modify them under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.

alarmd and libalarm are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Enumeration values:
T_ELEMENT 
T_ATTRIBUTE 
T_TYPE 
T_COUNT 

Definition at line 31 of file xmlobjectfactory.c.


Function Documentation

GParameter* elements_to_parameters xmlNode *  object_node,
guint *  n_params
 

elements_to_parameters: : Node whose children should be handled.

: Pointer to guint that should hold the size of returned array.

Scans the children of #object_node for occurrencies of parameter nodes. A GParameter array is build of these. Returns: Newly allocated GParameter array, use alarmd_gparameterv_free to free.

Definition at line 105 of file xmlobjectfactory.c.

References A_NAME, A_TYPE, E_COUNT, E_PARAMETER, get_element_text(), get_id(), object_factory(), T_ATTRIBUTE, T_COUNT, T_ELEMENT, T_TYPE, type_gtypes, Y_BOOLEAN, Y_CHAR, Y_INT, Y_INT64, Y_LONG, Y_OBJECT, Y_STRING, Y_UCHAR, Y_UINT, Y_UINT64, and Y_ULONG.

Referenced by init_queue(), and object_factory().

static gchar* get_element_text xmlNode *  node  )  [static]
 

Definition at line 91 of file xmlobjectfactory.c.

References ENTER_FUNC, and LEAVE_FUNC.

Referenced by elements_to_parameters(), and object_factory().

static int get_id enum Type  type,
const unsigned char *const   name
[static]
 

Definition at line 72 of file xmlobjectfactory.c.

References counts, ENTER_FUNC, LEAVE_FUNC, and names.

Referenced by elements_to_parameters(), and object_factory().

AlarmdObject* object_factory xmlNode *  object_node  ) 
 

object_factory: : The node in the tree, which describes the object to be.

Creates a new object from the xnk tree. May recursively call self to create sub-objects. Returns: Newly created object.

Definition at line 218 of file xmlobjectfactory.c.

References A_TYPE, alarmd_gparameterv_free(), DEBUG, E_OBJECT, elements_to_parameters(), ENTER_FUNC, get_element_text(), get_id(), LEAVE_FUNC, T_ATTRIBUTE, and T_ELEMENT.

Referenced by elements_to_parameters(), and init_queue().


Variable Documentation

const char* const attribute_names[A_COUNT] [static]
 

Initial value:

 {
        "type",
        "name"
}

Definition at line 55 of file xmlobjectfactory.c.

const unsigned int counts[T_COUNT] [static]
 

Initial value:

Definition at line 66 of file xmlobjectfactory.c.

Referenced by get_id().

const char* const element_names[E_COUNT] [static]
 

Initial value:

 {
        "object",
        "parameter"
}

Definition at line 50 of file xmlobjectfactory.c.

const char* const* const names[T_COUNT] [static]
 

Initial value:

Definition at line 60 of file xmlobjectfactory.c.

Referenced by get_id().


Generated on Thu Dec 21 18:23:31 2006 for Alarmd by  doxygen 1.4.2