home *** CD-ROM | disk | FTP | other *** search
-
- /*
- Conversion script for converting NXStream API to NSString API.
- */
-
-
- replace "NXStream *" with "NSMutableString *"
-
- replace "NXWrite(<stream>, <bytes>, <length>)" with "[<stream> appendString:[NSString stringWithCString:<bytes> length:<length>]"
-
- replace "NXPrintf(<stream>, <format>)" with "[<stream> appendString:[NSString stringWithCString:<format>]]"
-
- replace "NXPrintf(<stream>, <format>, <b args>)" with "[<stream> appendFormat:[NSString stringWithCString:<format>], <b args>]"
-
- replace "NXClose(<stream>)" with "[<stream> release]"
-
- replace "NXOpenMemory(NULL, 0, <mode>)" with "[[NSMutableString alloc] init]"
-
- replace "NXOpenMemory(<addr>, <length>, NX_READONLY)" with "[[NSString alloc] initWithCString:<addr> length:<length>]"
-
- replace "NXOpenMemory(<addr>, <length>, <mode>)" with "[[NSMutableString alloc] initWithCString:<addr> length:<length>]"
-
- replace "NXMapFile(<path>, NX_READONLY)" with "[[NSString alloc] initWithData:[NSData dataWithContentsOfMappedFile:<path>]]"
-
- replace "NXSaveToFile(<stream>, <path>)" with "([[<stream> dataUsingEncoding:NSNEXTSTEPStringEncoding] writeToFile:<path> atomically:NO]? 0:-1)"
-
- replace "NXCloseMemory(<stream>, NX_FREEBUFFER)" with "[<stream> release]"
-
- replace "<t function>(<b args>)" with same
- error "StreamConversion: <function> should be converted to an NSString method"
- where "<t function>" isOneOf {
- "NXPutc",
- "NXGetc",
- "NXAtEOS",
- "NXSeek",
- "NXTell",
- "NXRead",
- "NXFlush",
- "NXVPrintf",
- "NXScanf",
- "NXVScanf",
- "NXUngetc",
- "NXOpenFile",
- "NXOpenPort",
- "NXOpenMemory",
- "NXMapFile",
- "NXGetStreamOnSection",
- "NXGetMemoryBuffer",
- "NXCloseMemory",
- "NXPrintfProc",
- "NXRegisterPrintfProc",
- }
-