BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / drivesetup / Support.h
blob7a633e1c0e038bf331d124e3315c9f176757a380
1 /*
2 * Copyright 2002-2013 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
4 */
5 #ifndef SUPPORT_H
6 #define SUPPORT_H
9 #include <DiskDeviceDefs.h>
10 #include <HashMap.h>
11 #include <HashString.h>
12 #include <Slider.h>
13 #include <String.h>
14 #include "StringForSize.h"
17 class BPartition;
20 void dump_partition_info(const BPartition* partition);
22 bool is_valid_partitionable_space(size_t size);
25 class SpaceIDMap : public HashMap<HashString, partition_id> {
26 public:
27 SpaceIDMap();
28 virtual ~SpaceIDMap();
30 partition_id SpaceIDFor(partition_id parentID,
31 off_t spaceOffset);
33 private:
34 partition_id fNextSpaceID;
38 class SizeSlider : public BSlider {
39 public:
40 SizeSlider(const char* name, const char* label,
41 BMessage* message, off_t offset,
42 off_t size, uint32 minGranularity);
43 virtual ~SizeSlider();
45 virtual void SetValue(int32 value);
46 virtual const char* UpdateText() const;
48 off_t Size() const;
49 void SetSize(off_t size);
51 off_t Offset() const;
52 off_t MaxPartitionSize() const;
54 private:
55 off_t fStartOffset;
56 off_t fEndOffset;
57 off_t fSize;
58 off_t fMaxPartitionSize;
59 uint32 fGranularity;
60 mutable char fStatusLabel[64];
64 #endif // SUPPORT_H