예제 #1
0
 private string CFString()
 {
     if (typeRef == IntPtr.Zero)
         return null;
     
         string str;
         int length = CFLibrary.CFStringGetLength(typeRef);        
         IntPtr u = CFLibrary.CFStringGetCharactersPtr(typeRef);
         IntPtr buffer = IntPtr.Zero;
         if (u == IntPtr.Zero)
         {
             CFRange range = new CFRange(0, length);
             buffer = Marshal.AllocCoTaskMem(length * 2);
             CFLibrary.CFStringGetCharacters(typeRef, range, buffer);
             u = buffer;
         }
         unsafe
         {
             str = new string((char*)u, 0, length);
         }
         if (buffer != IntPtr.Zero)
             Marshal.FreeCoTaskMem(buffer);
         return str;
 }       
예제 #2
0
 public static unsafe extern void CFDataGetBytes(IntPtr theData, CFRange range, IntPtr buffer);
예제 #3
0
 internal static extern void CFArrayGetValues(IntPtr intptr, CFRange cfrange, IntPtr intptr_1);
예제 #4
0
 public static unsafe extern IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, IntPtr buffer);
예제 #5
0
 public static extern int CFStringGetBytes(IntPtr theString, CFRange range, uint encoding, byte lossByte, byte isExternalRepresentation, byte[] buffer, int maxBufLen, ref int usedBufLen);
예제 #6
0
 static extern internal bool /* Boolean */ CFStringTransform(/* CFMutableStringRef* */ IntPtr @string, /* CFRange* */ ref CFRange range, /* CFStringRef* */ IntPtr transform, [MarshalAs(UnmanagedType.I1)] /* Boolean */ bool reverse);
예제 #7
0
 public bool Transform(ref CFRange range, NSString transform, bool reverse)
 {
     return(Transform(ref range, transform.GetHandle(), reverse));
 }
예제 #8
0
 public static extern void CFDataGetBytes(IntPtr theData, CFRange range, IntPtr buffer);
예제 #9
0
 public static extern IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, IntPtr buffer);
예제 #10
0
 extern static unsafe IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, char *buffer);
예제 #11
0
 internal static extern void CFArrayGetValues(IntPtr intptr, CFRange cfrange, IntPtr intptr_1);
예제 #12
0
 public static extern int CFStringGetBytes(IntPtr theString, CFRange range, uint encoding, byte lossByte, byte isExternalRepresentation, byte[] buffer, int maxBufLen, ref int usedBufLen);
예제 #13
0
 public bool Transform(ref CFRange range, CFStringTransform transform, bool reverse)
 {
     return(Transform(ref range, transform.GetConstant().GetHandle(), reverse));
 }