00001 /* 00002 * Copyright (c) 2008 - 2010 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE included in 00009 * the packaging of this file. 00010 */ 00011 00012 #import "OFObject.h" 00013 #import "OFString.h" 00014 00015 @class OFDictionary; 00016 @class OFMutableArray; 00017 00018 extern int _OFXMLElement_reference; 00019 00023 @interface OFXMLAttribute: OFObject 00024 { 00025 OFString *prefix; 00026 OFString *name; 00027 OFString *namespace; 00028 OFString *stringValue; 00029 } 00030 00031 #ifdef OF_HAVE_PROPERTIES 00032 @property (readonly, retain) OFString *prefix; 00033 @property (readonly, retain) OFString *name; 00034 @property (readonly, retain) OFString *namespace; 00035 @property (readonly, retain) OFString *stringValue; 00036 #endif 00037 00045 + attributeWithName: (OFString*)name 00046 prefix: (OFString*)prefix 00047 namespace: (OFString*)ns 00048 stringValue: (OFString*)value; 00049 00059 - initWithName: (OFString*)name 00060 prefix: (OFString*)prefix 00061 namespace: (OFString*)ns 00062 stringValue: (OFString*)value; 00063 00067 - (OFString*)name; 00068 00072 - (OFString*)prefix; 00073 00077 - (OFString*)namespace; 00078 00082 - (OFString*)stringValue; 00083 @end 00084 00091 @interface OFXMLElement: OFObject 00092 { 00093 OFString *name; 00094 OFMutableArray *attributes; 00095 OFString *stringValue; 00096 OFMutableArray *children; 00097 } 00098 00103 + elementWithName: (OFString*)name; 00104 00111 + elementWithName: (OFString*)name 00112 stringValue: (OFString*)stringval; 00113 00120 - initWithName: (OFString*)name; 00121 00131 - initWithName: (OFString*)name 00132 stringValue: (OFString*)stringval; 00133 00138 - (OFString*)string; 00139 00145 - (void)addAttribute: (OFXMLAttribute*)attr; 00146 00153 - (void)addAttributeWithName: (OFString*)name 00154 stringValue: (OFString*)value; 00155 00161 - (void)addChild: (OFXMLElement*)child; 00162 @end 00163 00167 @interface OFString (OFXMLEscaping) 00173 - (OFString*)stringByXMLEscaping; 00174 @end