Exemple #1
0
        public void  FillBuffer(byte[]   buffer,
                                ref int nextIndex
                                )
        {
            int indexStart = nextIndex;

            int x = 0;

            Constants.FillBuffer(buffer, ref nextIndex, allocated);
            Constants.FillBuffer(buffer, ref nextIndex, status);
            Constants.FillBuffer(buffer, ref nextIndex, startSector);
            Constants.FillBuffer(buffer, ref nextIndex, endSector);
            Constants.FillBuffer(buffer, ref nextIndex, currentAccessSector);

            for (x = 0; x < fileName.Length; x++)
            {
                buffer[nextIndex] = (byte)fileName[x];  nextIndex++;
            }

            if (dateTimeStamp == null)
            {
                dateTimeStamp = new SipperDateTimeStamp(DateTime.Now);
            }

            dateTimeStamp.FillBuffer(buffer, ref nextIndex);

            for (x = 0; x < description.Length; x++)
            {
                buffer[nextIndex] = (byte)description[x];  nextIndex++;
            }

            if (unUsedSpace != null)
            {
                for (x = 0; x < unUsedSpace.Length; x++)
                {
                    buffer[nextIndex] = unUsedSpace[nextIndex];  nextIndex++;
                }
            }

            int indexEnd       = nextIndex;
            int unUsedSpaceLen = Constants.LOGICAL_BLOCK_SIZE - (indexEnd - indexStart);

            for (x = 0; x < unUsedSpaceLen; x++)
            {
                buffer[nextIndex] = 0;  nextIndex++;
            }
        } /* FillBuffer */
Exemple #2
0
        public SipperFileControlBlock(byte[]   buffer,
                                      ref int nextIndex
                                      )
        {
            int x = 0;

            int indexStart = nextIndex;

            allocated           = BitConverter.ToUInt32(buffer, nextIndex);  nextIndex += sizeof(UInt32);
            status              = BitConverter.ToUInt32(buffer, nextIndex);  nextIndex += sizeof(UInt32);
            startSector         = BitConverter.ToUInt32(buffer, nextIndex);  nextIndex += sizeof(UInt32);
            endSector           = BitConverter.ToUInt32(buffer, nextIndex);  nextIndex += sizeof(UInt32);
            currentAccessSector = BitConverter.ToUInt32(buffer, nextIndex);  nextIndex += sizeof(UInt32);

            for (x = 0; x < fileName.Length; x++)
            {
                fileName[x] = (char)buffer[nextIndex];  nextIndex++;
            }

            dateTimeStamp = new SipperDateTimeStamp(buffer, ref nextIndex);

            for (x = 0; x < description.Length; x++)
            {
                description[x] = (char)buffer[nextIndex];  nextIndex++;
            }

            int indexEnd = nextIndex;

            int unUsedSpaceLen = Constants.LOGICAL_BLOCK_SIZE - (indexEnd - indexStart);

            unUsedSpace = new byte[unUsedSpaceLen];
            for (x = 0; x < unUsedSpace.Length; x++)
            {
                unUsedSpace[x] = buffer[nextIndex];  nextIndex++;
            }
        }
Exemple #3
0
        private void   ParseStatusLine(string line)
        {
            string startSectorStr = GetStatusLineField(line, "bs=");

            if (startSectorStr == null)
            {
                return;
            }

            string currentSectorStr = GetStatusLineField(line, "bc=");

            if (currentSectorStr == null)
            {
                return;
            }

            string endSectorStr = GetStatusLineField(line, "be=");

            if (endSectorStr == null)
            {
                return;
            }

            string dateStr = GetStatusLineField(line, "da=");

            if (dateStr == null)
            {
                return;
            }

            string timeStr = GetStatusLineField(line, "ti=");

            if (timeStr == null)
            {
                return;
            }

            string recordStatusStr = GetStatusLineField(line, "rs=");

            if (recordStatusStr == null)
            {
                return;
            }

            startSector    = (uint)OSservices.HexStrToLong(startSectorStr);
            currentSector  = (uint)OSservices.HexStrToLong(currentSectorStr);
            endSector      = (uint)OSservices.HexStrToLong(endSectorStr);
            recording      = (recordStatusStr == "r");
            statusDateTime = new SipperDateTimeStamp(dateStr, timeStr);

            if ((currentFileControlBlock != null) && recording)
            {
                currentFileControlBlock.EndSector = currentSector;
            }

            if (updateCurrentFileControlBlockEndSector)
            {
                if (currentFileControlBlock != null)
                {
                    currentFileControlBlock.EndSector      = currentSector;
                    updateCurrentFileControlBlockEndSector = false;
                }
            }
        } /* ParseStatusLine */
Exemple #4
0
 public void  SetSipperDateTimeStamp(SipperDateTimeStamp _dateTimeStamp)
 {
     dateTimeStamp = _dateTimeStamp;
 }