示例#1
0
        internal const long FBQE_HEADER_LENGTH = LAST_Q_POS + LAST_Q_LEN + 4; // 4-reserve


        ///////////////////////////////////////////////////
        ///////////////////// METHODS /////////////////////
        ///////////////////////////////////////////////////
        /// <summary>
        /// Get by index
        /// </summary>
        /// <param name="idx"></param>
        /// <returns></returns>
        public FBQE GetFBQE(int idx)
        {
            FBQE f = new FBQE();

            f.index   = idx;
            f.address = idx * FBQE_LENGTH;

            f.SG            = VSLib.ConvertByteToString(VSLib.GetByteArray(buffer, f.address + SG_POS, SG_LEN));
            f.ADDRESS_START = VSLib.ConvertByteToLong(VSLib.GetByteArray(buffer, f.address + ADDRESS_START_POS, ADDRESS_START_LEN));
            f.ADDRESS_END   = VSLib.ConvertByteToLong(VSLib.GetByteArray(buffer, f.address + ADDRESS_END_POS, ADDRESS_END_LEN));
            f.LENGTH        = VSLib.ConvertByteToLong(VSLib.GetByteArray(buffer, f.address + LENGTH_POS, LENGTH_LEN));
            f.PREV          = VSLib.ConvertByteToInt(VSLib.GetByteArray(buffer, f.address + PREV_POS, PREV_LEN));
            f.NEXT          = VSLib.ConvertByteToInt(VSLib.GetByteArray(buffer, f.address + NEXT_POS, NEXT_LEN));

            if (f.SG != DEFS.FBQE_SIGNATURE)
            {
                throw new VSException(DEFS.E0006_INVALID_SIGNATURE_CODE, "(FBQE)");
            }

            return(f);
        }
示例#2
0
 /// <summary>
 /// Read long
 /// </summary>
 /// <param name="address"></param>
 /// <returns></returns>
 public long ReadLong(long address)
 {
     return(VSLib.ConvertByteToLong(ReadBytes(address, 8)));
 }
示例#3
0
 /// <summary>
 /// Get long value
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public long GetLong(string name)
 {
     byte[] b = get_field(name, FIELD_TYPE_LONG);
     return((b == null) ? DEFAULT_LONG : VSLib.ConvertByteToLong(b));
 }
示例#4
0
 /// <summary>
 /// Get DateTime value
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public DateTime GetDateTime(string name)
 {
     byte[] b = get_field(name, FIELD_TYPE_DATETIME);
     return((b == null) ? DEFAULT_DATETIME : new DateTime(VSLib.ConvertByteToLong(b)));
 }
示例#5
0
 /// <summary>
 /// Read long
 /// </summary>
 /// <returns></returns>
 public long ReadLong(long offset = -1)
 {
     return(VSLib.ConvertByteToLong(this.ReadBytes(offset, 8)));
 }