CustomDevice.h
Go to the documentation of this file.
1 /*
2  * CustomDevice.h
3  */
4 
5 #pragma once
6 
7 #include "Device.h"
8 
9 namespace Storage
10 {
16 class CustomDevice : public Device
17 {
18 public:
20 
21  Partition createPartition(const String& name, Partition::Type type, uint8_t subtype, uint32_t offset, size_t size,
22  Partition::Flags flags = 0)
23  {
24  return createPartition(Partition::Info{name, type, subtype, offset, size, flags});
25  }
26 
27  template <typename SubType>
28  Partition createPartition(const String& name, SubType subtype, uint32_t offset, size_t size,
29  Partition::Flags flags = 0)
30  {
31  return createPartition(name, Partition::Type(SubType::partitionType), uint8_t(subtype), offset, size, flags);
32  }
33 };
34 
35 } // namespace Storage
Partition createPartition(const String &name, SubType subtype, uint32_t offset, size_t size, Partition::Flags flags=0)
Definition: CustomDevice.h:28
The String class.
Definition: WString.h:136
Class to support dynamic partitions.
Definition: CustomDevice.h:16
Partition createPartition(const Partition::Info &info)
Type
Definition: Partition.h:81
Represents a storage device (e.g. flash memory)
Definition: Components/Storage/src/include/Storage/Device.h:32
Partition createPartition(const String &name, Partition::Type type, uint8_t subtype, uint32_t offset, size_t size, Partition::Flags flags=0)
Definition: CustomDevice.h:21
Represents a flash partition.
Definition: Partition.h:78
Definition: FileDevice.h:23
Partition information.
Definition: Partition.h:132