Coconut I/O Framework  beta
Functions
CNXMLFile.h File Reference

Define function to operate XML files. More...

#import <Coconut/Coconut.h>
#import <libxml/tree.h>
#import "CNIOError.h"

Go to the source code of this file.

Functions

xmlDocPtr CNXMLReadFromFile (FILE *file, const char *baseurl, NSError **error)
 Read XML file from file.
xmlDocPtr CNXMLReadFromURL (NSURL *url, NSError **error)
 Read XML file at given URL.
xmlDocPtr CNXMLReadFromBuffer (const char *buffer, int bufsize, const char *baseurl, NSError **error)
 Read XML file from buffer on the memory.
NSError * CNXMLWriteToFile (FILE *file, xmlDocPtr src)
 Write XML file to stream.
NSError * CNXMLWriteToURL (NSURL *url, xmlDocPtr src)
 Write XML file to given URL.

Detailed Description

Define function to operate XML files.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

xmlDocPtr CNXMLReadFromFile ( FILE *  file,
const char *  baseurl,
NSError **  error 
)

Read XML file from file.

Return values:
docXML document
NULLFailed to read the XML document
Parameters:
fileInput file stream
baseurlURL for this buffer
errorThe error information. This is set the returned value is NULL
xmlDocPtr CNXMLReadFromURL ( NSURL *  url,
NSError **  error 
)

Read XML file at given URL.

Return values:
docXML document
NULLFailed to read the XML document
Parameters:
urlLocation of the file
errorThe error information. This is set the returned value is NULL
xmlDocPtr CNXMLReadFromBuffer ( const char *  buffer,
int  bufsize,
const char *  baseurl,
NSError **  error 
)

Read XML file from buffer on the memory.

Return values:
docXML document
NULLFailed to read the XML document
Parameters:
bufferSource buffer to be read
bufsizeLength of the source buffer
baseurlURL for this buffer
errorThe error information. This is set the returned value is NULL
NSError* CNXMLWriteToFile ( FILE *  file,
xmlDocPtr  src 
)

Write XML file to stream.

Return values:
nilWriting succeeded
errorWriting failed, the reason is stored in this object
Parameters:
fileOutput file stream
srcSource XML document
NSError* CNXMLWriteToURL ( NSURL *  url,
xmlDocPtr  src 
)

Write XML file to given URL.

Return values:
nilWriting succeeded
errorWriting failed, the reason is stored in this object
Parameters:
urlLocation of the file
srcSource XML document