2 * Copyright 2003-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold, bonefish@cs.tu-berlin.de
9 /*! \file PartitionMapParser.h
10 \brief Implementation of disk parser for "intel" style partitions.
12 Parser reads primary and logical partitions from the disk (according to
13 Master Boot and Extended Boot Records) and fills \c PartitionMap structure
14 with partition representation.
16 #ifndef PARTITION_MAP_PARSER_H
17 #define PARTITION_MAP_PARSER_H
20 #include <SupportDefs.h>
25 class PrimaryPartition
;
26 struct partition_table
;
28 class PartitionMapParser
{
30 PartitionMapParser(int deviceFD
,
31 off_t sessionOffset
, off_t sessionSize
,
33 ~PartitionMapParser();
35 status_t
Parse(const uint8
* block
, PartitionMap
* map
);
37 int32
CountPartitions() const;
38 const Partition
* PartitionAt(int32 index
) const;
41 status_t
_ParsePrimary(const partition_table
* table
,
42 bool& hadToReFitSize
);
43 status_t
_ParseExtended(PrimaryPartition
* primary
,
45 status_t
_ReadPartitionTable(off_t offset
,
46 partition_table
* table
= NULL
);
53 partition_table
* fPartitionTable
; // while parsing
57 #endif // PARTITION_MAP_PARSER_H