1/* 2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_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. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23/* 24 * UtilitiesCFPrettyPrint.h 25 * DiskImages 26 * 27 * Moved here from UtilitiesCoreFoundation.[ch] 28 * 29 * Created by Shantonu Sen on 8/11/04. 30 * Copyright 2004 Apple Computer, Inc. All rights reserved. 31 * 32 * Revision History 33 * 34 * $Log: UtilitiesCFPrettyPrint.h,v $ 35 * Revision 1.2 2005/12/04 05:27:52 ssen 36 * add APSL to remaining source files 37 * 38 * Revision 1.1 2005/02/07 22:32:51 ssen 39 * dump DiskArb info 40 * 41 * Revision 1.1 2004/08/11 18:52:10 ssen 42 * Move TAOCFPrettyPrint code to a separate source file, so that 43 * clients don't need to drag in lots of dependencies on other 44 * parts of TAOcommon or CoreServices 45 * Bug #: 46 * Submitted by: 47 * Reviewed by: 48 * 49 */ 50 51#ifndef _UTILITIES_CFPRETTYPRINT_H_ 52#define _UTILITIES_CFPRETTYPRINT_H_ 53 54#ifdef __cplusplus 55extern "C" { 56#endif 57 58 59#include <CoreFoundation/CoreFoundation.h> 60#include <stdio.h> 61 62/* 63 * @function TAOCFPrettyPrint 64 * @abstract Prints a CFType in a human-readable format 65 * @param inRef A CFTypeRef to be printed. Scalars (CFString, CFNumber, etc.) 66 are printed on a line by themselves. CFArray's are printed one element 67 per line. CFDictionaries are printed as "key: value", one line per pair. 68 In the event that the value is a collection (CFArray or CFDictionary), 69 just "key: " is printed, and the value is printed on the next line, 70 indented by one level. 71 * @result The CFType summary is printed to standard out. 72 * @discussion This function calls through to TAOCFPrettyPrintToFile() 73 * with stdout as the file argument. 74 */ 75 76void TAOCFPrettyPrint(CFTypeRef inRef); 77 78/* 79 * @function TAOCFPrettyPrintWithIndenter 80 * @abstract Prints a CFType in a human-readable format 81 * @param inRef A CFTypeRef to be printed. Scalars (CFString, CFNumber, etc.) 82 are printed on a line by themselves. CFArray's are printed one element 83 per line. CFDictionaries are printed as "key: value", one line per pair. 84 In the event that the value is a collection (CFArray or CFDictionary), 85 just "key: " is printed, and the value is printed on the next line, 86 indented by one level. 87 * @param indent A string to be used for each level of indentation 88 * @result The CFType summary is printed to standard out. 89 * @discussion This function calls through to TAOCFPrettyPrintToFileWithIndenter() 90 * with stdout as the file argument and indent as the indenter 91 */ 92void TAOCFPrettyPrintWithIndenter(CFTypeRef inRef, char *indent); 93 94/* 95 * @function TAOCFPrettyPrintToFile 96 * @abstract Prints a CFType in a human-readable format to a file stream 97 * @param inRef See description under TAOCFPrettyPrint() 98 * @param out The output stream to print to. 99 * @result The CFType summary is printed to the stream out. 100 */ 101 102void TAOCFPrettyPrintToFile(CFTypeRef inRef, FILE *out); 103 104/* 105 * @function TAOCFPrettyPrintToFileWithIndenter 106 * @abstract Prints a CFType in a human-readable format to a file stream 107 * @param inRef See description under TAOCFPrettyPrint() and 108 TAOCFPrettyPrintWithIdentifier 109 * @param out The output stream to print to. 110 * @param indent A string to be used for each level of indentation 111 * @result The CFType summary is printed to the stream out. 112 */ 113 114void TAOCFPrettyPrintToFileWithIndenter(CFTypeRef inRef, FILE *out, char *indent); 115 116#ifdef __cplusplus 117}; 118#endif 119 120#endif 121