Exemplo n.º 1
0
        protected void WriteSeq <T>(BinaryWriter stream, string Field, CVSReader.ValueParse <T> parse, int count, string post)
        {
            uint value = 0u;

            if (Field.Length == 0)
            {
                stream.Write(value);
                return;
            }
            string[] array = Field.Split(CVSReader.SeqSeparator, StringSplitOptions.RemoveEmptyEntries);
            if (array.Length == 0)
            {
                stream.Write(value);
                return;
            }
            this.TrimField(array);
            string text = array[0];

            for (int i = 1; i < count; i++)
            {
                if (i < array.Length)
                {
                    text = text + "=" + array[i];
                }
                else
                {
                    text += "=0";
                }
            }
            text += post;
            value = XSingleton <XCommon> .singleton.XHash(text);

            stream.Write(value);
            for (int j = 0; j < count; j++)
            {
                if (j < array.Length)
                {
                    parse.Write(stream, array[j]);
                }
                else
                {
                    parse.Write(stream, null);
                }
            }
        }
Exemplo n.º 2
0
        protected void WriteArray <T>(BinaryWriter stream, string Field, CVSReader.ValueParse <T> parse)
        {
            byte b = 0;

            string[] array = Field.Split(CVSReader.ListSeparator, StringSplitOptions.RemoveEmptyEntries);
            if (array == null || array.Length == 0)
            {
                stream.Write(b);
                return;
            }
            b = (byte)array.Length;
            stream.Write(b);
            for (byte b2 = 0; b2 < b; b2 += 1)
            {
                string data = array[(int)b2];
                this.TrimField(ref data);
                parse.Write(stream, data);
            }
        }
Exemplo n.º 3
0
 protected void Write <T>(BinaryWriter stream, string Field, CVSReader.ValueParse <T> parse)
 {
     this.TrimField(ref Field);
     parse.Write(stream, Field);
 }