Skip to content

Conversation

@mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 24, 2022

This PR tidies up how device in-memory partition tables are updated.

The Device partitions() method returns a read-only (const) reference to the device's PartitionTable suitable for general application use.
A new editablePartitions() method has been added which provides a non-const version so the table can be updated.
This removes the need for the CustomDevice class, which has been removed.

For example:

part = device->createPartition("archive", Storage::Partition::SubType::Data::fwfs, startOffset, size);

becomes:

part = device->editablePartitions().add("archive", Storage::Partition::SubType::Data::fwfs, startOffset, size);

@slaff slaff added this to the 4.7.0 milestone Oct 24, 2022
/**
* @brief Provide full access to partition table
*/
PartitionTable& editable_partitions()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the method name to use camelCase

@mikee47 mikee47 force-pushed the feature/editable-partitions branch from f5cdb2b to 4e9eee7 Compare October 24, 2022 19:23
@mikee47 mikee47 changed the title Remove CustomDevice, use editable_partitions() method Remove CustomDevice, use editablePartitions() method Oct 24, 2022
@slaff slaff merged commit 5a2f49a into SmingHub:develop Oct 25, 2022
@mikee47 mikee47 deleted the feature/editable-partitions branch October 25, 2022 10:43
@slaff slaff mentioned this pull request Nov 8, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants