]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
39037602 | 2 | * Copyright (c) 2000-2016 Apple Inc. All rights reserved. |
1c79356b | 3 | * |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
0a7de745 | 5 | * |
2d21ac55 A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
0a7de745 | 14 | * |
2d21ac55 A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
0a7de745 | 17 | * |
2d21ac55 A |
18 | * The Original Code and all software distributed under the License are |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
0a7de745 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* OSUnserialize.h created by rsulack on Mon 23-Nov-1998 */ | |
29 | ||
30 | #ifndef _OS_OSUNSERIALIZE_H | |
31 | #define _OS_OSUNSERIALIZE_H | |
32 | ||
cb323159 A |
33 | #include <libkern/c++/OSMetaClass.h> |
34 | #include <libkern/c++/OSString.h> | |
f427ee49 | 35 | #include <libkern/c++/OSPtr.h> |
cb323159 | 36 | |
9bccf70c | 37 | #include <sys/appleapiopts.h> |
39236c6e | 38 | #include <sys/types.h> |
9bccf70c | 39 | |
1c79356b A |
40 | class OSObject; |
41 | class OSString; | |
42 | ||
b0d623f7 A |
43 | /*! |
44 | * @header | |
45 | * | |
46 | * @abstract | |
47 | * This header declares the <code>OSUnserializeXML</code> function. | |
48 | */ | |
0a7de745 | 49 | |
1c79356b | 50 | |
b0d623f7 A |
51 | /*! |
52 | * @function OSUnserializeXML | |
53 | * | |
54 | * @abstract | |
55 | * Recreates an OSContainer object | |
56 | * from its previously serialized OSContainer class instance data. | |
57 | * | |
58 | * @param buffer A buffer containing nul-terminated XML data | |
59 | * representing the object to be recreated. | |
39037602 | 60 | * @param errorString If non-<code>NULL</code>, and the XML parser |
b0d623f7 A |
61 | * finds an error in <code>buffer</code>, |
62 | * <code>*errorString</code> indicates the line number | |
63 | * and type of error encountered. | |
64 | * | |
65 | * @result | |
66 | * The recreated object, or <code>NULL</code> on failure. | |
67 | * | |
68 | * @discussion | |
69 | * <b>Not safe</b> to call in a primary interrupt handler. | |
70 | */ | |
f427ee49 | 71 | extern "C++" OSPtr<OSObject> OSUnserializeXML( |
0a7de745 | 72 | const char * buffer, |
f427ee49 A |
73 | OSString * * errorString = NULL); |
74 | ||
75 | extern "C++" OSPtr<OSObject> OSUnserializeXML( | |
76 | const char * buffer, | |
77 | OSSharedPtr<OSString>& errorString); | |
1c79356b | 78 | |
39236c6e A |
79 | /*! |
80 | * @function OSUnserializeXML | |
81 | * | |
82 | * @abstract | |
83 | * Recreates an OSContainer object | |
84 | * from its previously serialized OSContainer class instance data. | |
85 | * | |
86 | * @param buffer A buffer containing nul-terminated XML data | |
87 | * representing the object to be recreated. | |
88 | * @param bufferSize The size of the block of memory. The function | |
89 | * never scans beyond the first bufferSize bytes. | |
39037602 | 90 | * @param errorString If non-<code>NULL</code>, and the XML parser |
39236c6e A |
91 | * finds an error in <code>buffer</code>, |
92 | * <code>*errorString</code> indicates the line number | |
93 | * and type of error encountered. | |
94 | * | |
95 | * @result | |
96 | * The recreated object, or <code>NULL</code> on failure. | |
97 | * | |
98 | * @discussion | |
99 | * <b>Not safe</b> to call in a primary interrupt handler. | |
100 | */ | |
f427ee49 A |
101 | extern "C++" OSPtr<OSObject> OSUnserializeXML( |
102 | const char * buffer, | |
103 | size_t bufferSize, | |
104 | OSString * *errorString = NULL); | |
105 | ||
106 | extern "C++" OSPtr<OSObject> OSUnserializeXML( | |
0a7de745 A |
107 | const char * buffer, |
108 | size_t bufferSize, | |
f427ee49 A |
109 | OSSharedPtr<OSString> &errorString); |
110 | ||
111 | extern "C++" OSPtr<OSObject> | |
112 | OSUnserializeBinary(const char *buffer, size_t bufferSize, OSString * *errorString); | |
39236c6e | 113 | |
f427ee49 A |
114 | extern "C++" OSPtr<OSObject> |
115 | OSUnserializeBinary(const char *buffer, size_t bufferSize, OSSharedPtr<OSString>& errorString); | |
fe8ab488 | 116 | |
9bccf70c | 117 | #ifdef __APPLE_API_OBSOLETE |
f427ee49 A |
118 | extern OSPtr<OSObject> OSUnserialize(const char *buffer, OSString * *errorString = NULL); |
119 | ||
120 | extern OSPtr<OSObject> OSUnserialize(const char *buffer, OSSharedPtr<OSString>& errorString); | |
121 | ||
9bccf70c | 122 | #endif /* __APPLE_API_OBSOLETE */ |
1c79356b A |
123 | |
124 | #endif /* _OS_OSUNSERIALIZE_H */ |