예제 #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];
            }
        }
예제 #2
0
 public Uchar(Uchar c)
 {
     Name = c.Name;
 }
예제 #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];
            }
        }
예제 #4
0
파일: TypeParser.cs 프로젝트: kkdevs/sb3u
 public Uchar(Uchar c)
 {
     Name           = c.Name;
     NeedsAlignment = c.NeedsAlignment;
 }
예제 #5
0
 public Uchar(Uchar c)
 {
     Name = c.Name;
 }