]> git.saurik.com Git - apple/cf.git/blame - Collections.subproj/CFData.h
CF-299.35.tar.gz
[apple/cf.git] / Collections.subproj / CFData.h
CommitLineData
9ce05555
A
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25/* CFData.h
26 Copyright (c) 1998-2003, Apple, Inc. All rights reserved.
27*/
28
29#if !defined(__COREFOUNDATION_CFDATA__)
30#define __COREFOUNDATION_CFDATA__ 1
31
32#include <CoreFoundation/CFBase.h>
33
34#if defined(__cplusplus)
35extern "C" {
36#endif
37
38typedef const struct __CFData * CFDataRef;
39typedef struct __CFData * CFMutableDataRef;
40
41CF_EXPORT
42CFTypeID CFDataGetTypeID(void);
43
44CF_EXPORT
45CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
46
47CF_EXPORT
48CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
49 /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */
50
51CF_EXPORT
52CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData);
53
54CF_EXPORT
55CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
56
57CF_EXPORT
58CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData);
59
60CF_EXPORT
61CFIndex CFDataGetLength(CFDataRef theData);
62
63CF_EXPORT
64const UInt8 *CFDataGetBytePtr(CFDataRef theData);
65
66CF_EXPORT
67UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData);
68
69CF_EXPORT
70void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer);
71
72CF_EXPORT
73void CFDataSetLength(CFMutableDataRef theData, CFIndex length);
74
75CF_EXPORT
76void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength);
77
78CF_EXPORT
79void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length);
80
81CF_EXPORT
82void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength);
83
84CF_EXPORT
85void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range);
86
87#if defined(__cplusplus)
88}
89#endif
90
91#endif /* ! __COREFOUNDATION_CFDATA__ */
92