Coconut Framework is basic infrastructure of all the other applications and frameworks. This framework has following functions:
XML Data Representation
All XML class wraps libxml library to present XML data.
CNXMLObject is super class of XML objects.
CNXMLDocument is entire XML documentation.
CNXMLNode is super class of all kind of XML node in document tree.
CNXMLElementNode presents element node.
CNXMLTextNode presents text node.
CNXMLCommentNode presents comment node.
CNXMLAttributeNode presents attribute node.
CNXMLNameSpace presents name space of XML tree.
XPath
CNXMLExpression is super class of other XML expression classes
CNXMLRootExpression is used to choose root node
CNXMLElementExpression is used to choose CNXMLElementNode
CNXMLExpressionMatcher is used to find XML node (CNXMLNode) matched with XML expression (CNXMLExpression)
CNXMLExpressionVisitor is visitor class to traverse XML expression
CNXMLExpressionParser.h and CNXMLExpressionLex.h contains function to parser XML expression string
XML Data and File Operatiion
CNXMLFile contains class methods to read and write XML file.
CNXMLAllocator class is used allocate XML object from libxml nodes
CNXMLVisitor class is used for visitor design pattern
CNXMLEnumerator class is used to traverse XML element node and attribute node in XML document tree
CNXMLIndent class is used to adjust indent in XML document to improve readability.
Extension of current classes
Extension of Foundation classes by CNXMLCoding protocol.
Data structure
CNMemoryAllocator is used for dynamic memory allocation. The are some methods for memory allocation. It is defined by the function for memory allocator. To operate dynamic memory, use CNMalloc(), CNRealloc() and CNFree() with memory allocator.
CNListItem is data structure for single linked list. CNListItemPool is used to allocate them.
CNMutableData data structure operates variable size memory object. CNMutableData.h defines functiosn for the object.
CNMutableDataArray data structue operates an array which has variable number of elements. CNMutableDataArray.h defines functiosn for the object.
CNString contains string data. It is designed to be used as a key of hash table. CNString.h defines functiosn for the object.
CNStringPool is used to pool CNString objects. CNStringPool.h defines functiosn for the object.
CNIdentifierTable is the hash table which has CNString as a key and object (or pointer) as a value for it. CNIdentifierTable.h defines function for the object.
CNStrBuffer is a buffer to put variable number of characters. CNStrBuffer.h defines functions for the object.
CNStrRange presents a part of string. CNStrRange.h defines functions for the object.
CNStack class operates objects on stack. CNStack.h defines functions for the object.
File Operation
CNInputStream handles stream of input data.
CNInputFileStream is used for file.
CNURLUtil handles URL information.
CNFileUtil read/write data to/from standard-io.
CNFilePath is database for include-path list.
Command line tool support
CNCommandLine class object contains CNCommand. CNCommand contains command line option (CNOption) information and some arguments (NSString).
The type of command line option (CNOptionType) is defined by CNOptionDefinition .
CNCommandLineParser is used to parse command line arguments and CNCommandLine object.
Parser support
Error handling and debugging
These classes handle NSError object. To learn how to handle it, see Introduction to Error Handling Programming Guide For Cocoa.
CNErrorCreator create NSError object. You can give error description, reason to the object. See Introduction to Error Handling Programming Guide For Cocoa.
File CNAssert.h defines some functions for assertion.
System
CNEnvironment class operates environment variable.
CNDefaults class is used to get system default settings.
1.5.4