PyUnicode_FromUnicode() private method

private PyUnicode_FromUnicode ( string s, int size ) : IntPtr
s string
size int
return IntPtr
Esempio n. 1
0
        private static IntPtr FromString(string s)
        {
            IntPtr val = Runtime.PyUnicode_FromUnicode(s, s.Length);

            PythonException.ThrowIfIsNull(val);
            return(val);
        }
Esempio n. 2
0
 /// <summary>
 /// PyString Constructor
 /// </summary>
 /// <remarks>
 /// Creates a Python string from a managed string.
 /// </remarks>
 public PyString(string s)
 {
     obj = Runtime.PyUnicode_FromUnicode(s, s.Length);
     if (obj == IntPtr.Zero)
     {
         throw new PythonException();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// PyString Constructor
 /// </summary>
 /// <remarks>
 /// Creates a Python string from a managed string.
 /// </remarks>
 public PyString(string s)
 {
     obj = Runtime.PyUnicode_FromUnicode(s, s.Length);
     Runtime.CheckExceptionOccurred();
 }
Esempio n. 4
0
 /// <summary>
 /// PyString Constructor
 /// </summary>
 /// <remarks>
 /// Creates a Python string from a managed string.
 /// </remarks>
 public PyString(string s)
 {
     obj = Runtime.PyUnicode_FromUnicode(s, s.Length);
     PythonException.ThrowIfIsNull(obj);
 }