コード例 #1
0
ファイル: Cell.cs プロジェクト: pwdlugosz/Spectre
        /// <summary>
        ///
        /// </summary>
        /// <param name="AWValue"></param>
        public Cell(BString Value)
            : this()
        {
            this.AFFINITY = CellAffinity.BSTRING;

            // Handle null strings //
            if (Value == null)
            {
                this.BSTRING = BString.Empty;
                this.NULL    = 1;
                return;
            }

            // Fix the values
            if (Value.Length == 0) // fix instances that are zero length
            {
                Value = BString.Empty;
            }
            else if (Value.Length >= MAX_STRING_LENGTH) // Fix strings that are too long
            {
                Value = Value.Substring(0, MAX_STRING_LENGTH);
            }

            this.BSTRING = Value;
            this.NULL    = 0;

            this.INT_A = Value.GetHashCode();
            this.INT_B = Value.Length;
        }