Example #1
0
        public string GetString()
        {
            var fieldTypeString = FieldType.ToString().ToLower() + ".";
            var fieldSizeString = FieldSize.ToString().ToLower();

            if (InnerFieldSize != null && InnerFieldSize != FieldSize.UNDEFINED)
            {
                fieldSizeString += "." + InnerFieldSize.ToString();
            }
            var offsetString = string.Empty;

            if (Offset < 0)
            {
                offsetString = " -0x" + Math.Abs(Offset).ToString("X");
            }
            else
            {
                offsetString = " 0x" + Offset.ToString("X");
            }
            var positionString = " " + Position.Item1.ToString() + ".";

            positionString += "--" + Position.Item2.ToString() + ".";
            var multiplierString   = " " + Multiplier.ToString() + ".";
            var abbreviationString = " \"" + Abbreviation;
            var descriptionString  = "," + Description + "\"";

            return(Indentation + fieldTypeString + fieldSizeString + offsetString + positionString +
                   multiplierString + abbreviationString + descriptionString);
        }
Example #2
0
        public string GetString()
        {
            var fieldTypeString = FieldType.ToString().ToLower() + ".";
            var fieldSizeString = FieldSize.ToString().ToLower();
            var offsetString    = string.Empty;

            if (Offset < 0)
            {
                offsetString = " -0x" + Math.Abs(Offset).ToString("X");
            }
            else
            {
                offsetString = " 0x" + Offset.ToString("X");
            }
            var positionString = " " + Position.Item1.ToString() + ".";

            if (Position.Item2 != null)
            {
                positionString += "--" + Position.Item2.ToString() + ".";
            }
            var abbreviationString = " \"" + Abbreviation;
            var descriptionString  = "," + Description + "\"";
            var statesString       = " \"" + string.Join(",", States) + "\"";

            return(Indentation + fieldTypeString + fieldSizeString + offsetString + positionString +
                   abbreviationString + descriptionString + statesString);
        }
Example #3
0
        /// <summary>
        /// Gets a string representing the function call for retrieving the specified amount of memory.
        /// </summary>
        public static string GetSizeFunction(FieldSize size)
        {
            switch (size)
            {
            case FieldSize.Bit0: return("bit0");

            case FieldSize.Bit1: return("bit1");

            case FieldSize.Bit2: return("bit2");

            case FieldSize.Bit3: return("bit3");

            case FieldSize.Bit4: return("bit4");

            case FieldSize.Bit5: return("bit5");

            case FieldSize.Bit6: return("bit6");

            case FieldSize.Bit7: return("bit7");

            case FieldSize.LowNibble: return("low4");

            case FieldSize.HighNibble: return("high4");

            case FieldSize.Byte: return("byte");

            case FieldSize.Word: return("word");

            case FieldSize.DWord: return("dword");

            default: return(size.ToString());
            }
        }
Example #4
0
        /// <summary>
        /// Gets a string representing the function call for retrieving the specified amount of memory.
        /// </summary>
        public static string GetSizeFunction(FieldSize size)
        {
            switch (size)
            {
            case FieldSize.Bit0: return("bit0");

            case FieldSize.Bit1: return("bit1");

            case FieldSize.Bit2: return("bit2");

            case FieldSize.Bit3: return("bit3");

            case FieldSize.Bit4: return("bit4");

            case FieldSize.Bit5: return("bit5");

            case FieldSize.Bit6: return("bit6");

            case FieldSize.Bit7: return("bit7");

            case FieldSize.LowNibble: return("low4");

            case FieldSize.HighNibble: return("high4");

            case FieldSize.Byte: return("byte");

            case FieldSize.Word: return("word");

            case FieldSize.TByte: return("tbyte");

            case FieldSize.DWord: return("dword");

            case FieldSize.BitCount: return("bitcount");

            case FieldSize.BigEndianWord: return("word_be");

            case FieldSize.BigEndianTByte: return("tbyte_be");

            case FieldSize.BigEndianDWord: return("dword_be");

            case FieldSize.Float: return("float");

            case FieldSize.MBF32: return("mbf32");

            default: return(size.ToString());
            }
        }
Example #5
0
        public string GetString()
        {
            var fieldTypeString = FieldType.ToString().ToLower() + ".";
            var fieldSizeString = FieldSize.ToString().ToLower();
            var offsetString    = string.Empty;

            if (Offset < 0)
            {
                offsetString = " -0x" + Math.Abs(Offset).ToString("X");
            }
            else
            {
                offsetString = " 0x" + Offset.ToString("X");
            }
            var abbreviationString = " \"" + Abbreviation;
            var descriptionString  = "," + Description + "\"";

            return(Indentation + fieldTypeString + fieldSizeString + offsetString + abbreviationString + descriptionString);
        }