From: Joseph Spiros Date: Thu, 15 Jan 2004 00:37:33 +0000 (+0000) Subject: Adding some useful functions to ITFoundation, for dealing with Carbon X-Git-Tag: v0.2~26 X-Git-Url: http://git.ithinksw.org/ITFoundation.git/commitdiff_plain/8dad8db6544423018cfe3496b906af39bb3b3fbf Adding some useful functions to ITFoundation, for dealing with Carbon datatypes. --- diff --git a/ITCarbonSupport.h b/ITCarbonSupport.h new file mode 100755 index 0000000..9e69748 --- /dev/null +++ b/ITCarbonSupport.h @@ -0,0 +1,5 @@ +#import +#import + +NSString *NSStringFromFourCharCode(FourCharCode code); +FourCharCode FourCharCodeFromNSString(NSString *string); \ No newline at end of file diff --git a/ITCarbonSupport.m b/ITCarbonSupport.m new file mode 100755 index 0000000..ed6a35c --- /dev/null +++ b/ITCarbonSupport.m @@ -0,0 +1,9 @@ +#import "ITCarbonSupport.h" + +NSString *NSStringFromFourCharCode(FourCharCode code) { + return [NSString stringWithUTF8String:&code]; +} + +FourCharCode FourCharCodeFromNSString(NSString *string) { + return (*((unsigned long*)[string UTF8String])); +} \ No newline at end of file diff --git a/ITFoundation.xcode/project.pbxproj b/ITFoundation.xcode/project.pbxproj index baec463..f8320c8 100755 --- a/ITFoundation.xcode/project.pbxproj +++ b/ITFoundation.xcode/project.pbxproj @@ -163,6 +163,8 @@ 7CF6C92F057D65B0007FEC13, 7CF6C936057D65BA007FEC13, 7CF6C937057D65BA007FEC13, + 7C97DC2C05B614300013E85F, + 7C97DC2D05B614300013E85F, ); isa = PBXGroup; name = Classes; @@ -337,6 +339,34 @@ //7C2 //7C3 //7C4 + 7C97DC2C05B614300013E85F = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ITCarbonSupport.h; + refType = 4; + sourceTree = ""; + }; + 7C97DC2D05B614300013E85F = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ITCarbonSupport.m; + refType = 4; + sourceTree = ""; + }; + 7C97DC2E05B614300013E85F = { + fileRef = 7C97DC2C05B614300013E85F; + isa = PBXBuildFile; + settings = { + }; + }; + 7C97DC2F05B614300013E85F = { + fileRef = 7C97DC2D05B614300013E85F; + isa = PBXBuildFile; + settings = { + }; + }; 7CA50B2B054E77950074E1D9 = { fileEncoding = 4; isa = PBXFileReference; @@ -582,6 +612,7 @@ 2AB93A3205705A0C007E748F, 7CF6C930057D65B0007FEC13, 7CF6C938057D65BA007FEC13, + 7C97DC2E05B614300013E85F, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -615,6 +646,7 @@ 2AB93A3305705A0C007E748F, 7CF6C931057D65B0007FEC13, 7CF6C939057D65BA007FEC13, + 7C97DC2F05B614300013E85F, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0;