Root/
Source at commit 1206 created 12 years 9 months ago. By meklort, Update Disk + Partition classes | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2011 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | #include <Disk.hpp>␊ |
6 | ␊ |
7 | ␊ |
8 | Disk::Disk()␊ |
9 | {␊ |
10 | mName = NULL;␊ |
11 | mPartitions = NULL;␊ |
12 | }␊ |
13 | ␊ |
14 | Disk::~Disk()␊ |
15 | {␊ |
16 | ␊ |
17 | }␊ |
18 | ␊ |
19 | Partition* Disk::getPartition(UInt32 index)␊ |
20 | {␊ |
21 | PartitionList* current = mPartitions;␊ |
22 | while(current)␊ |
23 | {␊ |
24 | if(current->entry->getPartitionNumber() == index)␊ |
25 | {␊ |
26 | return current->entry;␊ |
27 | }␊ |
28 | else␊ |
29 | {␊ |
30 | current = current->next;␊ |
31 | }␊ |
32 | }␊ |
33 | ␊ |
34 | return NULL;␊ |
35 | }␊ |
36 | ␊ |
37 | void Disk::addPartition(Partition* partition)␊ |
38 | {␊ |
39 | PartitionList* list = new PartitionList;␊ |
40 | list->entry = partition;␊ |
41 | list->next = mPartitions;␊ |
42 | mPartitions = list;␊ |
43 | } |