public static IParrot_PMC ToParrotStringPMC(this string arg, Parrot parrot)
 {
     IntPtr pmc_ptr = IntPtr.Zero;
     Parrot_String str = new Parrot_String(parrot, arg);
     int result = Parrot_api_pmc_box_string(parrot.RawPointer, str.RawPointer, out pmc_ptr);
     if (result != 1)
         parrot.GetErrorResult();
     return new Pmc.String(parrot, pmc_ptr);
 }
예제 #2
0
 protected IntPtr this[Parrot_String key]
 {
     get {
         IntPtr value_ptr = IntPtr.Zero;
         int result = Parrot_api_pmc_get_keyed_string(this.Parrot.RawPointer, this.RawPointer, key.RawPointer, out value_ptr);
         if (result != 1)
             this.Parrot.GetErrorResult();
         return value_ptr;
     }
     set {
         int result = Parrot_api_pmc_set_keyed_string(this.Parrot.RawPointer, this.RawPointer, key.RawPointer, value);
         if (result != 1)
             this.Parrot.GetErrorResult();
     }
 }
예제 #3
0
 public ParrotException(Parrot parrot, Parrot_String msg)
 {
     this.msg = msg.ToString();
     this.Parrot = parrot;
     // TODO: Capture the current C# backtrace
 }
예제 #4
0
 public IParrot_PMC[] InvokeMethod(Parrot_String name, IParrot_PMC signature)
 {
     Pmc.Sub sub = this.FindMethod(name) as Pmc.Sub;
     return sub.Invoke(signature);
 }
예제 #5
0
 public IParrot_PMC FindMethod(Parrot_String name)
 {
     IntPtr sub_ptr;
     int result = Parrot_api_pmc_find_method(this.Parrot.RawPointer, this.RawPointer, name.RawPointer, out sub_ptr);
     if (result != 1)
         this.Parrot.GetErrorResult();
     return new Pmc.Sub(this.Parrot, sub_ptr);
 }