Example #1
0
        public void SetString(string str)
        {
            if (ClassName != "string")
            {
                return;
            }

            Uarray arr = (Uarray)Members[0];

            byte[]  bytes = UTF8Encoding.UTF8.GetBytes(str);
            UType[] Chars;
            if (arr.Value == null || bytes.Length != arr.Value.Length)
            {
                Chars = new UType[bytes.Length];
                if (arr.Value != null)
                {
                    for (int i = 0; i < Math.Min(bytes.Length, arr.Value.Length); i++)
                    {
                        Chars[i] = arr.Value[i];
                    }
                }
                arr.Value = Chars;
            }
            else
            {
                Chars = arr.Value;
            }
            for (int i = 0; i < bytes.Length; i++)
            {
                if (Chars[i] == null)
                {
                    Chars[i] = new Uchar();
                }
                ((Uchar)Chars[i]).Value = bytes[i];
            }
        }
Example #2
0
 public Uchar(Uchar c)
 {
     Name = c.Name;
 }
Example #3
0
        public void SetString(string str)
        {
            if (ClassName != "string")
            {
                return;
            }

            Uarray arr = (Uarray)Members[0];
            byte[] bytes = UTF8Encoding.UTF8.GetBytes(str);
            UType[] Chars;
            if (arr.Value == null || bytes.Length != arr.Value.Length)
            {
                Chars = new UType[bytes.Length];
                if (arr.Value != null)
                {
                    for (int i = 0; i < Math.Min(bytes.Length, arr.Value.Length); i++)
                    {
                        Chars[i] = arr.Value[i];
                    }
                }
                arr.Value = Chars;
            }
            else
            {
                Chars = arr.Value;
            }
            for (int i = 0; i < bytes.Length; i++)
            {
                if (Chars[i] == null)
                {
                    Chars[i] = new Uchar();
                }
                ((Uchar)Chars[i]).Value = bytes[i];
            }
        }
Example #4
0
 public Uchar(Uchar c)
 {
     Name           = c.Name;
     NeedsAlignment = c.NeedsAlignment;
 }
Example #5
0
 public Uchar(Uchar c)
 {
     Name = c.Name;
 }