1/* 2 * Copyright (c) 2000-2012 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 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. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 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 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 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. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28/* OSUnserialize.h created by rsulack on Mon 23-Nov-1998 */ 29 30#ifndef _OS_OSUNSERIALIZE_H 31#define _OS_OSUNSERIALIZE_H 32 33#include <sys/appleapiopts.h> 34#include <sys/types.h> 35 36class OSObject; 37class OSString; 38 39/*! 40 * @header 41 * 42 * @abstract 43 * This header declares the <code>OSUnserializeXML</code> function. 44 */ 45 46 47/*! 48 * @function OSUnserializeXML 49 * 50 * @abstract 51 * Recreates an OSContainer object 52 * from its previously serialized OSContainer class instance data. 53 * 54 * @param buffer A buffer containing nul-terminated XML data 55 * representing the object to be recreated. 56 * @param errorString If non-</code>NULL</code>, and the XML parser 57 * finds an error in <code>buffer</code>, 58 * <code>*errorString</code> indicates the line number 59 * and type of error encountered. 60 * 61 * @result 62 * The recreated object, or <code>NULL</code> on failure. 63 * 64 * @discussion 65 * <b>Not safe</b> to call in a primary interrupt handler. 66 */ 67extern "C++" OSObject * OSUnserializeXML( 68 const char * buffer, 69 OSString ** errorString = 0); 70 71/*! 72 * @function OSUnserializeXML 73 * 74 * @abstract 75 * Recreates an OSContainer object 76 * from its previously serialized OSContainer class instance data. 77 * 78 * @param buffer A buffer containing nul-terminated XML data 79 * representing the object to be recreated. 80 * @param bufferSize The size of the block of memory. The function 81 * never scans beyond the first bufferSize bytes. 82 * @param errorString If non-</code>NULL</code>, and the XML parser 83 * finds an error in <code>buffer</code>, 84 * <code>*errorString</code> indicates the line number 85 * and type of error encountered. 86 * 87 * @result 88 * The recreated object, or <code>NULL</code> on failure. 89 * 90 * @discussion 91 * <b>Not safe</b> to call in a primary interrupt handler. 92 */ 93extern "C++" OSObject * OSUnserializeXML( 94 const char * buffer, 95 size_t bufferSize, 96 OSString ** errorString = 0); 97 98extern "C++" OSObject * 99OSUnserializeBinary(const char *buffer, size_t bufferSize, OSString **errorString); 100 101#ifdef __APPLE_API_OBSOLETE 102extern OSObject* OSUnserialize(const char *buffer, OSString **errorString = 0); 103#endif /* __APPLE_API_OBSOLETE */ 104 105#endif /* _OS_OSUNSERIALIZE_H */ 106