GNUstep CoreBase Library 0.2
CFData.h
1/* CFData.h
2
3 Copyright (C) 2010 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: January, 2010
7
8 This file is part of CoreBase.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFDATA_H__
28#define __COREFOUNDATION_CFDATA_H__
29
30#include <CoreFoundation/CFBase.h>
31
32CF_EXTERN_C_BEGIN
34typedef const struct __CFData *CFDataRef;
36typedef struct __CFData *CFMutableDataRef;
37
44CF_EXPORT CFDataRef
45CFDataCreate (CFAllocatorRef allocator, const UInt8 * bytes, CFIndex length);
46
47CF_EXPORT CFDataRef
48CFDataCreateCopy (CFAllocatorRef allocator, CFDataRef theData);
49
50CF_EXPORT CFDataRef
51CFDataCreateWithBytesNoCopy (CFAllocatorRef allocator, const UInt8 * bytes,
52 CFIndex length, CFAllocatorRef bytesDeallocator);
58CF_EXPORT const UInt8 *CFDataGetBytePtr (CFDataRef theData);
59
60CF_EXPORT void
61CFDataGetBytes (CFDataRef theData, CFRange range, UInt8 * buffer);
62
63CF_EXPORT CFIndex CFDataGetLength (CFDataRef theData);
69CF_EXPORT CFTypeID CFDataGetTypeID (void);
79CF_EXPORT CFMutableDataRef
80CFDataCreateMutable (CFAllocatorRef allocator, CFIndex capacity);
81
82CF_EXPORT CFMutableDataRef
83CFDataCreateMutableCopy (CFAllocatorRef allocator, CFIndex capacity,
84 CFDataRef theData);
90CF_EXPORT UInt8 *CFDataGetMutableBytePtr (CFMutableDataRef theData);
96CF_EXPORT void
97CFDataAppendBytes (CFMutableDataRef theData, const UInt8 * bytes,
98 CFIndex length);
99
100CF_EXPORT void CFDataDeleteBytes (CFMutableDataRef theData, CFRange range);
101
102CF_EXPORT void
103CFDataReplaceBytes (CFMutableDataRef theData, CFRange range,
104 const UInt8 * newBytes, CFIndex newLength);
105
106CF_EXPORT void
107CFDataIncreaseLength (CFMutableDataRef theData, CFIndex extraLength);
108
109CF_EXPORT void CFDataSetLength (CFMutableDataRef theData, CFIndex length);
113CF_EXTERN_C_END
114#endif /* __COREFOUNDATION_CFDATA_H__ */
signed long CFIndex
Definition CFBase.h:165
Definition CFBase.h:172
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301