view dstep/foundation/NSXMLDTD.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 89f3c3ef1fd2
children b9de51448c6b
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Aug 3, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.foundation.NSXMLDTD;

import dstep.foundation.NSArray;
import dstep.foundation.NSData;
import dstep.foundation.NSDictionary;
import dstep.foundation.NSError;
import dstep.foundation.NSObjCRuntime;
import dstep.foundation.NSString;
import dstep.foundation.NSURL;
import dstep.foundation.NSXMLDTDNode;
import dstep.foundation.NSXMLNode;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc;

class NSXMLDTD : NSXMLNode
{
	mixin (ObjcWrap);
	
	this ()
	{
		super(typeof(this).alloc.init.objcObject);
	}
	
	typeof(this) init ()
	{
		return invokeObjcSelf!(typeof(this), "init");
	}

	Object initWithContentsOfURL (NSURL url, NSUInteger mask, ref NSError error)
	{
		id err = error ? new objc_object : null;					
		Object result = invokeObjcSelf!(Object, "initWithContentsOfURL:options:error:", NSURL, NSUInteger, id*)(url, mask, &err);
		
		if (err)
			error = new NSError(err);
		
		return result;
	}

	this (NSURL url, NSUInteger mask, ref NSError error)
	{
		typeof(this).alloc.initWithContentsOfURL(url, mask, error);
	}

	Object initWithData (NSData data, NSUInteger mask, ref NSError error)
	{
		id err = error ? new objc_object : null;	
		Object result = invokeObjcSelf!(Object, "initWithData:options:error:", NSData, NSUInteger, id*)(data, mask, &err);
		
		if (err)
			error = new NSError(err);
		
		return result;
	}

	this (NSData data, NSUInteger mask, ref NSError error)
	{
		typeof(this).alloc.initWithData(data, mask, error);
	}

	void setPublicID (NSString publicID)
	{
		return invokeObjcSelf!(void, "setPublicID:", NSString)(publicID);
	}

	NSString publicID ()
	{
		return invokeObjcSelf!(NSString, "publicID");
	}

	void setSystemID (NSString systemID)
	{
		return invokeObjcSelf!(void, "setSystemID:", NSString)(systemID);
	}

	NSString systemID ()
	{
		return invokeObjcSelf!(NSString, "systemID");
	}

	void insertChild (NSXMLNode child, NSUInteger index)
	{
		return invokeObjcSelf!(void, "insertChild:atIndex:", NSXMLNode, NSUInteger)(child, index);
	}

	void insertChildren (NSArray children, NSUInteger index)
	{
		return invokeObjcSelf!(void, "insertChildren:atIndex:", NSArray, NSUInteger)(children, index);
	}

	void removeChildAtIndex (NSUInteger index)
	{
		return invokeObjcSelf!(void, "removeChildAtIndex:", NSUInteger)(index);
	}

	void setChildren (NSArray children)
	{
		return invokeObjcSelf!(void, "setChildren:", NSArray)(children);
	}

	void addChild (NSXMLNode child)
	{
		return invokeObjcSelf!(void, "addChild:", NSXMLNode)(child);
	}

	void replaceChildAtIndex (NSUInteger index, NSXMLNode node)
	{
		return invokeObjcSelf!(void, "replaceChildAtIndex:withNode:", NSUInteger, NSXMLNode)(index, node);
	}

	NSXMLDTDNode entityDeclarationForName (NSString name)
	{
		return invokeObjcSelf!(NSXMLDTDNode, "entityDeclarationForName:", NSString)(name);
	}

	NSXMLDTDNode notationDeclarationForName (NSString name)
	{
		return invokeObjcSelf!(NSXMLDTDNode, "notationDeclarationForName:", NSString)(name);
	}

	NSXMLDTDNode elementDeclarationForName (NSString name)
	{
		return invokeObjcSelf!(NSXMLDTDNode, "elementDeclarationForName:", NSString)(name);
	}

	NSXMLDTDNode attributeDeclarationForName (NSString name, NSString elementName)
	{
		return invokeObjcSelf!(NSXMLDTDNode, "attributeDeclarationForName:elementName:", NSString, NSString)(name, elementName);
	}

	static NSXMLDTDNode predefinedEntityDeclarationForName (NSString name)
	{
		return invokeObjcSuperClass!(NSXMLDTDNode, "predefinedEntityDeclarationForName:", NSString)(name);
	}
}