view dstep/corefoundation/CFURL.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
line wrap: on
line source

/**
 * Copyright: Copyright (c) 2009 Jacob Carlborg.
 * Authors: Jacob Carlborg
 * Version: Initial created: Jul 12, 2009 
 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
 */
module dstep.corefoundation.CFURL;

import dstep.corefoundation.CFBase;
import dstep.corefoundation.CFData;
import dstep.corefoundation.CFString;
import dstep.coreservices.carboncore.Files : FSRef;
import dstep.objc.bridge.Bridge;
import dstep.objc.objc : id;

alias int CFURLPathStyle;
struct __CFURL;
alias __CFURL* CFURLRef;
alias int CFURLComponentType;

enum
{
	kCFURLPOSIXPathStyle = 0,
	kCFURLHFSPathStyle,
	kCFURLWindowsPathStyle
}

enum
{
	kCFURLComponentScheme = 1,
	kCFURLComponentNetLocation = 2,
	kCFURLComponentPath = 3,
	kCFURLComponentResourceSpecifier = 4,
	kCFURLComponentUser = 5,
	kCFURLComponentPassword = 6,
	kCFURLComponentUserInfo = 7,
	kCFURLComponentHost = 8,
	kCFURLComponentPort = 9,
	kCFURLComponentParameterString = 10,
	kCFURLComponentQuery = 11,
	kCFURLComponentFragment = 12
}

extern (C)
{
	uint CFURLGetTypeID ();
	CFURLRef CFURLCreateWithBytes (CFAllocatorRef allocator, char* URLBytes, int length, uint encoding, CFURLRef baseURL);
	CFDataRef CFURLCreateData (CFAllocatorRef allocator, CFURLRef url, uint encoding, ubyte escapeWhitespace);
	CFURLRef CFURLCreateWithString (CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL);
	CFURLRef CFURLCreateAbsoluteURLWithBytes (CFAllocatorRef alloc, char* relativeURLBytes, int length, uint encoding, CFURLRef baseURL, ubyte useCompatibilityMode);
	CFURLRef CFURLCreateWithFileSystemPath (CFAllocatorRef allocator, CFStringRef filePath, int pathStyle, ubyte isDirectory);
	CFURLRef CFURLCreateFromFileSystemRepresentation (CFAllocatorRef allocator, char* buffer, int bufLen, ubyte isDirectory);
	CFURLRef CFURLCreateWithFileSystemPathRelativeToBase (CFAllocatorRef allocator, CFStringRef filePath, int pathStyle, ubyte isDirectory, CFURLRef baseURL);
	CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase (CFAllocatorRef allocator, char* buffer, int bufLen, ubyte isDirectory, CFURLRef baseURL);
	ubyte CFURLGetFileSystemRepresentation (CFURLRef url, ubyte resolveAgainstBase, char* buffer, int maxBufLen);
	CFURLRef CFURLCopyAbsoluteURL (CFURLRef relativeURL);
	CFStringRef CFURLGetString (CFURLRef anURL);
	CFURLRef CFURLGetBaseURL (CFURLRef anURL);
	ubyte CFURLCanBeDecomposed (CFURLRef anURL);
	CFStringRef CFURLCopyScheme (CFURLRef anURL);
	CFStringRef CFURLCopyNetLocation (CFURLRef anURL);
	CFStringRef CFURLCopyPath (CFURLRef anURL);
	CFStringRef CFURLCopyStrictPath (CFURLRef anURL, char* isAbsolute);
	CFStringRef CFURLCopyFileSystemPath (CFURLRef anURL, int pathStyle);
	ubyte CFURLHasDirectoryPath (CFURLRef anURL);
	CFStringRef CFURLCopyResourceSpecifier (CFURLRef anURL);
	CFStringRef CFURLCopyHostName (CFURLRef anURL);
	int CFURLGetPortNumber (CFURLRef anURL);
	CFStringRef CFURLCopyUserName (CFURLRef anURL);
	CFStringRef CFURLCopyPassword (CFURLRef anURL);
	CFStringRef CFURLCopyParameterString (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
	CFStringRef CFURLCopyQueryString (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
	CFStringRef CFURLCopyFragment (CFURLRef anURL, CFStringRef charactersToLeaveEscaped);
	CFStringRef CFURLCopyLastPathComponent (CFURLRef url);
	CFStringRef CFURLCopyPathExtension (CFURLRef url);
	CFURLRef CFURLCreateCopyAppendingPathComponent (CFAllocatorRef allocator, CFURLRef url, CFStringRef pathComponent, ubyte isDirectory);
	CFURLRef CFURLCreateCopyDeletingLastPathComponent (CFAllocatorRef allocator, CFURLRef url);
	CFURLRef CFURLCreateCopyAppendingPathExtension (CFAllocatorRef allocator, CFURLRef url, CFStringRef extension);
	CFURLRef CFURLCreateCopyDeletingPathExtension (CFAllocatorRef allocator, CFURLRef url);
	int CFURLGetBytes (CFURLRef url, char* buffer, int bufferLength);
	CFRange CFURLGetByteRangeForComponent (CFURLRef url, int component, CFRange* rangeIncludingSeparators);
	CFStringRef CFURLCreateStringByReplacingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveEscaped);
	CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding (CFAllocatorRef allocator, CFStringRef origString, CFStringRef charsToLeaveEscaped, uint encoding);
	CFStringRef CFURLCreateStringByAddingPercentEscapes (CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, uint encoding);
	CFURLRef CFURLCreateFromFSRef (CFAllocatorRef allocator, FSRef* fsRef);
	ubyte CFURLGetFSRef (CFURLRef url, FSRef* fsRef);
}