]> git.saurik.com Git - apple/security.git/blobdiff - Security/libsecurity_transform/lib/c++utils.cpp
Security-57336.1.9.tar.gz
[apple/security.git] / Security / libsecurity_transform / lib / c++utils.cpp
diff --git a/Security/libsecurity_transform/lib/c++utils.cpp b/Security/libsecurity_transform/lib/c++utils.cpp
deleted file mode 100644 (file)
index 6bc113e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "c++utils.h"
-
-using namespace std;
-
-std::string StringFromCFString(CFStringRef theString)
-{
-       CFIndex maxLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(theString), 0);
-       
-       if (maxLength <= 0) // roll over?  just plain bad?
-       {
-               return "";
-       }
-       
-       // leave room for NULL termination
-       maxLength += 1;
-       
-       char* buffer = new char[maxLength];
-
-       if (buffer == NULL) // out of memory?  Naughty, naughty...
-       {
-               return "";
-       }
-       
-       CFStringGetCString(theString, buffer, maxLength, 0);
-       
-       string result(buffer);
-       delete buffer;
-       return result;
-}
-
-
-
-CFStringRef CFStringFromString(std::string theString)
-{
-       return CFStringCreateWithCString(NULL, theString.c_str(), 0);
-}
-
-
-
-CFTypeRefHolder::~CFTypeRefHolder()
-{
-       if (mTypeRef != NULL)
-       {
-               CFRelease(mTypeRef);
-       }
-}
-
-
-
-void CFTypeRefHolder::Set(CFTypeRef typeRef)
-{
-       if (mTypeRef != NULL)
-       {
-               CFRelease(mTypeRef);
-       }
-       
-       mTypeRef = typeRef;
-}
-