Coconut XML Framework  beta
Classes | Enumerations | Functions
CNXMLDecodeError.h File Reference

Define XML decode error. More...

#include <Coconut/Coconut.h>
#include <libxml/tree.h>

Go to the source code of this file.

Classes

struct  CNXMLDecodeError
 Information for XML decode error. More...

Enumerations

enum  CNXMLDecodeErrorType {
  CNXMLNoDecodeError = 0, CNXMLIsNotElementNodeError, CNXMLChildIsNotFoundError, CNXMLInvalidElementNameError,
  CNXMLNoAttributeNameError, CNXMLInvalidAttributeValueError, CNXMLInvalidContextError
}
 Type of XML decode error. More...

Functions

static CNXMLDecodeErrorType CNXMLTypeOfDecodeError (const struct CNXMLDecodeError *src)
 Get type in CNXMLDecodeError.
static void CNXMLSetNoDecodeError (struct CNXMLDecodeError *dst)
 Set No decode error.
static void CNXMLSetIsNotElementNodeError (struct CNXMLDecodeError *dst, xmlNodePtr node)
 Set XML is not element node error.
static void CNXMLSetChildIsNotFoundError (struct CNXMLDecodeError *dst, xmlNodePtr node, const xmlChar *reqname)
 Set XML is not element node error.
static void CNXMLSetInvalidElementNameError (struct CNXMLDecodeError *dst, xmlNodePtr node, const xmlChar *reqname)
 Set XML invalid element name error.
static void CNXMLSetNoAttributeNameError (struct CNXMLDecodeError *dst, xmlNodePtr node, const xmlChar *reqname)
 Set XML no attribute name error.
static void CNXMLSetInvalidAttributeValueError (struct CNXMLDecodeError *dst, xmlNodePtr node, const xmlChar *attrname, const xmlChar *invval)
 Set XML invalid attribute value error.
static void CNXMLSetInvalidContextError (struct CNXMLDecodeError *dst, xmlNodePtr node)
 Set XML invalid context error.
struct CNString * CNXMLDecodeErrorToString (const struct CNXMLDecodeError *src, struct CNResource *resource)
 Convert CNXMLDecodeError to error message.

Detailed Description

Define XML decode error.

Copyright
Copyright (C) 2012 Steel Wheels Project

Enumeration Type Documentation

Type of XML decode error.

Enumerator:
CNXMLNoDecodeError 

No decode error.

CNXMLIsNotElementNodeError 

It is not element node error.

CNXMLChildIsNotFoundError 

The child node is not found error.

CNXMLInvalidElementNameError 

Invalid element name.

CNXMLNoAttributeNameError 

No attribute.

CNXMLInvalidAttributeValueError 

Invalid attribute value.

CNXMLInvalidContextError 

Invalid context value.


Function Documentation

static CNXMLDecodeErrorType CNXMLTypeOfDecodeError ( const struct CNXMLDecodeError src) [inline, static]

Get type in CNXMLDecodeError.

Returns:
Type of XML decode error
Parameters:
srcSource XML decode error

References CNXMLDecodeError::errorType.

static void CNXMLSetNoDecodeError ( struct CNXMLDecodeError dst) [inline, static]

Set No decode error.

Parameters:
dstDestination error information

References CNXMLNoDecodeError, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetIsNotElementNodeError ( struct CNXMLDecodeError dst,
xmlNodePtr  node 
) [inline, static]

Set XML is not element node error.

Parameters:
dstDestination error information
nodeXML node whose has this error

References CNXMLIsNotElementNodeError, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetChildIsNotFoundError ( struct CNXMLDecodeError dst,
xmlNodePtr  node,
const xmlChar *  reqname 
) [inline, static]

Set XML is not element node error.

Parameters:
dstDestination error information
nodeXML node whose has this error
reqnameTarget node name

References CNXMLChildIsNotFoundError, CNXMLDecodeError::context, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetInvalidElementNameError ( struct CNXMLDecodeError dst,
xmlNodePtr  node,
const xmlChar *  reqname 
) [inline, static]

Set XML invalid element name error.

Parameters:
dstDestination error information
nodeXML node whose has this error
reqnameRequired element name

References CNXMLInvalidElementNameError, CNXMLDecodeError::context, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetNoAttributeNameError ( struct CNXMLDecodeError dst,
xmlNodePtr  node,
const xmlChar *  reqname 
) [inline, static]

Set XML no attribute name error.

Parameters:
dstDestination error information
nodeXML node whose has this error
reqnameRequired attribute name

References CNXMLNoAttributeNameError, CNXMLDecodeError::context, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetInvalidAttributeValueError ( struct CNXMLDecodeError dst,
xmlNodePtr  node,
const xmlChar *  attrname,
const xmlChar *  invval 
) [inline, static]

Set XML invalid attribute value error.

Parameters:
dstDestination error information
nodeXML node whose has this error
attrnameAttribute name
invvalInvalid attribute value

References CNXMLInvalidAttributeValueError, CNXMLDecodeError::context, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

static void CNXMLSetInvalidContextError ( struct CNXMLDecodeError dst,
xmlNodePtr  node 
) [inline, static]

Set XML invalid context error.

Parameters:
dstDestination error information
nodeXML node whose has this error

References CNXMLInvalidContextError, CNXMLDecodeError::errorNode, and CNXMLDecodeError::errorType.

struct CNString* CNXMLDecodeErrorToString ( const struct CNXMLDecodeError src,
struct CNResource *  resource 
) [read]

Convert CNXMLDecodeError to error message.

Returns:
Converted string
Parameters:
srcSource error information
resourceResource to allocate error message