From 2bc7c4e568a78babce8bfd38012c8084b3f2157a Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 20 May 2017 23:00:11 -0700 Subject: [PATCH] Add DiscBase::getPartitionNodeCount --- include/nod/DiscBase.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/nod/DiscBase.hpp b/include/nod/DiscBase.hpp index 1087afc..ed94f2e 100644 --- a/include/nod/DiscBase.hpp +++ b/include/nod/DiscBase.hpp @@ -277,6 +277,8 @@ public: beginApploaderReadStream()->read(buf.get(), m_apploaderSz); return buf; } + + inline size_t getNodeCount() const { return m_nodes.size(); } }; protected: @@ -289,6 +291,13 @@ public: inline const Header& getHeader() const {return m_header;} inline const IDiscIO& getDiscIO() const {return *m_discIO;} + inline size_t getPartitonNodeCount(size_t partition = 0) const + { + if (partition > m_partitions.size()) + return -1; + return m_partitions[partition]->getNodeCount(); + } + inline IPartition* getDataPartition() { for (const std::unique_ptr& part : m_partitions) @@ -308,6 +317,7 @@ public: for (std::unique_ptr& part : m_partitions) part->extractToDirectory(path, ctx); } + }; class DiscBuilderBase