Exemplo n.º 1
0
		public DateWrapper( AsciiDateRecord dateRecord ) {
			m_asciiDateRecord = dateRecord;

			byte year = (byte)( Convert.ToInt32( IsoAlgorithm.ByteArrayToString( dateRecord.Year ) ) - 1900 );
			byte month = Convert.ToByte( IsoAlgorithm.ByteArrayToString( dateRecord.Month ) );
			byte dayOfMonth = Convert.ToByte( IsoAlgorithm.ByteArrayToString( dateRecord.DayOfMonth ) );
			byte hour = Convert.ToByte( IsoAlgorithm.ByteArrayToString( dateRecord.Hour ) );
			byte minute = Convert.ToByte( IsoAlgorithm.ByteArrayToString( dateRecord.Minute ) );
			byte second = Convert.ToByte( IsoAlgorithm.ByteArrayToString( dateRecord.Second ) );
			int millisecond = Convert.ToInt32( IsoAlgorithm.ByteArrayToString( dateRecord.HundredthsOfSecond ) ) * 10;

			this.SetBinaryDateRecord( year, month, dayOfMonth, hour, minute, second );
			m_date = new DateTime( 1900+year, month, dayOfMonth, hour, minute, second, millisecond );
		}
		private void SetVolumeDescriptor( byte[] systemId, byte[] volumeId, UInt64 volumeSpaceSize, UInt64 pathTableSize,
										  UInt32 typeLPathTable, UInt32 typeMPathTable, DirectoryRecord rootDirRecord,
										  byte[] volumeSetId, byte[] publisherId, byte[] preparerId, byte[] applicationId,
										  byte[] copyrightFileId, byte[] abstractFileId, byte[] bibliographicFieldId,
										  AsciiDateRecord creationDate, AsciiDateRecord modificationDate,
										  AsciiDateRecord expirationDate, AsciiDateRecord effectiveDate ) {

			if ( m_volumeDescriptor == null ) {
				m_volumeDescriptor = new VolumeDescriptor();
			}

			volumeSetId.CopyTo( m_volumeDescriptor.VolumeSetId, 0 );
			publisherId.CopyTo( m_volumeDescriptor.PublisherId, 0 );
			preparerId.CopyTo( m_volumeDescriptor.PreparerId, 0 );
			applicationId.CopyTo( m_volumeDescriptor.ApplicationId, 0 );
			copyrightFileId.CopyTo( m_volumeDescriptor.CopyrightFileId, 0 );
			abstractFileId.CopyTo( m_volumeDescriptor.AbstractFileId, 0 );
			bibliographicFieldId.CopyTo( m_volumeDescriptor.BibliographicFileId, 0 );

			this.SetVolumeDescriptor( systemId, volumeId, volumeSpaceSize, pathTableSize, typeLPathTable, typeMPathTable,
									  rootDirRecord, creationDate, modificationDate, expirationDate, effectiveDate );
		}
Exemplo n.º 3
0
		private void SetAsciiDateRecord( int year, int month, int dayOfMonth, int hour, int minute, int second, int hundredthsOfSecond, sbyte timeZone ) {
			if ( m_asciiDateRecord == null ) {
				m_asciiDateRecord = new AsciiDateRecord();
			}

			string sYear = String.Format( "{0:D4}", year%10000 );
			string sMonth = String.Format( "{0:D2}", month );
			string sDay = String.Format( "{0:D2}", dayOfMonth );
			string sHour = String.Format( "{0:D2}", hour );
			string sMinute = String.Format( "{0:D2}", minute );
			string sSecond = String.Format( "{0:D2}", second );
			string sHundredths = String.Format( "{0:D2}", hundredthsOfSecond );

			m_asciiDateRecord.Year = IsoAlgorithm.StringToByteArray( sYear );
			m_asciiDateRecord.Month = IsoAlgorithm.StringToByteArray( sMonth );
			m_asciiDateRecord.DayOfMonth = IsoAlgorithm.StringToByteArray( sDay );
			m_asciiDateRecord.Hour = IsoAlgorithm.StringToByteArray( sHour );
			m_asciiDateRecord.Minute = IsoAlgorithm.StringToByteArray( sMinute );
			m_asciiDateRecord.Second = IsoAlgorithm.StringToByteArray( sSecond );
			m_asciiDateRecord.HundredthsOfSecond = IsoAlgorithm.StringToByteArray( sHundredths );
			m_asciiDateRecord.TimeZone = timeZone;
		}
		private void SetVolumeDescriptor( byte[] systemId, byte[] volumeId, UInt64 volumeSpaceSize, UInt64 pathTableSize,
										  UInt32 typeLPathTable, UInt32 typeMPathTable, DirectoryRecord rootDirRecord,
										  AsciiDateRecord creationDate, AsciiDateRecord modificationDate,
										  AsciiDateRecord expirationDate, AsciiDateRecord effectiveDate ) {

			if ( m_volumeDescriptor == null ) {
				m_volumeDescriptor = new VolumeDescriptor();
			}

			m_volumeDescriptor.VolumeDescType = (byte)m_volumeDescriptorType;

			systemId.CopyTo( m_volumeDescriptor.SystemId, 0 );
			volumeId.CopyTo( m_volumeDescriptor.VolumeId, 0 );
			m_volumeDescriptor.VolumeSpaceSize = volumeSpaceSize;
			m_volumeDescriptor.PathTableSize = pathTableSize;
			m_volumeDescriptor.TypeLPathTable = typeLPathTable;
			m_volumeDescriptor.TypeMPathTable = typeMPathTable;

			m_volumeDescriptor.RootDirRecord = rootDirRecord;
			m_rootDirRecord = new DirectoryRecordWrapper( rootDirRecord );

			m_volumeDescriptor.CreationDate = creationDate;
			m_creationDate = new DateWrapper( creationDate );

			m_volumeDescriptor.ModificationDate = modificationDate;
			m_modificationDate = new DateWrapper( modificationDate );

			m_volumeDescriptor.ExpirationDate = expirationDate;
			m_expirationDate = new DateWrapper( expirationDate );

			m_volumeDescriptor.EffectiveDate = effectiveDate;
			m_effectiveDate = new DateWrapper( effectiveDate );
		}