Exemple #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;
 }       
Exemple #2
0
 public static unsafe extern void CFDataGetBytes(IntPtr theData, CFRange range, IntPtr buffer);
Exemple #3
0
 internal static extern void CFArrayGetValues(IntPtr intptr, CFRange cfrange, IntPtr intptr_1);
Exemple #4
0
 public static unsafe extern IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, IntPtr buffer);
Exemple #5
0
 public static extern int CFStringGetBytes(IntPtr theString, CFRange range, uint encoding, byte lossByte, byte isExternalRepresentation, byte[] buffer, int maxBufLen, ref int usedBufLen);
 static extern internal bool /* Boolean */ CFStringTransform(/* CFMutableStringRef* */ IntPtr @string, /* CFRange* */ ref CFRange range, /* CFStringRef* */ IntPtr transform, [MarshalAs(UnmanagedType.I1)] /* Boolean */ bool reverse);
 public bool Transform(ref CFRange range, NSString transform, bool reverse)
 {
     return(Transform(ref range, transform.GetHandle(), reverse));
 }
Exemple #8
0
 public static extern void CFDataGetBytes(IntPtr theData, CFRange range, IntPtr buffer);
Exemple #9
0
 public static extern IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, IntPtr buffer);
Exemple #10
0
 extern static unsafe IntPtr CFStringGetCharacters(IntPtr handle, CFRange range, char *buffer);
Exemple #11
0
 internal static extern void CFArrayGetValues(IntPtr intptr, CFRange cfrange, IntPtr intptr_1);
Exemple #12
0
 public static extern int CFStringGetBytes(IntPtr theString, CFRange range, uint encoding, byte lossByte, byte isExternalRepresentation, byte[] buffer, int maxBufLen, ref int usedBufLen);
 public bool Transform(ref CFRange range, CFStringTransform transform, bool reverse)
 {
     return(Transform(ref range, transform.GetConstant().GetHandle(), reverse));
 }