2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2015-10-12 06:39:31 +01:00
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Partition.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2015-10-12 06:39:31 +01:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Component : DiscImageChef common types.
|
2015-10-12 06:39:31 +01:00
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Contains common partition types.
|
2015-10-12 06:39:31 +01:00
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// This library is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
// published by the Free Software Foundation; either version 2.1 of the
|
2015-10-12 06:39:31 +01:00
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// This library is distributed in the hope that it will be useful, but
|
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
// Lesser General Public License for more details.
|
2015-10-12 06:39:31 +01:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2015-10-12 06:39:31 +01:00
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-05-19 20:28:49 +01:00
|
|
|
// Copyright © 2011-2017 Natalia Portillo
|
2015-10-12 06:39:31 +01:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
2015-10-05 19:45:07 +01:00
|
|
|
namespace DiscImageChef.CommonTypes
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Partition structure.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public struct Partition
|
|
|
|
|
{
|
|
|
|
|
/// <summary>Partition number, 0-started</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong Sequence;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Partition type</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public string Type;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Partition name (if the scheme supports it)</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public string Name;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Start of the partition, in bytes</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong Offset;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>LBA of partition start</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong Start;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Length in bytes of the partition</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong Size;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Length in sectors of the partition</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong Length;
|
2015-10-05 19:45:07 +01:00
|
|
|
/// <summary>Information that does not find space in this struct</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public string Description;
|
2017-07-19 16:31:08 +01:00
|
|
|
/// <summary>LBA of last partition sector</summary>
|
2017-07-19 16:37:11 +01:00
|
|
|
public ulong End { get { return Start + Length - 1; }}
|
2017-07-23 22:54:36 +01:00
|
|
|
/// <summary>Name of partition scheme that contains this partition</summary>
|
|
|
|
|
public string Scheme;
|
2015-10-05 19:45:07 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|