Пример #1
0
        public static IDatatype FromData_(Hexalyzer.IAccessor <byte> data, long offset)
        {
            if (offset + 4 > data.Count)
            {
                return(null);
            }

            int  len = T.SystemType.FromData <int>(data, offset);
            long ofs = offset + 4;

            if (len < 0)
            {
                len = -len;
                T.WideString wstr = T.WideString.FromData_(data, ofs, len);
                if (wstr != null)
                {
                    return(new FString(wstr));
                }
            }
            else if (len >= 0)
            {
                T.AsciiString astr;
                if (len == 0)
                {
                    astr = new T.AsciiString("");
                }
                else
                {
                    astr = T.AsciiString.FromData_(data, ofs, len);
                }
                if (astr != null)
                {
                    return(new FString(astr));
                }
            }

            return(null);
        }
Пример #2
0
 public FString(T.AsciiString str)
     : base(str?.Value as string)
 {
     _Source = Source.Ascii;
 }