Ejemplo n.º 1
0
 public virtual Report TransformData(Report report)
 {
     if (_next != null)
     {
         return(_next.TransformData(report));
     }
     return(report);
 }
Ejemplo n.º 2
0
        public List<FileEntry> GetDirectory(Stream strm, IDataTransformer zlibdec)
        {
            List<FileEntry> results = new List<FileEntry>();
            byte[] headerbytes = new byte[512];
            int i = 0;
            byte b;
            string[] header;
            int IndexOffset;
            int Key;
            byte[] IndexData;
            byte[] OutIndexData;
            int OutLength = 0;

            // read header
            do
            {
                b = (byte)strm.ReadByte();
                headerbytes[i++] = b;
            } while (b != 0x0a);
            header = Encoding.ASCII.GetString(headerbytes, 0, i - 1).Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (header.Length != 3)
                return null;

            IndexOffset = Convert.ToInt32(header[1], 16);
            Key = Convert.ToInt32(header[2], 16);

            // read index data
            strm.Seek(IndexOffset, SeekOrigin.Begin);
            IndexData = new byte[strm.Length - IndexOffset];
            strm.Read(IndexData, 0, IndexData.Length);
            OutIndexData = new byte[2 * IndexData.Length];
            do
            {
                TransformationResult res;
                try
                {
                    OutLength = OutIndexData.Length;
                    res = zlibdec.TransformData(IndexData, OutIndexData, IndexData.Length, ref OutLength);
                }
                catch (Exception)
                {
                    res = TransformationResult.BufferTooSmall;
                }

                if (res != TransformationResult.BufferTooSmall)
                    break;

                // if our buffer is too small, try again with a bigger one
                OutIndexData = new byte[2 * OutIndexData.Length];
            } while (true);

            results = PickleLoader.Load(OutIndexData, Key);

            return results;
        }
Ejemplo n.º 3
0
        public Report TransformData(DataRow[] data)
        {
            var report = dataTransformer.TransformData(data);

            return(AfterTransform(report, data));
        }
Ejemplo n.º 4
0
 public Report CreateReport() => _dataTransformer.TransformData(Data);