From 148fd20975ae46b00e6e59c774c0b995efdb6cc6 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Tue, 25 Aug 2020 00:03:37 +0200 Subject: [PATCH 01/21] Add operators for stream-like parsing --- src/lib/FileNodeChunkReference.cpp | 7 +++++++ src/lib/FileNodeChunkReference.h | 1 + src/lib/JCID.cpp | 11 +++++++++++ src/lib/JCID.h | 6 ++++++ src/lib/StringInStorageBuffer.cpp | 6 ++++++ src/lib/StringInStorageBuffer.h | 1 + 6 files changed, 32 insertions(+) diff --git a/src/lib/FileNodeChunkReference.cpp b/src/lib/FileNodeChunkReference.cpp index ea92976..d521c7b 100644 --- a/src/lib/FileNodeChunkReference.cpp +++ b/src/lib/FileNodeChunkReference.cpp @@ -102,6 +102,13 @@ uint32_t FileNodeChunkReference::get_size_in_file() return ret; } +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference &obj) +{ + obj.parse(input); + return input; +} + + void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input) { input->seek(m_offset, librevenge::RVNG_SEEK_SET); diff --git a/src/lib/FileNodeChunkReference.h b/src/lib/FileNodeChunkReference.h index de9e531..df3290c 100644 --- a/src/lib/FileNodeChunkReference.h +++ b/src/lib/FileNodeChunkReference.h @@ -44,6 +44,7 @@ class FileNodeChunkReference uint64_t get_location(); uint64_t get_size(); uint32_t get_size_in_file(); + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference &obj); void parse(const libone::RVNGInputStreamPtr_t &input); void set_zero(); enum stp_format get_stp_fmt() diff --git a/src/lib/JCID.cpp b/src/lib/JCID.cpp index d38c74b..266b5a2 100644 --- a/src/lib/JCID.cpp +++ b/src/lib/JCID.cpp @@ -16,6 +16,17 @@ namespace libone { +void JCID::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> value; +} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, JCID &obj) +{ + obj.parse(input); + return input; +} + std::string JCID::to_string() const { diff --git a/src/lib/JCID.h b/src/lib/JCID.h index b479b71..59b6377 100644 --- a/src/lib/JCID.h +++ b/src/lib/JCID.h @@ -14,6 +14,8 @@ #include #include +#include "libone_utils.h" + namespace libone { @@ -24,6 +26,10 @@ class JCID { value = val; } + void parse(const libone::RVNGInputStreamPtr_t &input); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, JCID &obj); + uint32_t get_value() const { return value; diff --git a/src/lib/StringInStorageBuffer.cpp b/src/lib/StringInStorageBuffer.cpp index ef88864..4802c55 100644 --- a/src/lib/StringInStorageBuffer.cpp +++ b/src/lib/StringInStorageBuffer.cpp @@ -18,6 +18,12 @@ namespace libone { +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, StringInStorageBuffer &obj) +{ + obj.parse(input); + return input; +} + void StringInStorageBuffer::parse(const libone::RVNGInputStreamPtr_t &input) { diff --git a/src/lib/StringInStorageBuffer.h b/src/lib/StringInStorageBuffer.h index 90063b4..7606d09 100644 --- a/src/lib/StringInStorageBuffer.h +++ b/src/lib/StringInStorageBuffer.h @@ -23,6 +23,7 @@ namespace libone class StringInStorageBuffer { public: + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, StringInStorageBuffer &obj); void parse(const libone::RVNGInputStreamPtr_t &input); uint32_t length = 0; std::string to_string(); From 4ed1c160043457d342860c13d8f957fbaf323aae Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Mon, 24 Aug 2020 23:52:03 +0200 Subject: [PATCH 02/21] Use shared_ptr for stream passing This commit replaces most occurances of librevenge::RVNGInputStream *input with the shared_ptr specified in libone_util.h, which is typedefed as libone::RVNGInputStreamPtr_t --- src/lib/FileChunkReference.h | 2 +- src/lib/FileDataStore.cpp | 3 +-- src/lib/FileDataStore.h | 2 +- src/lib/FileNodeList.h | 1 + src/lib/ONEDocument.cpp | 8 ++++---- src/lib/ObjectGroup.cpp | 2 +- src/lib/ObjectGroup.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/FileChunkReference.h b/src/lib/FileChunkReference.h index 0fe90f1..af2045d 100644 --- a/src/lib/FileChunkReference.h +++ b/src/lib/FileChunkReference.h @@ -13,6 +13,7 @@ #include #include "libone_utils.h" + namespace libone { @@ -30,7 +31,6 @@ class FileChunkReference FileChunkReference(const enum FileChunkReferenceSize fcr_size); FileChunkReference(const uint64_t stp, const uint64_t cb, const enum FileChunkReferenceSize fcr_size = fcr_size_invalid); - void parse(const libone::RVNGInputStreamPtr_t &input); std::string to_string() const; uint64_t get_location() const; diff --git a/src/lib/FileDataStore.cpp b/src/lib/FileDataStore.cpp index c71e1c7..8cf07f0 100644 --- a/src/lib/FileDataStore.cpp +++ b/src/lib/FileDataStore.cpp @@ -18,8 +18,7 @@ namespace libone { - -void FileDataStore::parse(libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) +void FileDataStore::parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) { FileNodeList list(ref.get_location(), ref.get_size()); FileNode node; diff --git a/src/lib/FileDataStore.h b/src/lib/FileDataStore.h index 9e7440e..515ecc9 100644 --- a/src/lib/FileDataStore.h +++ b/src/lib/FileDataStore.h @@ -21,7 +21,7 @@ class FileDataStore { public: - void parse(libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); + void parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); std::string to_string(); diff --git a/src/lib/FileNodeList.h b/src/lib/FileNodeList.h index 42847dc..1a80a6b 100644 --- a/src/lib/FileNodeList.h +++ b/src/lib/FileNodeList.h @@ -16,6 +16,7 @@ #include "FileNode.h" #include "FileNodeListFragment.h" +#include "libone_utils.h" #include "libone_utils.h" diff --git a/src/lib/ONEDocument.cpp b/src/lib/ONEDocument.cpp index b366b10..94fc9ab 100644 --- a/src/lib/ONEDocument.cpp +++ b/src/lib/ONEDocument.cpp @@ -70,9 +70,10 @@ ONEAPI ONEDocument::Result ONEDocument::parse(librevenge::RVNGInputStream *const ONEAPI ONEDocument::Result ONEDocument::parse(librevenge::RVNGInputStream *const input, librevenge::RVNGDrawingInterface *const document, const ONEDocument::Type type, const char *const) try { - /// \todo parsing the header doesn't seem to do anything here, also needs shared_ptr now -// Header header; -// header.parse(input); + const RVNGInputStreamPtr_t input_(input, ONEDummyDeleter()); + + Header header; + header.parse(input_); (void) document; // sanity check @@ -81,7 +82,6 @@ ONEAPI ONEDocument::Result ONEDocument::parse(librevenge::RVNGInputStream *const if (ONEDocument::TYPE_RESERVED1 <= type) return ONEDocument::RESULT_UNSUPPORTED_FORMAT; - const RVNGInputStreamPtr_t input_(input, ONEDummyDeleter()); OneNoteParser parser = OneNoteParser(input_, document); (void) parser; diff --git a/src/lib/ObjectGroup.cpp b/src/lib/ObjectGroup.cpp index 0a849c3..b03476d 100644 --- a/src/lib/ObjectGroup.cpp +++ b/src/lib/ObjectGroup.cpp @@ -13,7 +13,7 @@ namespace libone { -std::unordered_map ObjectGroup::list_parse(libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) +std::unordered_map ObjectGroup::list_parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) { FileNodeList list(ref.get_location(), ref.get_size()); std::unordered_map object_map = std::unordered_map(); diff --git a/src/lib/ObjectGroup.h b/src/lib/ObjectGroup.h index 0550afd..6b1939f 100644 --- a/src/lib/ObjectGroup.h +++ b/src/lib/ObjectGroup.h @@ -26,7 +26,7 @@ namespace libone class ObjectGroup { public: - std::unordered_map list_parse(libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); + std::unordered_map list_parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); std::string get_guid(); private: From 9cae498431c92212167642e5d794b72f90c56acf Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Wed, 26 Aug 2020 22:55:28 +0200 Subject: [PATCH 03/21] Refactor FileNode: merge parse_header with parse --- src/lib/FileNode.cpp | 83 +++++++++++++++++++++----------------------- src/lib/FileNode.h | 1 - 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 2d1b820..70482cc 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -95,7 +95,46 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) { m_offset = input->tell(); - parse_header(input); + DBMSG << "Will parse at " << m_offset << std::endl; + + uint32_t temp; + enum stp_format format_stp; + enum cb_format format_cb; + int d; + + temp = readU32(input, false); + d = temp >> 31; + format_stp = static_cast((temp >> shift_format_stp) & mask_format_stp); + format_cb = static_cast((temp >> shift_format_cb) & mask_format_cb); + m_base_type = static_cast((temp >> shift_base_type) & mask_fnd_base_type); + m_fnd_id = static_cast(temp & mask_fnd_id); + m_size_in_file = (temp >> shift_fnd_size) & mask_fnd_size; + if (d == 0) + { + std::bitset<13> z(m_size_in_file); + ONE_DEBUG_MSG(("%s\n", z.to_string().c_str())); + ONE_DEBUG_MSG(("warning: d is zero\n")); + } + assert(d == 1); + FileNodeChunkReference reference(format_stp, format_cb, input->tell()); + + std::bitset<32> y(temp); + ONE_DEBUG_MSG((" filenode bits %s\n", y.to_string().c_str())); + switch (m_base_type) + { + case fnd_ref_data: + case fnd_ref_filenodelist: + reference.parse(input); + ONE_DEBUG_MSG(("\n")); + break; + case fnd_no_data: + reference.set_zero(); + break; + default: + assert(false); + break; + } + m_fnd = reference; switch (m_fnd_id) { @@ -211,48 +250,6 @@ std::string FileNode::to_string() return stream.str(); } -void FileNode::parse_header(const libone::RVNGInputStreamPtr_t &input) -{ - uint32_t temp; - enum stp_format format_stp; - enum cb_format format_cb; - int d; - - temp = readU32(input, false); - d = temp >> 31; - format_stp = static_cast((temp >> shift_format_stp) & mask_format_stp); - format_cb = static_cast((temp >> shift_format_cb) & mask_format_cb); - m_base_type = static_cast((temp >> shift_base_type) & mask_fnd_base_type); - m_fnd_id = static_cast(temp & mask_fnd_id); - m_size_in_file = (temp >> shift_fnd_size) & mask_fnd_size; - if (d == 0) - { - std::bitset<13> z(m_size_in_file); - ONE_DEBUG_MSG(("%s\n", z.to_string().c_str())); - ONE_DEBUG_MSG(("warning: d is zero\n")); - } - assert(d == 1); - FileNodeChunkReference reference(format_stp, format_cb, input->tell()); - - std::bitset<32> y(temp); - ONE_DEBUG_MSG((" filenode bits %s\n", y.to_string().c_str())); - switch (m_base_type) - { - case fnd_ref_data: - case fnd_ref_filenodelist: - reference.parse(input); - ONE_DEBUG_MSG(("\n")); - break; - case fnd_no_data: - reference.set_zero(); - break; - default: - assert(false); - break; - } - m_fnd = reference; -} - void FileNode::skip_node(const libone::RVNGInputStreamPtr_t &input) { DBMSG << "Skipping file node by jumping over " << m_size_in_file << " bytes to " << m_offset + m_size_in_file << std::endl; diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index 0b1d87b..8666fcb 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -110,7 +110,6 @@ class FileNode FndId m_fnd_id = FndId::fnd_invalid_id; enum fnd_basetype m_base_type = fnd_invalid_basetype; - void parse_header(const libone::RVNGInputStreamPtr_t &input); FileNodeChunkReference m_fnd = FileNodeChunkReference(stp_invalid, cb_invalid, 0); static const uint32_t mask_fnd_id = 0x3FF; From 4307660c0104b3264154c3f22b5dd2103bd46abc Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 17:35:14 +0200 Subject: [PATCH 04/21] Refactor FileNodeChunkReference: rename location/size to stp/cb and push getters into header --- src/lib/FileDataStore.cpp | 4 ++-- src/lib/FileNode.cpp | 5 +++-- src/lib/FileNodeChunkReference.cpp | 10 ---------- src/lib/FileNodeChunkReference.h | 10 ++++++++-- src/lib/Object.cpp | 4 ++-- src/lib/ObjectGroup.cpp | 2 +- src/lib/ObjectSpace.cpp | 4 ++-- src/lib/Revision.cpp | 6 +++--- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/lib/FileDataStore.cpp b/src/lib/FileDataStore.cpp index 8cf07f0..a0d3dab 100644 --- a/src/lib/FileDataStore.cpp +++ b/src/lib/FileDataStore.cpp @@ -20,9 +20,9 @@ namespace libone { void FileDataStore::parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) { - FileNodeList list(ref.get_location(), ref.get_size()); + FileNodeList list(ref.stp(), ref.cb()); FileNode node; - input->seek(ref.get_location(), librevenge::RVNG_SEEK_SET); + input->seek(ref.stp(), librevenge::RVNG_SEEK_SET); list.parse(input); ONE_DEBUG_MSG(("\n")); diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 70482cc..a79a8b5 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -228,6 +228,7 @@ std::string FileNode::to_string() stream << fnd_id_to_string(m_fnd_id); stream << "; "; + stream << "size " << m_size_in_file << "; "; stream << std::hex << "base_type "; switch (m_base_type) @@ -236,10 +237,10 @@ std::string FileNode::to_string() stream << "fnd_no_data"; break; case fnd_ref_data: - stream << "fnd_ref_data@0x" << m_fnd.get_location(); + stream << "fnd_ref_data@0x" << m_fnd.stp(); break; case fnd_ref_filenodelist: - stream << "fnd_ref_filenodelist@0x" << m_fnd.get_location(); + stream << "fnd_ref_filenodelist@0x" << m_fnd.stp(); break; default: stream << "UNKNOWN BASETYPE"; diff --git a/src/lib/FileNodeChunkReference.cpp b/src/lib/FileNodeChunkReference.cpp index d521c7b..c461165 100644 --- a/src/lib/FileNodeChunkReference.cpp +++ b/src/lib/FileNodeChunkReference.cpp @@ -48,16 +48,6 @@ bool FileNodeChunkReference::is_fcrZero() return ((m_stp == 0) && (m_cb == 0)); } -uint64_t FileNodeChunkReference::get_location() -{ - return m_stp; -} - -uint64_t FileNodeChunkReference::get_size() -{ - return m_cb; -} - uint32_t FileNodeChunkReference::get_size_in_file() { uint32_t ret = 0; diff --git a/src/lib/FileNodeChunkReference.h b/src/lib/FileNodeChunkReference.h index df3290c..872ea57 100644 --- a/src/lib/FileNodeChunkReference.h +++ b/src/lib/FileNodeChunkReference.h @@ -41,8 +41,14 @@ class FileNodeChunkReference FileNodeChunkReference(enum stp_format format_stp, enum cb_format format_cb, long offset); bool is_fcrNil(); bool is_fcrZero(); - uint64_t get_location(); - uint64_t get_size(); + uint64_t stp() const + { + return m_stp; + } + uint64_t cb() const + { + return m_cb; + } uint32_t get_size_in_file(); friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference &obj); void parse(const libone::RVNGInputStreamPtr_t &input); diff --git a/src/lib/Object.cpp b/src/lib/Object.cpp index 7aadc99..1516b32 100644 --- a/src/lib/Object.cpp +++ b/src/lib/Object.cpp @@ -99,13 +99,13 @@ void Object::parse_list(const libone::RVNGInputStreamPtr_t &input, FileNodeChunk ObjectSpaceStreamOfOIDs oids = ObjectSpaceStreamOfOIDs(guid); ObjectSpaceStreamOfOSIDs osids = ObjectSpaceStreamOfOSIDs(); ObjectSpaceStreamOfContextIDs contexts = ObjectSpaceStreamOfContextIDs(); - FileNodeList list(ref.get_location(), ref.get_size()); + FileNodeList list(ref.stp(), ref.cb()); FileNode node; if (jcid.get_value() == 0) return; long old = input->tell(); - input->seek(ref.get_location(), librevenge::RVNG_SEEK_SET); + input->seek(ref.stp(), librevenge::RVNG_SEEK_SET); object_refs = oids.parse(input); if (!oids.get_B()) diff --git a/src/lib/ObjectGroup.cpp b/src/lib/ObjectGroup.cpp index b03476d..d845ab4 100644 --- a/src/lib/ObjectGroup.cpp +++ b/src/lib/ObjectGroup.cpp @@ -15,7 +15,7 @@ namespace libone std::unordered_map ObjectGroup::list_parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) { - FileNodeList list(ref.get_location(), ref.get_size()); + FileNodeList list(ref.stp(), ref.cb()); std::unordered_map object_map = std::unordered_map(); GUID temp = GUID(); DBMSG << "GUID " << temp.to_string(); diff --git a/src/lib/ObjectSpace.cpp b/src/lib/ObjectSpace.cpp index 7976381..b6edb42 100644 --- a/src/lib/ObjectSpace.cpp +++ b/src/lib/ObjectSpace.cpp @@ -22,7 +22,7 @@ void ObjectSpace::parse(const libone::RVNGInputStreamPtr_t &input, FileNode &nod { m_fnd_list_ref = node.get_fnd(); - FileNodeList list = FileNodeList(m_fnd_list_ref.get_location(), m_fnd_list_ref.get_size()); + FileNodeList list = FileNodeList(m_fnd_list_ref.stp(), m_fnd_list_ref.cb()); // We should then be at the 'gosid' field input->seek(node.get_location() + node.header_size + m_fnd_list_ref.get_size_in_file(), @@ -40,7 +40,7 @@ void ObjectSpace::list_parse(const libone::RVNGInputStreamPtr_t &input, Extended Revision rev; FileNode node; FileNode node2; - FileNodeList list = FileNodeList(ref.get_location(), ref.get_size()); + FileNodeList list = FileNodeList(ref.stp(), ref.cb()); ExtendedGUID temp; temp.zero(); diff --git a/src/lib/Revision.cpp b/src/lib/Revision.cpp index d4a4e38..1a3229d 100644 --- a/src/lib/Revision.cpp +++ b/src/lib/Revision.cpp @@ -21,12 +21,12 @@ namespace libone void Revision::list_parse(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref) { - FileNodeList list(ref.get_location(), ref.get_size()); + FileNodeList list(ref.stp(), ref.cb()); FileNode node; // ObjectGroup group; ExtendedGUID temp; // Object object; - input->seek(ref.get_location(), librevenge::RVNG_SEEK_SET); + input->seek(ref.stp(), librevenge::RVNG_SEEK_SET); ONE_DEBUG_MSG(("trying to revision at %lu\n", input->tell())); list.parse(input); @@ -64,7 +64,7 @@ void Revision::parse_dependencies(const libone::RVNGInputStreamPtr_t &input, Fil { ONE_DEBUG_MSG((" for dependencies\n")); old = input->tell(); - input->seek(node.get_fnd().get_location(), librevenge::RVNG_SEEK_SET); + input->seek(node.get_fnd().stp(), librevenge::RVNG_SEEK_SET); } n_8bitoverrides = readU32(input, false); From 5a121db4241b61ebf9d3db6554e09b3f947f4d8d Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 18:43:18 +0200 Subject: [PATCH 05/21] Refactor FileNodeChunkReference enums to enum classes --- src/lib/FileNode.cpp | 8 ++--- src/lib/FileNode.h | 2 +- src/lib/FileNodeChunkReference.cpp | 54 +++++++++++++++--------------- src/lib/FileNodeChunkReference.h | 14 ++++---- src/lib/Object.h | 4 +-- src/lib/ObjectSpace.h | 2 +- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index a79a8b5..4e6685c 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -98,14 +98,14 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) DBMSG << "Will parse at " << m_offset << std::endl; uint32_t temp; - enum stp_format format_stp; - enum cb_format format_cb; + StpFormat format_stp; + CbFormat format_cb; int d; temp = readU32(input, false); d = temp >> 31; - format_stp = static_cast((temp >> shift_format_stp) & mask_format_stp); - format_cb = static_cast((temp >> shift_format_cb) & mask_format_cb); + format_stp = static_cast((temp >> shift_format_stp) & mask_format_stp); + format_cb = static_cast((temp >> shift_format_cb) & mask_format_cb); m_base_type = static_cast((temp >> shift_base_type) & mask_fnd_base_type); m_fnd_id = static_cast(temp & mask_fnd_id); m_size_in_file = (temp >> shift_fnd_size) & mask_fnd_size; diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index 8666fcb..dae575e 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -110,7 +110,7 @@ class FileNode FndId m_fnd_id = FndId::fnd_invalid_id; enum fnd_basetype m_base_type = fnd_invalid_basetype; - FileNodeChunkReference m_fnd = FileNodeChunkReference(stp_invalid, cb_invalid, 0); + FileNodeChunkReference m_fnd = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); static const uint32_t mask_fnd_id = 0x3FF; static const uint32_t mask_fnd_base_type = 0xF; diff --git a/src/lib/FileNodeChunkReference.cpp b/src/lib/FileNodeChunkReference.cpp index c461165..5be870b 100644 --- a/src/lib/FileNodeChunkReference.cpp +++ b/src/lib/FileNodeChunkReference.cpp @@ -15,7 +15,7 @@ namespace libone { -FileNodeChunkReference::FileNodeChunkReference(enum stp_format format_stp, enum cb_format format_cb, long offset) : +FileNodeChunkReference::FileNodeChunkReference(StpFormat format_stp, CbFormat format_cb, long offset) : m_offset(offset), m_stp(0), m_cb(0), @@ -28,14 +28,14 @@ bool FileNodeChunkReference::is_fcrNil() bool cbval = (m_cb == 0); switch (m_format_stp) { - case stp_uncompressed_8: + case StpFormat::stp_uncompressed_8: return (cbval && (m_stp & 0xFFFFFFFFFFFFFFFF)); - case stp_uncompressed_4: - case stp_compressed_4: + case StpFormat::stp_uncompressed_4: + case StpFormat::stp_compressed_4: return (cbval && (m_stp & 0xFFFFFFFF)); - case stp_compressed_2: + case StpFormat::stp_compressed_2: return (cbval && (m_stp & 0xFFFF)); default: @@ -53,17 +53,17 @@ uint32_t FileNodeChunkReference::get_size_in_file() uint32_t ret = 0; switch (m_format_stp) { - case stp_uncompressed_8: + case StpFormat::stp_uncompressed_8: ret += sizeof(uint64_t); break; - case stp_uncompressed_4: - case stp_compressed_4: + case StpFormat::stp_uncompressed_4: + case StpFormat::stp_compressed_4: ret += sizeof(uint32_t); break; - case stp_compressed_2: + case StpFormat::stp_compressed_2: ret += sizeof(uint16_t); break; - case stp_invalid: + case StpFormat::stp_invalid: default: // size would be 0 break; @@ -71,19 +71,19 @@ uint32_t FileNodeChunkReference::get_size_in_file() switch (m_format_cb) { - case cb_uncompressed_8: + case CbFormat::cb_uncompressed_8: ret += sizeof(uint64_t); break; - case cb_uncompressed_4: + case CbFormat::cb_uncompressed_4: ret += sizeof(uint32_t); break; - case cb_compressed_2: + case CbFormat::cb_compressed_2: ret += sizeof(uint16_t); break; - case cb_compressed_1: + case CbFormat::cb_compressed_1: ret += sizeof(uint8_t); break; - case cb_invalid: + case CbFormat::cb_invalid: default: // size would be 0 break; @@ -105,19 +105,19 @@ void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input) switch (m_format_stp) { - case stp_uncompressed_8: + case StpFormat::stp_uncompressed_8: m_stp = readU64(input, false); break; - case stp_uncompressed_4: + case StpFormat::stp_uncompressed_4: m_stp = readU32(input, false); break; - case stp_compressed_2: + case StpFormat::stp_compressed_2: m_stp = readU16(input, false) * 8; break; - case stp_compressed_4: + case StpFormat::stp_compressed_4: m_stp = readU32(input, false) * 8; break; - case stp_invalid: + case StpFormat::stp_invalid: default: assert(false); break; @@ -125,19 +125,19 @@ void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input) switch (m_format_cb) { - case cb_uncompressed_4: + case CbFormat::cb_uncompressed_4: m_cb = readU32(input, false); break; - case cb_uncompressed_8: + case CbFormat::cb_uncompressed_8: m_cb = readU64(input, false); break; - case cb_compressed_1: + case CbFormat::cb_compressed_1: m_cb = readU8(input) * 8; break; - case cb_compressed_2: + case CbFormat::cb_compressed_2: m_cb = readU16(input, false); break; - case cb_invalid: + case CbFormat::cb_invalid: default: assert(false); break; @@ -150,8 +150,8 @@ void FileNodeChunkReference::set_zero() { m_stp = 0; m_cb = 0; - m_format_stp = stp_invalid; - m_format_cb = cb_invalid; + m_format_stp = StpFormat::stp_invalid; + m_format_cb = CbFormat::cb_invalid; } } diff --git a/src/lib/FileNodeChunkReference.h b/src/lib/FileNodeChunkReference.h index 872ea57..8e7a3ae 100644 --- a/src/lib/FileNodeChunkReference.h +++ b/src/lib/FileNodeChunkReference.h @@ -17,7 +17,7 @@ namespace libone { -enum stp_format +enum class StpFormat { stp_uncompressed_8 = 0, stp_uncompressed_4 = 1, @@ -26,7 +26,7 @@ enum stp_format stp_invalid }; -enum cb_format +enum class CbFormat { cb_uncompressed_4 = 0, cb_uncompressed_8 = 1, @@ -38,7 +38,7 @@ enum cb_format class FileNodeChunkReference { public: - FileNodeChunkReference(enum stp_format format_stp, enum cb_format format_cb, long offset); + FileNodeChunkReference(StpFormat format_stp, CbFormat format_cb, long offset); bool is_fcrNil(); bool is_fcrZero(); uint64_t stp() const @@ -53,11 +53,11 @@ class FileNodeChunkReference friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference &obj); void parse(const libone::RVNGInputStreamPtr_t &input); void set_zero(); - enum stp_format get_stp_fmt() + StpFormat get_stp_fmt() { return m_format_stp; } - enum cb_format get_cb_fmt() + CbFormat get_cb_fmt() { return m_format_cb; } @@ -66,8 +66,8 @@ class FileNodeChunkReference uint64_t m_offset; uint64_t m_stp; uint64_t m_cb; - enum stp_format m_format_stp; - enum cb_format m_format_cb; + StpFormat m_format_stp; + CbFormat m_format_cb; }; } diff --git a/src/lib/Object.h b/src/lib/Object.h index 8c65440..718e133 100644 --- a/src/lib/Object.h +++ b/src/lib/Object.h @@ -27,7 +27,7 @@ namespace libone struct object_header { ExtendedGUID guid = ExtendedGUID(); - FileNodeChunkReference body = FileNodeChunkReference(stp_format::stp_invalid, cb_format::cb_invalid, 0); + FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); JCID jcid = JCID(0); uint32_t ref_count = 0; uint16_t fHasOidReferences = 0; @@ -49,7 +49,7 @@ class Object void parse_list(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); private: - FileNodeChunkReference body = FileNodeChunkReference(stp_format::stp_invalid, cb_format::cb_invalid, 0); + FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); PropertySet set = PropertySet(); bool read_only = false; diff --git a/src/lib/ObjectSpace.h b/src/lib/ObjectSpace.h index 29d2c1a..946a7a8 100644 --- a/src/lib/ObjectSpace.h +++ b/src/lib/ObjectSpace.h @@ -35,7 +35,7 @@ class ObjectSpace private: uint64_t m_offset = 0; - FileNodeChunkReference m_fnd_list_ref = FileNodeChunkReference(stp_format::stp_invalid, cb_format::cb_invalid, 0); + FileNodeChunkReference m_fnd_list_ref = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); ExtendedGUID guid = ExtendedGUID(); ExtendedGUID context = ExtendedGUID(); std::vector revisions = std::vector(); From d02c72850d19f8620c007cddf6a55ce066a09d2a Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 18:53:02 +0200 Subject: [PATCH 06/21] Refactor FileNodeChunkReference ctors --- src/lib/FileNode.cpp | 4 ++-- src/lib/FileNode.h | 2 +- src/lib/FileNodeChunkReference.cpp | 24 +++++++++++++++++++++--- src/lib/FileNodeChunkReference.h | 4 +++- src/lib/Object.h | 4 ++-- src/lib/ObjectSpace.h | 2 +- 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 4e6685c..26ce21b 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -116,7 +116,7 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) ONE_DEBUG_MSG(("warning: d is zero\n")); } assert(d == 1); - FileNodeChunkReference reference(format_stp, format_cb, input->tell()); + FileNodeChunkReference reference(format_stp, format_cb); std::bitset<32> y(temp); ONE_DEBUG_MSG((" filenode bits %s\n", y.to_string().c_str())); @@ -124,7 +124,7 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) { case fnd_ref_data: case fnd_ref_filenodelist: - reference.parse(input); + reference.parse(input, input->tell()); ONE_DEBUG_MSG(("\n")); break; case fnd_no_data: diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index dae575e..abae45c 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -110,7 +110,7 @@ class FileNode FndId m_fnd_id = FndId::fnd_invalid_id; enum fnd_basetype m_base_type = fnd_invalid_basetype; - FileNodeChunkReference m_fnd = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); + FileNodeChunkReference m_fnd = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid); static const uint32_t mask_fnd_id = 0x3FF; static const uint32_t mask_fnd_base_type = 0xF; diff --git a/src/lib/FileNodeChunkReference.cpp b/src/lib/FileNodeChunkReference.cpp index 5be870b..61c31d2 100644 --- a/src/lib/FileNodeChunkReference.cpp +++ b/src/lib/FileNodeChunkReference.cpp @@ -15,14 +15,22 @@ namespace libone { -FileNodeChunkReference::FileNodeChunkReference(StpFormat format_stp, CbFormat format_cb, long offset) : - m_offset(offset), +FileNodeChunkReference::FileNodeChunkReference(const StpFormat format_stp, const CbFormat format_cb) : + m_offset(0), m_stp(0), m_cb(0), m_format_stp(format_stp), m_format_cb(format_cb) {} +FileNodeChunkReference::FileNodeChunkReference(const uint64_t stp, const uint64_t cb, const StpFormat format_stp, const CbFormat format_cb) : + m_offset(0), + m_stp(stp), + m_cb(cb), + m_format_stp(format_stp), + m_format_cb(format_cb) +{} + bool FileNodeChunkReference::is_fcrNil() { bool cbval = (m_cb == 0); @@ -99,9 +107,19 @@ const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_ } +void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input, const uint64_t offset) +{ + const uint64_t origLocation = input->tell(); + input->seek(offset, librevenge::RVNG_SEEK_SET); + + parse(input); + + input->seek(origLocation, librevenge::RVNG_SEEK_SET); +} + void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input) { - input->seek(m_offset, librevenge::RVNG_SEEK_SET); + m_offset = input->tell(); switch (m_format_stp) { diff --git a/src/lib/FileNodeChunkReference.h b/src/lib/FileNodeChunkReference.h index 8e7a3ae..48d24de 100644 --- a/src/lib/FileNodeChunkReference.h +++ b/src/lib/FileNodeChunkReference.h @@ -38,7 +38,8 @@ enum class CbFormat class FileNodeChunkReference { public: - FileNodeChunkReference(StpFormat format_stp, CbFormat format_cb, long offset); + FileNodeChunkReference(const StpFormat format_stp = StpFormat::stp_invalid, const CbFormat format_cb = CbFormat::cb_invalid); + FileNodeChunkReference(const uint64_t stp, const uint64_t cb, const StpFormat format_stp = StpFormat::stp_uncompressed_8, const CbFormat format_cb = CbFormat::cb_uncompressed_8); bool is_fcrNil(); bool is_fcrZero(); uint64_t stp() const @@ -52,6 +53,7 @@ class FileNodeChunkReference uint32_t get_size_in_file(); friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference &obj); void parse(const libone::RVNGInputStreamPtr_t &input); + void parse(const libone::RVNGInputStreamPtr_t &input, const uint64_t offset); void set_zero(); StpFormat get_stp_fmt() { diff --git a/src/lib/Object.h b/src/lib/Object.h index 718e133..0cedd6a 100644 --- a/src/lib/Object.h +++ b/src/lib/Object.h @@ -27,7 +27,7 @@ namespace libone struct object_header { ExtendedGUID guid = ExtendedGUID(); - FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); + FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid); JCID jcid = JCID(0); uint32_t ref_count = 0; uint16_t fHasOidReferences = 0; @@ -49,7 +49,7 @@ class Object void parse_list(const libone::RVNGInputStreamPtr_t &input, FileNodeChunkReference ref); private: - FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); + FileNodeChunkReference body = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid); PropertySet set = PropertySet(); bool read_only = false; diff --git a/src/lib/ObjectSpace.h b/src/lib/ObjectSpace.h index 946a7a8..ef1dd63 100644 --- a/src/lib/ObjectSpace.h +++ b/src/lib/ObjectSpace.h @@ -35,7 +35,7 @@ class ObjectSpace private: uint64_t m_offset = 0; - FileNodeChunkReference m_fnd_list_ref = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid, 0); + FileNodeChunkReference m_fnd_list_ref = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid); ExtendedGUID guid = ExtendedGUID(); ExtendedGUID context = ExtendedGUID(); std::vector revisions = std::vector(); From 2cdd6b33ac538aa8808a8e61ca39e87b2ea5026d Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 19:20:54 +0200 Subject: [PATCH 07/21] BugFix FileNodeChunkReference: compressed val was not multiplied --- src/lib/FileNodeChunkReference.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/FileNodeChunkReference.cpp b/src/lib/FileNodeChunkReference.cpp index 61c31d2..05da336 100644 --- a/src/lib/FileNodeChunkReference.cpp +++ b/src/lib/FileNodeChunkReference.cpp @@ -153,7 +153,7 @@ void FileNodeChunkReference::parse(const libone::RVNGInputStreamPtr_t &input) m_cb = readU8(input) * 8; break; case CbFormat::cb_compressed_2: - m_cb = readU16(input, false); + m_cb = readU16(input, false) * 8; break; case CbFormat::cb_invalid: default: From 8a577edcffa31c1935af15534c412d90a66d0097 Mon Sep 17 00:00:00 2001 From: Oskar Viljasaar Date: Sun, 23 Aug 2020 02:20:05 +0300 Subject: [PATCH 08/21] Add FileNodeData Interface and dummy headers --- .../DataSignatureGroupDefinitionFND.h | 0 .../FileDataStoreListReferenceFND.h | 0 .../FileDataStoreObjectReferenceFND.h | 0 src/lib/FileNodeData/FileNodeData.h | 43 +++++++++++++++++++ .../FileNodeData/GlobalIdTableEntry2FNDX.h | 0 .../FileNodeData/GlobalIdTableEntry3FNDX.h | 0 src/lib/FileNodeData/GlobalIdTableEntryFNDX.h | 0 src/lib/FileNodeData/GlobalIdTableStartFNDX.h | 0 .../FileNodeData/HashedChunkDescriptor2FND.h | 0 src/lib/FileNodeData/IFileNodeData.cpp | 23 ++++++++++ src/lib/FileNodeData/IFileNodeData.h | 32 ++++++++++++++ .../ObjectDataEncryptionKeyV2FNDX.h | 0 .../ObjectDeclaration2LargeRefCountFND.h | 0 .../ObjectDeclaration2RefCountFND.h | 0 ...jectDeclarationFileData3LargeRefCountFND.h | 0 .../ObjectDeclarationFileData3RefCountFND.h | 0 .../ObjectDeclarationWithRefCount2FNDX.h | 0 .../ObjectDeclarationWithRefCountFNDX.h | 0 .../ObjectGroupListReferenceFND.h | 0 src/lib/FileNodeData/ObjectGroupStartFND.h | 0 .../ObjectInfoDependencyOverridesFND.h | 0 .../ObjectRevisionWithRefCount2FNDX.h | 0 .../ObjectRevisionWithRefCountFNDX.h | 0 .../ObjectSpaceManifestListReferenceFND.h | 0 .../ObjectSpaceManifestListStartFND.h | 0 .../FileNodeData/ObjectSpaceManifestRootFND.h | 0 ...adOnlyObjectDeclaration2LargeRefCountFND.h | 0 .../ReadOnlyObjectDeclaration2RefCountFND.h | 0 .../RevisionManifestListReferenceFND.h | 0 .../RevisionManifestListStartFND.h | 0 .../FileNodeData/RevisionManifestStart4FND.h | 0 .../FileNodeData/RevisionManifestStart6FND.h | 0 .../FileNodeData/RevisionManifestStart7FND.h | 0 .../RevisionRoleAndContextDeclarationFND.h | 0 .../FileNodeData/RevisionRoleDeclarationFND.h | 0 .../FileNodeData/RootObjectReference2FNDX.h | 0 .../FileNodeData/RootObjectReference3FND.h | 0 src/lib/FileNodeData/meson.build | 4 ++ src/lib/meson.build | 3 ++ 39 files changed, 105 insertions(+) create mode 100644 src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h create mode 100644 src/lib/FileNodeData/FileDataStoreListReferenceFND.h create mode 100644 src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h create mode 100644 src/lib/FileNodeData/FileNodeData.h create mode 100644 src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h create mode 100644 src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h create mode 100644 src/lib/FileNodeData/GlobalIdTableEntryFNDX.h create mode 100644 src/lib/FileNodeData/GlobalIdTableStartFNDX.h create mode 100644 src/lib/FileNodeData/HashedChunkDescriptor2FND.h create mode 100644 src/lib/FileNodeData/IFileNodeData.cpp create mode 100644 src/lib/FileNodeData/IFileNodeData.h create mode 100644 src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h create mode 100644 src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h create mode 100644 src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h create mode 100644 src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h create mode 100644 src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h create mode 100644 src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h create mode 100644 src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h create mode 100644 src/lib/FileNodeData/ObjectGroupListReferenceFND.h create mode 100644 src/lib/FileNodeData/ObjectGroupStartFND.h create mode 100644 src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h create mode 100644 src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h create mode 100644 src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestRootFND.h create mode 100644 src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h create mode 100644 src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h create mode 100644 src/lib/FileNodeData/RevisionManifestListReferenceFND.h create mode 100644 src/lib/FileNodeData/RevisionManifestListStartFND.h create mode 100644 src/lib/FileNodeData/RevisionManifestStart4FND.h create mode 100644 src/lib/FileNodeData/RevisionManifestStart6FND.h create mode 100644 src/lib/FileNodeData/RevisionManifestStart7FND.h create mode 100644 src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h create mode 100644 src/lib/FileNodeData/RevisionRoleDeclarationFND.h create mode 100644 src/lib/FileNodeData/RootObjectReference2FNDX.h create mode 100644 src/lib/FileNodeData/RootObjectReference3FND.h create mode 100644 src/lib/FileNodeData/meson.build diff --git a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/FileDataStoreListReferenceFND.h b/src/lib/FileNodeData/FileDataStoreListReferenceFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/FileNodeData.h b/src/lib/FileNodeData/FileNodeData.h new file mode 100644 index 0000000..2cd1471 --- /dev/null +++ b/src/lib/FileNodeData/FileNodeData.h @@ -0,0 +1,43 @@ +#ifndef FILENODEDATA_H +#define FILENODEDATA_H + + +#include "IFileNodeData.h" + +#include "DataSignatureGroupDefinitionFND.h" +#include "FileDataStoreListReferenceFND.h" +#include "FileDataStoreObjectReferenceFND.h" +#include "GlobalIdTableEntry2FNDX.h" +#include "GlobalIdTableEntry3FNDX.h" +#include "GlobalIdTableEntryFNDX.h" +#include "GlobalIdTableStartFNDX.h" +#include "HashedChunkDescriptor2FND.h" +#include "ObjectDataEncryptionKeyV2FNDX.h" +#include "ObjectDeclaration2LargeRefCountFND.h" +#include "ObjectDeclaration2RefCountFND.h" +#include "ObjectDeclarationFileData3LargeRefCountFND.h" +#include "ObjectDeclarationFileData3RefCountFND.h" +#include "ObjectDeclarationWithRefCount2FNDX.h" +#include "ObjectDeclarationWithRefCountFNDX.h" +#include "ObjectGroupListReferenceFND.h" +#include "ObjectGroupStartFND.h" +#include "ObjectInfoDependencyOverridesFND.h" +#include "ObjectRevisionWithRefCount2FNDX.h" +#include "ObjectRevisionWithRefCountFNDX.h" +#include "ObjectSpaceManifestListReferenceFND.h" +#include "ObjectSpaceManifestListStartFND.h" +#include "ObjectSpaceManifestRootFND.h" +#include "ReadOnlyObjectDeclaration2LargeRefCountFND.h" +#include "ReadOnlyObjectDeclaration2RefCountFND.h" +#include "RevisionManifestListReferenceFND.h" +#include "RevisionManifestListStartFND.h" +#include "RevisionManifestStart4FND.h" +#include "RevisionManifestStart6FND.h" +#include "RevisionManifestStart7FND.h" +#include "RevisionRoleAndContextDeclarationFND.h" +#include "RevisionRoleDeclarationFND.h" +#include "RootObjectReference2FNDX.h" +#include "RootObjectReference3FND.h" + + +#endif // FILENODEDATA_H diff --git a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/GlobalIdTableStartFNDX.h b/src/lib/FileNodeData/GlobalIdTableStartFNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/HashedChunkDescriptor2FND.h b/src/lib/FileNodeData/HashedChunkDescriptor2FND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/IFileNodeData.cpp b/src/lib/FileNodeData/IFileNodeData.cpp new file mode 100644 index 0000000..7bda5fc --- /dev/null +++ b/src/lib/FileNodeData/IFileNodeData.cpp @@ -0,0 +1,23 @@ +#include "IFileNodeData.h" + +namespace libone +{ +IFileNodeData::IFileNodeData() {} + +IFileNodeData::~IFileNodeData() {} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, IFileNodeData &obj) +{ + obj.parse(input); + return input; +} + +std::stringstream &operator<<(std::stringstream &input, IFileNodeData &obj) +{ + input << obj.to_string(); + return input; +} + +} // namespace libone + +/* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/FileNodeData/IFileNodeData.h b/src/lib/FileNodeData/IFileNodeData.h new file mode 100644 index 0000000..c2e4985 --- /dev/null +++ b/src/lib/FileNodeData/IFileNodeData.h @@ -0,0 +1,32 @@ +#ifndef IFILENODEDATA_H +#define IFILENODEDATA_H + +#include +#include + +#include "../libone_utils.h" + +namespace libone +{ +class IFileNodeData +{ +protected: + IFileNodeData(); + +public: + virtual ~IFileNodeData(); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, IFileNodeData &obj); + friend std::stringstream &operator<<(std::stringstream &input, IFileNodeData &obj); + + virtual void parse(const libone::RVNGInputStreamPtr_t &input) = 0; + + virtual std::string to_string() const = 0; + +}; + +} // namespace libone + +#endif // IFILENODEDATA_H + +/* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectGroupListReferenceFND.h b/src/lib/FileNodeData/ObjectGroupListReferenceFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectGroupStartFND.h b/src/lib/FileNodeData/ObjectGroupStartFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionManifestListReferenceFND.h b/src/lib/FileNodeData/RevisionManifestListReferenceFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionManifestListStartFND.h b/src/lib/FileNodeData/RevisionManifestListStartFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionManifestStart4FND.h b/src/lib/FileNodeData/RevisionManifestStart4FND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionManifestStart6FND.h b/src/lib/FileNodeData/RevisionManifestStart6FND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionManifestStart7FND.h b/src/lib/FileNodeData/RevisionManifestStart7FND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RevisionRoleDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleDeclarationFND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RootObjectReference2FNDX.h b/src/lib/FileNodeData/RootObjectReference2FNDX.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/RootObjectReference3FND.h b/src/lib/FileNodeData/RootObjectReference3FND.h new file mode 100644 index 0000000..e69de29 diff --git a/src/lib/FileNodeData/meson.build b/src/lib/FileNodeData/meson.build new file mode 100644 index 0000000..ec3f35c --- /dev/null +++ b/src/lib/FileNodeData/meson.build @@ -0,0 +1,4 @@ +libone_source_files += files( + 'IFileNodeData.h', + 'IFileNodeData.cpp', +) diff --git a/src/lib/meson.build b/src/lib/meson.build index fe68e57..b12b993 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -55,6 +55,8 @@ libone_source_files = [ 'libone_utils.h' ] +subdir('FileNodeData') + libone_source_dependencies = [ librevenge_dep, librevenge_stream_dep, @@ -75,4 +77,5 @@ libone_target = library( include_directories : libone_include_directory, ) + ## vim:set shiftwidth=4 tabstop=4 noexpandtab: From 4d4b212a7d55c493ca7c9929fc176bb18abb6a3b Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 19:05:36 +0200 Subject: [PATCH 09/21] Refactor FileNode: reserve label fnd for IFileNodeData class --- src/lib/FileNode.cpp | 19 ++++++++++++++++--- src/lib/FileNode.h | 16 ++++++++++++++-- src/lib/ObjectSpace.cpp | 4 ++-- src/lib/Revision.cpp | 6 +++--- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 26ce21b..e83cc67 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -19,10 +19,16 @@ #include #include "FileNode.h" +#include "FileNodeData/FileNodeData.h" namespace libone { +FileNode::~FileNode() +{ + delete m_fnd; +} + std::string fnd_id_to_string(FndId id_fnd) { std::stringstream stream; @@ -134,7 +140,7 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) assert(false); break; } - m_fnd = reference; + m_fncr = reference; switch (m_fnd_id) { @@ -218,8 +224,15 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) case FndId::fnd_invalid_id: default: assert(false); + m_fnd = nullptr; break; } + + if (m_fnd != nullptr) + { + input >> *m_fnd; + } + } std::string FileNode::to_string() @@ -237,10 +250,10 @@ std::string FileNode::to_string() stream << "fnd_no_data"; break; case fnd_ref_data: - stream << "fnd_ref_data@0x" << m_fnd.stp(); + stream << "fnd_ref_data@0x" << m_fncr.stp(); break; case fnd_ref_filenodelist: - stream << "fnd_ref_filenodelist@0x" << m_fnd.stp(); + stream << "fnd_ref_filenodelist@0x" << m_fncr.stp(); break; default: stream << "UNKNOWN BASETYPE"; diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index abae45c..af6fd1f 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -10,9 +10,12 @@ #ifndef INCLUDED_LIBONE_FILENODE_H #define INCLUDED_LIBONE_FILENODE_H + +#include "FileNodeData/FileNodeData.h" #include "FileNodeChunkReference.h" #include + #include "libone_utils.h" @@ -76,6 +79,8 @@ std::string fnd_id_to_string(FndId id_fnd); class FileNode { public: + + ~FileNode(); void parse(const libone::RVNGInputStreamPtr_t &input); std::string to_string(); @@ -93,10 +98,16 @@ class FileNode { return m_base_type; } - FileNodeChunkReference get_fnd() + + IFileNodeData *get_fnd() { return m_fnd; } + + FileNodeChunkReference fncr() const + { + return m_fncr; + } uint32_t get_location() { return m_offset; @@ -108,9 +119,10 @@ class FileNode uint32_t m_size_in_file = 0; uint32_t m_header_size = 0; + FileNodeChunkReference m_fncr = FileNodeChunkReference(); FndId m_fnd_id = FndId::fnd_invalid_id; enum fnd_basetype m_base_type = fnd_invalid_basetype; - FileNodeChunkReference m_fnd = FileNodeChunkReference(StpFormat::stp_invalid, CbFormat::cb_invalid); + IFileNodeData *m_fnd = nullptr; static const uint32_t mask_fnd_id = 0x3FF; static const uint32_t mask_fnd_base_type = 0xF; diff --git a/src/lib/ObjectSpace.cpp b/src/lib/ObjectSpace.cpp index b6edb42..2616a8d 100644 --- a/src/lib/ObjectSpace.cpp +++ b/src/lib/ObjectSpace.cpp @@ -20,7 +20,7 @@ ObjectSpace::ObjectSpace() void ObjectSpace::parse(const libone::RVNGInputStreamPtr_t &input, FileNode &node) { - m_fnd_list_ref = node.get_fnd(); + m_fnd_list_ref = node.fncr(); FileNodeList list = FileNodeList(m_fnd_list_ref.stp(), m_fnd_list_ref.cb()); @@ -49,7 +49,7 @@ void ObjectSpace::list_parse(const libone::RVNGInputStreamPtr_t &input, Extended list.parse(input); ONE_DEBUG_MSG(("trying to parse last revision\n")); - rev.list_parse(input, node2.get_fnd()); + rev.list_parse(input, node2.fncr()); revisions.push_back(rev); ONE_DEBUG_MSG(("\n")); } diff --git a/src/lib/Revision.cpp b/src/lib/Revision.cpp index 1a3229d..e7a0b1f 100644 --- a/src/lib/Revision.cpp +++ b/src/lib/Revision.cpp @@ -60,11 +60,11 @@ void Revision::parse_dependencies(const libone::RVNGInputStreamPtr_t &input, Fil (void) n_8bitoverrides; (void) n_32bitoverrides; - if (!node.get_fnd().is_fcrNil()) + if (!node.fncr().is_fcrNil()) { ONE_DEBUG_MSG((" for dependencies\n")); old = input->tell(); - input->seek(node.get_fnd().stp(), librevenge::RVNG_SEEK_SET); + input->seek(node.fncr().stp(), librevenge::RVNG_SEEK_SET); } n_8bitoverrides = readU32(input, false); @@ -82,7 +82,7 @@ void Revision::parse_dependencies(const libone::RVNGInputStreamPtr_t &input, Fil ONE_DEBUG_MSG(("\n")); } */ - if (!node.get_fnd().is_fcrNil()) + if (!node.fncr().is_fcrNil()) input->seek(old, librevenge::RVNG_SEEK_SET); } From f50274621d4dae49d02dee57599ad0f3d2197d23 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:45:05 +0200 Subject: [PATCH 10/21] Bugfix ObjectSpace: read correct ref from FileNodeData not FileNode while refactoring FileNode, the wrong FileChunkReference has been inserted. That wrong FCR references the FileNode, not the Chunk. Now the respective FileNodeData is casted to get the correct Ref. --- src/lib/ObjectSpace.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ObjectSpace.cpp b/src/lib/ObjectSpace.cpp index 2616a8d..99746c6 100644 --- a/src/lib/ObjectSpace.cpp +++ b/src/lib/ObjectSpace.cpp @@ -10,6 +10,7 @@ #include "libone_utils.h" #include "ObjectSpace.h" +#include "FileNodeData/FileNodeData.h" namespace libone { @@ -20,7 +21,7 @@ ObjectSpace::ObjectSpace() void ObjectSpace::parse(const libone::RVNGInputStreamPtr_t &input, FileNode &node) { - m_fnd_list_ref = node.fncr(); + m_fnd_list_ref = static_cast(node.get_fnd())->getRef(); FileNodeList list = FileNodeList(m_fnd_list_ref.stp(), m_fnd_list_ref.cb()); From 2c5f7127a613605d03a0b097bc50a666a37cd57b Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Tue, 25 Aug 2020 00:51:41 +0200 Subject: [PATCH 11/21] Adding FileNodeData classes --- src/lib/FileNode.cpp | 41 ++++++++- .../DataSignatureGroupDefinitionFND.cpp | 31 +++++++ .../DataSignatureGroupDefinitionFND.h | 28 ++++++ .../FileDataStoreListReferenceFND.cpp | 33 +++++++ .../FileDataStoreListReferenceFND.h | 29 +++++++ .../FileDataStoreObjectReferenceFND.cpp | 44 ++++++++++ .../FileDataStoreObjectReferenceFND.h | 35 ++++++++ .../FileNodeData/GlobalIdTableEntry2FNDX.cpp | 42 +++++++++ .../FileNodeData/GlobalIdTableEntry2FNDX.h | 34 ++++++++ .../FileNodeData/GlobalIdTableEntry3FNDX.cpp | 52 ++++++++++++ .../FileNodeData/GlobalIdTableEntry3FNDX.h | 36 ++++++++ .../FileNodeData/GlobalIdTableEntryFNDX.cpp | 39 +++++++++ src/lib/FileNodeData/GlobalIdTableEntryFNDX.h | 32 +++++++ .../FileNodeData/GlobalIdTableStartFNDX.cpp | 28 ++++++ src/lib/FileNodeData/GlobalIdTableStartFNDX.h | 26 ++++++ .../HashedChunkDescriptor2FND.cpp | 52 ++++++++++++ .../FileNodeData/HashedChunkDescriptor2FND.h | 38 +++++++++ .../ObjectDataEncryptionKeyV2FNDX.cpp | 85 +++++++++++++++++++ .../ObjectDataEncryptionKeyV2FNDX.h | 39 +++++++++ .../ObjectDeclaration2LargeRefCountFND.cpp | 56 ++++++++++++ .../ObjectDeclaration2LargeRefCountFND.h | 42 +++++++++ .../ObjectDeclaration2RefCountFND.cpp | 54 ++++++++++++ .../ObjectDeclaration2RefCountFND.h | 40 +++++++++ ...ctDeclarationFileData3LargeRefCountFND.cpp | 78 +++++++++++++++++ ...jectDeclarationFileData3LargeRefCountFND.h | 46 ++++++++++ .../ObjectDeclarationFileData3RefCountFND.cpp | 73 ++++++++++++++++ .../ObjectDeclarationFileData3RefCountFND.h | 48 +++++++++++ .../ObjectDeclarationWithRefCount2FNDX.cpp | 58 +++++++++++++ .../ObjectDeclarationWithRefCount2FNDX.h | 44 ++++++++++ .../ObjectDeclarationWithRefCountFNDX.cpp | 57 +++++++++++++ .../ObjectDeclarationWithRefCountFNDX.h | 44 ++++++++++ .../ObjectGroupListReferenceFND.cpp | 42 +++++++++ .../ObjectGroupListReferenceFND.h | 36 ++++++++ src/lib/FileNodeData/ObjectGroupStartFND.cpp | 31 +++++++ src/lib/FileNodeData/ObjectGroupStartFND.h | 27 ++++++ .../ObjectInfoDependencyOverridesFND.cpp | 56 ++++++++++++ .../ObjectInfoDependencyOverridesFND.h | 35 ++++++++ .../ObjectRevisionWithRefCount2FNDX.cpp | 81 ++++++++++++++++++ .../ObjectRevisionWithRefCount2FNDX.h | 50 +++++++++++ .../ObjectRevisionWithRefCountFNDX.cpp | 79 +++++++++++++++++ .../ObjectRevisionWithRefCountFNDX.h | 46 ++++++++++ .../ObjectSpaceManifestListReferenceFND.cpp | 43 ++++++++++ .../ObjectSpaceManifestListReferenceFND.h | 37 ++++++++ .../ObjectSpaceManifestListStartFND.cpp | 27 ++++++ .../ObjectSpaceManifestListStartFND.h | 28 ++++++ .../ObjectSpaceManifestRootFND.cpp | 30 +++++++ .../FileNodeData/ObjectSpaceManifestRootFND.h | 30 +++++++ ...OnlyObjectDeclaration2LargeRefCountFND.cpp | 67 +++++++++++++++ ...adOnlyObjectDeclaration2LargeRefCountFND.h | 48 +++++++++++ .../ReadOnlyObjectDeclaration2RefCountFND.cpp | 67 +++++++++++++++ .../ReadOnlyObjectDeclaration2RefCountFND.h | 44 ++++++++++ .../RevisionManifestListReferenceFND.cpp | 32 +++++++ .../RevisionManifestListReferenceFND.h | 31 +++++++ .../RevisionManifestListStartFND.cpp | 39 +++++++++ .../RevisionManifestListStartFND.h | 34 ++++++++ .../RevisionManifestStart4FND.cpp | 73 ++++++++++++++++ .../FileNodeData/RevisionManifestStart4FND.h | 47 ++++++++++ .../RevisionManifestStart6FND.cpp | 61 +++++++++++++ .../FileNodeData/RevisionManifestStart6FND.h | 41 +++++++++ .../RevisionManifestStart7FND.cpp | 39 +++++++++ .../FileNodeData/RevisionManifestStart7FND.h | 34 ++++++++ .../RevisionRoleAndContextDeclarationFND.cpp | 42 +++++++++ .../RevisionRoleAndContextDeclarationFND.h | 34 ++++++++ .../RevisionRoleDeclarationFND.cpp | 38 +++++++++ .../FileNodeData/RevisionRoleDeclarationFND.h | 32 +++++++ .../FileNodeData/RootObjectReference2FNDX.cpp | 40 +++++++++ .../FileNodeData/RootObjectReference2FNDX.h | 32 +++++++ .../FileNodeData/RootObjectReference3FND.cpp | 38 +++++++++ .../FileNodeData/RootObjectReference3FND.h | 32 +++++++ src/lib/FileNodeData/meson.build | 68 +++++++++++++++ 70 files changed, 3074 insertions(+), 1 deletion(-) create mode 100644 src/lib/FileNodeData/DataSignatureGroupDefinitionFND.cpp create mode 100644 src/lib/FileNodeData/FileDataStoreListReferenceFND.cpp create mode 100644 src/lib/FileNodeData/FileDataStoreObjectReferenceFND.cpp create mode 100644 src/lib/FileNodeData/GlobalIdTableEntry2FNDX.cpp create mode 100644 src/lib/FileNodeData/GlobalIdTableEntry3FNDX.cpp create mode 100644 src/lib/FileNodeData/GlobalIdTableEntryFNDX.cpp create mode 100644 src/lib/FileNodeData/GlobalIdTableStartFNDX.cpp create mode 100644 src/lib/FileNodeData/HashedChunkDescriptor2FND.cpp create mode 100644 src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclaration2RefCountFND.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.cpp create mode 100644 src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.cpp create mode 100644 src/lib/FileNodeData/ObjectGroupListReferenceFND.cpp create mode 100644 src/lib/FileNodeData/ObjectGroupStartFND.cpp create mode 100644 src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.cpp create mode 100644 src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.cpp create mode 100644 src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.cpp create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.cpp create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestListStartFND.cpp create mode 100644 src/lib/FileNodeData/ObjectSpaceManifestRootFND.cpp create mode 100644 src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.cpp create mode 100644 src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.cpp create mode 100644 src/lib/FileNodeData/RevisionManifestListReferenceFND.cpp create mode 100644 src/lib/FileNodeData/RevisionManifestListStartFND.cpp create mode 100644 src/lib/FileNodeData/RevisionManifestStart4FND.cpp create mode 100644 src/lib/FileNodeData/RevisionManifestStart6FND.cpp create mode 100644 src/lib/FileNodeData/RevisionManifestStart7FND.cpp create mode 100644 src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.cpp create mode 100644 src/lib/FileNodeData/RevisionRoleDeclarationFND.cpp create mode 100644 src/lib/FileNodeData/RootObjectReference2FNDX.cpp create mode 100644 src/lib/FileNodeData/RootObjectReference3FND.cpp diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index e83cc67..dfd4dc9 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -144,74 +144,113 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) switch (m_fnd_id) { - break; case FndId::DataSignatureGroupDefinitionFND: + m_fnd = new DataSignatureGroupDefinitionFND(); break; case FndId::FileDataStoreListReferenceFND: + m_fnd = new FileDataStoreListReferenceFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::FileDataStoreObjectReferenceFND: + m_fnd = new FileDataStoreObjectReferenceFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::GlobalIdTableEntry2FNDX: + m_fnd = new GlobalIdTableEntry2FNDX(); break; case FndId::GlobalIdTableEntry3FNDX: + m_fnd = new GlobalIdTableEntry3FNDX(); break; case FndId::GlobalIdTableEntryFNDX: + m_fnd = new GlobalIdTableEntryFNDX(); break; case FndId::GlobalIdTableStartFNDX: + m_fnd = new GlobalIdTableStartFNDX(); break; case FndId::HashedChunkDescriptor2FND: + m_fnd = new HashedChunkDescriptor2FND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectDataEncryptionKeyV2FNDX: + m_fnd = new ObjectDataEncryptionKeyV2FNDX(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectDeclaration2LargeRefCountFND: + m_fnd = + new ObjectDeclaration2LargeRefCountFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectDeclaration2RefCountFND: + m_fnd = new ObjectDeclaration2RefCountFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectDeclarationFileData3LargeRefCountFND: + m_fnd = new ObjectDeclarationFileData3LargeRefCountFND(); break; case FndId::ObjectDeclarationFileData3RefCountFND: + m_fnd = new ObjectDeclarationFileData3RefCountFND(); break; case FndId::ObjectDeclarationWithRefCount2FNDX: + m_fnd = + new ObjectDeclarationWithRefCount2FNDX(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectDeclarationWithRefCountFNDX: + m_fnd = + new ObjectDeclarationWithRefCountFNDX(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectGroupListReferenceFND: + m_fnd = new ObjectGroupListReferenceFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectGroupStartFND: + m_fnd = new ObjectGroupStartFND(); break; case FndId::ObjectInfoDependencyOverridesFND: + m_fnd = new ObjectInfoDependencyOverridesFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectRevisionWithRefCount2FNDX: + m_fnd = new ObjectRevisionWithRefCount2FNDX(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectRevisionWithRefCountFNDX: + m_fnd = new ObjectRevisionWithRefCountFNDX(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectSpaceManifestListReferenceFND: + m_fnd = + new ObjectSpaceManifestListReferenceFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::ObjectSpaceManifestListStartFND: + m_fnd = new ObjectSpaceManifestListStartFND(); break; case FndId::ObjectSpaceManifestRootFND: + m_fnd = new ObjectSpaceManifestRootFND(); break; case FndId::ReadOnlyObjectDeclaration2LargeRefCountFND: + m_fnd = new ReadOnlyObjectDeclaration2LargeRefCountFND(m_fncr.get_stp_fmt(), + m_fncr.get_cb_fmt()); break; case FndId::ReadOnlyObjectDeclaration2RefCountFND: + m_fnd = + new ReadOnlyObjectDeclaration2RefCountFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::RevisionManifestListReferenceFND: + m_fnd = new RevisionManifestListReferenceFND(m_fncr.get_stp_fmt(), m_fncr.get_cb_fmt()); break; case FndId::RevisionManifestListStartFND: + m_fnd = new RevisionManifestListStartFND(); break; case FndId::RevisionManifestStart4FND: + m_fnd = new RevisionManifestStart4FND(); break; case FndId::RevisionManifestStart6FND: + m_fnd = new RevisionManifestStart6FND(); break; case FndId::RevisionManifestStart7FND: + m_fnd = new RevisionManifestStart7FND(); break; case FndId::RevisionRoleAndContextDeclarationFND: + m_fnd = new RevisionRoleAndContextDeclarationFND(); break; case FndId::RevisionRoleDeclarationFND: + m_fnd = new RevisionRoleDeclarationFND(); break; case FndId::RootObjectReference2FNDX: + m_fnd = new RootObjectReference2FNDX(); break; case FndId::RootObjectReference3FND: + m_fnd = new RootObjectReference3FND(); break; // nodes without data diff --git a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.cpp b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.cpp new file mode 100644 index 0000000..c8c1e23 --- /dev/null +++ b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.cpp @@ -0,0 +1,31 @@ +#include "DataSignatureGroupDefinitionFND.h" + +namespace libone +{ + +DataSignatureGroupDefinitionFND::DataSignatureGroupDefinitionFND() + : m_dataSignatureGroup() +{} + +ExtendedGUID DataSignatureGroupDefinitionFND::dataSignatureGroup() const +{ + return m_dataSignatureGroup; +} + +void DataSignatureGroupDefinitionFND::setDataSignatureGroup(const ExtendedGUID &DataSignatureGroup) +{ + m_dataSignatureGroup = DataSignatureGroup; +} + + +void DataSignatureGroupDefinitionFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_dataSignatureGroup; +} + +std::string DataSignatureGroupDefinitionFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h index e69de29..8cd985d 100644 --- a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h +++ b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h @@ -0,0 +1,28 @@ +#ifndef DATASIGNATUREGROUPDEFINITIONFND_H +#define DATASIGNATUREGROUPDEFINITIONFND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class DataSignatureGroupDefinitionFND : public IFileNodeData +{ +private: + ExtendedGUID m_dataSignatureGroup; +public: + DataSignatureGroupDefinitionFND(); + + ExtendedGUID dataSignatureGroup() const; + void setDataSignatureGroup(const ExtendedGUID &DataSignatureGroup); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // DATASIGNATUREGROUPDEFINITIONFND_H diff --git a/src/lib/FileNodeData/FileDataStoreListReferenceFND.cpp b/src/lib/FileNodeData/FileDataStoreListReferenceFND.cpp new file mode 100644 index 0000000..d45e1af --- /dev/null +++ b/src/lib/FileNodeData/FileDataStoreListReferenceFND.cpp @@ -0,0 +1,33 @@ +#include "FileDataStoreListReferenceFND.h" + +namespace libone +{ + +FileDataStoreListReferenceFND::FileDataStoreListReferenceFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat) {} + +FileDataStoreListReferenceFND::~FileDataStoreListReferenceFND() {} + +FileNodeChunkReference FileDataStoreListReferenceFND::getRef() const +{ + return m_ref; +} + +void FileDataStoreListReferenceFND::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void FileDataStoreListReferenceFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; +} + +std::string FileDataStoreListReferenceFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/FileDataStoreListReferenceFND.h b/src/lib/FileNodeData/FileDataStoreListReferenceFND.h index e69de29..a8a0b1d 100644 --- a/src/lib/FileNodeData/FileDataStoreListReferenceFND.h +++ b/src/lib/FileNodeData/FileDataStoreListReferenceFND.h @@ -0,0 +1,29 @@ +#ifndef FILEDATASTORELISTREFERENCEFND_H +#define FILEDATASTORELISTREFERENCEFND_H + +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" +namespace libone +{ + +class FileDataStoreListReferenceFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + +public: + FileDataStoreListReferenceFND(StpFormat stpFormat, CbFormat cbFormat); + ~FileDataStoreListReferenceFND(); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // FILEDATASTORELISTREFERENCEFND_H diff --git a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.cpp b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.cpp new file mode 100644 index 0000000..c79afa8 --- /dev/null +++ b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.cpp @@ -0,0 +1,44 @@ +#include "FileDataStoreObjectReferenceFND.h" + +namespace libone +{ + +FileDataStoreObjectReferenceFND::FileDataStoreObjectReferenceFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat) {} + +FileDataStoreObjectReferenceFND::~FileDataStoreObjectReferenceFND() {} + +FileNodeChunkReference FileDataStoreObjectReferenceFND::getRef() const +{ + return m_ref; +} + +void FileDataStoreObjectReferenceFND::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +libone::GUID FileDataStoreObjectReferenceFND::getGuidReference() const +{ + return m_guidReference; +} + +void FileDataStoreObjectReferenceFND::setGuidReference(const GUID &value) +{ + m_guidReference = value; +} + +void FileDataStoreObjectReferenceFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + input >> m_guidReference; +} + +std::string FileDataStoreObjectReferenceFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h index e69de29..b011823 100644 --- a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h +++ b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h @@ -0,0 +1,35 @@ +#ifndef FILEDATASTOREOBJECTREFERENCEFND_H +#define FILEDATASTOREOBJECTREFERENCEFND_H + +#include "../FileNodeChunkReference.h" +#include "../GUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class FileDataStoreObjectReferenceFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + GUID m_guidReference {}; + +public: + FileDataStoreObjectReferenceFND(StpFormat stpFormat, + CbFormat cbFormat); + ~FileDataStoreObjectReferenceFND(); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + libone::GUID getGuidReference() const; + void setGuidReference(const GUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // FILEDATASTOREOBJECTREFERENCEFND_H diff --git a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.cpp b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.cpp new file mode 100644 index 0000000..191218e --- /dev/null +++ b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.cpp @@ -0,0 +1,42 @@ +#include "GlobalIdTableEntry2FNDX.h" + +#include "../libone_utils.h" + +namespace libone +{ + +GlobalIdTableEntry2FNDX::GlobalIdTableEntry2FNDX() + : m_iIndexMapFrom{0}, m_iIndexMapTo{0} {} + +uint32_t GlobalIdTableEntry2FNDX::getIIndexMapFrom() const +{ + return m_iIndexMapFrom; +} + +void GlobalIdTableEntry2FNDX::setIIndexMapFrom(const uint32_t &value) +{ + m_iIndexMapFrom = value; +} + +uint32_t GlobalIdTableEntry2FNDX::getIIndexMapTo() const +{ + return m_iIndexMapTo; +} + +void GlobalIdTableEntry2FNDX::setIIndexMapTo(const uint32_t &value) +{ + m_iIndexMapTo = value; +} + +void GlobalIdTableEntry2FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_iIndexMapFrom; + input >> m_iIndexMapTo; +} + +std::string GlobalIdTableEntry2FNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h index e69de29..618481b 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h @@ -0,0 +1,34 @@ +#ifndef GLOBALIDTABLEENTRY2FNDX_H +#define GLOBALIDTABLEENTRY2FNDX_H + +#include "IFileNodeData.h" + +namespace libone +{ + +class GlobalIdTableEntry2FNDX : public IFileNodeData +{ +private: + uint32_t m_iIndexMapFrom; + + uint32_t m_iIndexMapTo; +public: + GlobalIdTableEntry2FNDX(); + + + + uint32_t getIIndexMapTo() const; + void setIIndexMapTo(const uint32_t &value); + + uint32_t getIIndexMapFrom() const; + void setIIndexMapFrom(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // GLOBALIDTABLEENTRY2FNDX_H diff --git a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.cpp b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.cpp new file mode 100644 index 0000000..7563369 --- /dev/null +++ b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.cpp @@ -0,0 +1,52 @@ +#include "GlobalIdTableEntry3FNDX.h" + +namespace libone +{ + +GlobalIdTableEntry3FNDX::GlobalIdTableEntry3FNDX() + : m_iIndexCopyFromStart{0}, m_cEntriesToCopy{0}, m_iIndexCopyToStart{0} {} + +uint32_t GlobalIdTableEntry3FNDX::getIIndexCopyFromStart() const +{ + return m_iIndexCopyFromStart; +} + +void GlobalIdTableEntry3FNDX::setIIndexCopyFromStart(const uint32_t &value) +{ + m_iIndexCopyFromStart = value; +} + +uint32_t GlobalIdTableEntry3FNDX::getCEntriesToCopy() const +{ + return m_cEntriesToCopy; +} + +void GlobalIdTableEntry3FNDX::setCEntriesToCopy(const uint32_t &value) +{ + m_cEntriesToCopy = value; +} + +uint32_t GlobalIdTableEntry3FNDX::getIIndexCopyToStart() const +{ + return m_iIndexCopyToStart; +} + +void GlobalIdTableEntry3FNDX::setIIndexCopyToStart(const uint32_t &value) +{ + m_iIndexCopyToStart = value; +} + +void GlobalIdTableEntry3FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_iIndexCopyFromStart; + input >> m_cEntriesToCopy; + input >> m_iIndexCopyToStart; +} + +std::string GlobalIdTableEntry3FNDX::to_string() const +{ + return ""; +} + + +} //namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h index e69de29..3860f46 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h @@ -0,0 +1,36 @@ +#ifndef GLOBALIDTABLEENTRY3FNDX_H +#define GLOBALIDTABLEENTRY3FNDX_H + +#include "IFileNodeData.h" + +namespace libone +{ + +class GlobalIdTableEntry3FNDX : public IFileNodeData +{ +private: + uint32_t m_iIndexCopyFromStart; + uint32_t m_cEntriesToCopy; + uint32_t m_iIndexCopyToStart; + +public: + GlobalIdTableEntry3FNDX(); + + + + uint32_t getIIndexCopyFromStart() const; + void setIIndexCopyFromStart(const uint32_t &value); + uint32_t getCEntriesToCopy() const; + void setCEntriesToCopy(const uint32_t &value); + uint32_t getIIndexCopyToStart() const; + void setIIndexCopyToStart(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // GLOBALIDTABLEENTRY3FNDX_H diff --git a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.cpp b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.cpp new file mode 100644 index 0000000..1733023 --- /dev/null +++ b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.cpp @@ -0,0 +1,39 @@ +#include "GlobalIdTableEntryFNDX.h" + +namespace libone +{ + +GlobalIdTableEntryFNDX::GlobalIdTableEntryFNDX() : m_index{0}, m_guid() {} + +GUID GlobalIdTableEntryFNDX::getGuid() const +{ + return m_guid; +} + +void GlobalIdTableEntryFNDX::setGuid(const GUID &value) +{ + m_guid = value; +} + +uint32_t GlobalIdTableEntryFNDX::getIndex() const +{ + return m_index; +} + +void GlobalIdTableEntryFNDX::setIndex(const uint32_t &value) +{ + m_index = value; +} + +void GlobalIdTableEntryFNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_index; + input >> m_guid; +} + +std::string GlobalIdTableEntryFNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h index e69de29..06aba6b 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h @@ -0,0 +1,32 @@ +#ifndef GLOBALIDTABLEENTRYFNDX_H +#define GLOBALIDTABLEENTRYFNDX_H + +#include "../GUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class GlobalIdTableEntryFNDX : public IFileNodeData +{ +private: + uint32_t m_index; + + GUID m_guid; +public: + GlobalIdTableEntryFNDX(); + + uint32_t getIndex() const; + void setIndex(const uint32_t &value); + + GUID getGuid() const; + void setGuid(const GUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; +} //namespace libone + +#endif // GLOBALIDTABLEENTRYFNDX_H diff --git a/src/lib/FileNodeData/GlobalIdTableStartFNDX.cpp b/src/lib/FileNodeData/GlobalIdTableStartFNDX.cpp new file mode 100644 index 0000000..5ea153d --- /dev/null +++ b/src/lib/FileNodeData/GlobalIdTableStartFNDX.cpp @@ -0,0 +1,28 @@ +#include "GlobalIdTableStartFNDX.h" + +namespace libone +{ + +GlobalIdTableStartFNDX::GlobalIdTableStartFNDX() : m_reserved{0} {} + +uint8_t GlobalIdTableStartFNDX::getReserved() const +{ + return m_reserved; +} + +void GlobalIdTableStartFNDX::setReserved(const uint8_t &value) +{ + m_reserved = value; +} + +void GlobalIdTableStartFNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_reserved; +} + +std::string GlobalIdTableStartFNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableStartFNDX.h b/src/lib/FileNodeData/GlobalIdTableStartFNDX.h index e69de29..67fa825 100644 --- a/src/lib/FileNodeData/GlobalIdTableStartFNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableStartFNDX.h @@ -0,0 +1,26 @@ +#ifndef GLOBALIDTABLESTARTFNDX_H +#define GLOBALIDTABLESTARTFNDX_H + +#include "IFileNodeData.h" + +namespace libone +{ + +class GlobalIdTableStartFNDX : public IFileNodeData +{ +private: + uint8_t m_reserved; +public: + GlobalIdTableStartFNDX(); + + uint8_t getReserved() const; + void setReserved(const uint8_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone +#endif // GLOBALIDTABLESTARTFNDX_H diff --git a/src/lib/FileNodeData/HashedChunkDescriptor2FND.cpp b/src/lib/FileNodeData/HashedChunkDescriptor2FND.cpp new file mode 100644 index 0000000..0cbbe7f --- /dev/null +++ b/src/lib/FileNodeData/HashedChunkDescriptor2FND.cpp @@ -0,0 +1,52 @@ +#include "HashedChunkDescriptor2FND.h" + +#include + +namespace libone +{ +HashedChunkDescriptor2FND::HashedChunkDescriptor2FND(StpFormat stpFormat, + CbFormat cbFormat) + : m_BlobRef(stpFormat, cbFormat) {} + +HashedChunkDescriptor2FND::HashedChunkDescriptor2FND(const HashedChunkDescriptor2FND &source) + : m_BlobRef(source.BlobRef()), m_guidHash(source.m_guidHash) +{ +} + +FileNodeChunkReference HashedChunkDescriptor2FND::BlobRef() const +{ + return m_BlobRef; +} + +void HashedChunkDescriptor2FND::setBlobRef( + const FileNodeChunkReference &BlobRef) +{ + m_BlobRef = BlobRef; +} + +std::array HashedChunkDescriptor2FND::guidHash() const +{ + return m_guidHash; +} + +void HashedChunkDescriptor2FND::setGuidHash(std::array guidHash) +{ + m_guidHash = guidHash; +} + + + +void HashedChunkDescriptor2FND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_BlobRef; + const unsigned char *temp= readNBytes(input, m_guidHash_length); + + std::copy_n(temp, m_guidHash_length, std::begin(m_guidHash)); +} + +std::string HashedChunkDescriptor2FND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/HashedChunkDescriptor2FND.h b/src/lib/FileNodeData/HashedChunkDescriptor2FND.h index e69de29..1994cde 100644 --- a/src/lib/FileNodeData/HashedChunkDescriptor2FND.h +++ b/src/lib/FileNodeData/HashedChunkDescriptor2FND.h @@ -0,0 +1,38 @@ +#ifndef HASHEDCHUNKDESCRIPTOR2FND_H +#define HASHEDCHUNKDESCRIPTOR2FND_H + +#include + +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class HashedChunkDescriptor2FND : public IFileNodeData +{ +private: + FileNodeChunkReference m_BlobRef; + + std::array m_guidHash {}; + uint8_t m_guidHash_length = 16; + +public: + HashedChunkDescriptor2FND(StpFormat stpFormat, CbFormat cbFormat); + HashedChunkDescriptor2FND(const HashedChunkDescriptor2FND &source); + + FileNodeChunkReference BlobRef() const; + void setBlobRef(const FileNodeChunkReference &BlobRef); + + std::array guidHash() const; + void setGuidHash(const std::array guidHash); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // HASHEDCHUNKDESCRIPTOR2FND_H diff --git a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp new file mode 100644 index 0000000..d769eaf --- /dev/null +++ b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp @@ -0,0 +1,85 @@ +#include "ObjectDataEncryptionKeyV2FNDX.h" + + + +namespace libone +{ +ObjectDataEncryptionKeyV2FNDX::ObjectDataEncryptionKeyV2FNDX( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat), m_EncryptionData() {} + +// ObjectDataEncryptionKeyV2FNDX::ObjectDataEncryptionKeyV2FNDX(const ObjectDataEncryptionKeyV2FNDX &source) +// : m_ref(source.m_ref), +// { +// std::copy(source.getEncryptionData(), source.getEncryptionData() + source.getEncryptionDataLength(), m_EncryptionData); +// } + +ObjectDataEncryptionKeyV2FNDX::~ObjectDataEncryptionKeyV2FNDX() +{ +} + +// ObjectDataEncryptionKeyV2FNDX &ObjectDataEncryptionKeyV2FNDX::operator=(const ObjectDataEncryptionKeyV2FNDX &rhs) +// { +// if (this == &rhs) +// { +// return *this; +// } +// +// delete[] this->m_EncryptionData; +// m_EncryptionData = new unsigned char[rhs.m_ref.cb()]; +// std::copy(rhs.m_EncryptionData, rhs.m_EncryptionData + rhs.m_ref.cb(), m_EncryptionData); +// return *this; +// } + +unsigned char *ObjectDataEncryptionKeyV2FNDX::getEncryptionData() const +{ + return m_EncryptionData.get(); +} + +void ObjectDataEncryptionKeyV2FNDX::setEncryptionData(const unsigned char *value, const uint64_t length) +{ + if (0 < length) + { + m_EncryptionData.reset(new unsigned char[length]); + std::copy(value, value + length, m_EncryptionData.get()); + } +} + +FileNodeChunkReference ObjectDataEncryptionKeyV2FNDX::getRef() const +{ + return m_ref; +} + +void ObjectDataEncryptionKeyV2FNDX::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void ObjectDataEncryptionKeyV2FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + + uint64_t currentloc = input->tell(); + + seek(input,m_ref.stp()); + // skip header + skip(input,8); + + const unsigned char *const temp = readNBytes(input, m_ref.cb()); + m_EncryptionData.reset(new unsigned char[m_ref.cb()]); + std::copy(temp, temp + m_ref.cb(), m_EncryptionData.get()); + delete temp; + + // skip footer + skip(input,8); + + seek(input, currentloc); +} + +std::string ObjectDataEncryptionKeyV2FNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h index e69de29..069bff2 100644 --- a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h +++ b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h @@ -0,0 +1,39 @@ +#ifndef OBJECTDATAENCRYPTIONKEYV2FNDX_H +#define OBJECTDATAENCRYPTIONKEYV2FNDX_H + +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectDataEncryptionKeyV2FNDX : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + + static constexpr const uint64_t m_header = 0xFB6BA385DAD1A067; + static constexpr const uint64_t m_footer = 0x2649294F8E198B3C; + + std::unique_ptr m_EncryptionData; +public: + ObjectDataEncryptionKeyV2FNDX(const StpFormat stpFormat, const CbFormat cbFormat); + ~ObjectDataEncryptionKeyV2FNDX(); + +// ObjectDataEncryptionKeyV2FNDX &operator=(const ObjectDataEncryptionKeyV2FNDX &rhs); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + unsigned char *getEncryptionData() const; + uint64_t getEncryptionDataLength() const; + void setEncryptionData(const unsigned char *value, const uint64_t length); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTDATAENCRYPTIONKEYV2FNDX_H diff --git a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.cpp b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.cpp new file mode 100644 index 0000000..4248afc --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.cpp @@ -0,0 +1,56 @@ +#include "ObjectDeclaration2LargeRefCountFND.h" + +namespace libone +{ + +ObjectDeclaration2LargeRefCountFND::ObjectDeclaration2LargeRefCountFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_BlobRef(stpFormat, cbFormat), m_body(), m_cRef() {} + +ObjectDeclaration2LargeRefCountFND::~ObjectDeclaration2LargeRefCountFND() {} + +ObjectDeclaration2Body ObjectDeclaration2LargeRefCountFND::body() const +{ + return m_body; +} + +void ObjectDeclaration2LargeRefCountFND::setBody( + const ObjectDeclaration2Body &body) +{ + m_body = body; +} + +uint32_t ObjectDeclaration2LargeRefCountFND::cRef() const +{ + return m_cRef; +} + +void ObjectDeclaration2LargeRefCountFND::setCRef(const uint32_t &cRef) +{ + m_cRef = cRef; +} + +FileNodeChunkReference ObjectDeclaration2LargeRefCountFND::BlobRef() const +{ + return m_BlobRef; +} + +void ObjectDeclaration2LargeRefCountFND::setBlobRef( + const FileNodeChunkReference &BlobRef) +{ + m_BlobRef = BlobRef; +} + +void ObjectDeclaration2LargeRefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_BlobRef; + input >> m_body; + input >> m_cRef; +} + +std::string ObjectDeclaration2LargeRefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h index e69de29..1a3b32a 100644 --- a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h @@ -0,0 +1,42 @@ +#ifndef OBJECTDECLARATION2LARGEREFCOUNTFND_H +#define OBJECTDECLARATION2LARGEREFCOUNTFND_H + +#include "../FileNodeChunkReference.h" +#include "../ObjectDeclaration2Body.h" +#include "IFileNodeData.h" + + +namespace libone +{ +class ObjectDeclaration2LargeRefCountFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_BlobRef; + + ObjectDeclaration2Body m_body; + + uint32_t m_cRef; + +public: + ObjectDeclaration2LargeRefCountFND(StpFormat stpFormat, + CbFormat cbFormat); + + ~ObjectDeclaration2LargeRefCountFND(); + + + FileNodeChunkReference BlobRef() const; + void setBlobRef(const FileNodeChunkReference &BlobRef); + + ObjectDeclaration2Body body() const; + void setBody(const ObjectDeclaration2Body &body); + + uint32_t cRef() const; + void setCRef(const uint32_t &cRef); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone +#endif // OBJECTDECLARATION2LARGEREFCOUNTFND_H diff --git a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.cpp b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.cpp new file mode 100644 index 0000000..3551944 --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.cpp @@ -0,0 +1,54 @@ +#include "ObjectDeclaration2RefCountFND.h" + +namespace libone +{ + +ObjectDeclaration2RefCountFND::ObjectDeclaration2RefCountFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_blobRef(stpFormat, cbFormat), m_body(), m_cRef{} {} + +uint8_t ObjectDeclaration2RefCountFND::getCRef() const +{ + return m_cRef; +} + +void ObjectDeclaration2RefCountFND::setCRef(const uint8_t &value) +{ + m_cRef = value; +} + +ObjectDeclaration2Body ObjectDeclaration2RefCountFND::getBody() const +{ + return m_body; +} + +void ObjectDeclaration2RefCountFND::setBody( + const ObjectDeclaration2Body &value) +{ + m_body = value; +} + +FileNodeChunkReference ObjectDeclaration2RefCountFND::getBlobRef() const +{ + return m_blobRef; +} + +void ObjectDeclaration2RefCountFND::setBlobRef( + const FileNodeChunkReference &value) +{ + m_blobRef = value; +} + +void ObjectDeclaration2RefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_blobRef; + input >> m_body; + input >> m_cRef; +} + +std::string ObjectDeclaration2RefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h index e69de29..4de4272 100644 --- a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h @@ -0,0 +1,40 @@ +#ifndef OBJECTDECLARATION2REFCOUNTFND_H +#define OBJECTDECLARATION2REFCOUNTFND_H + +#include "../FileNodeChunkReference.h" +#include "../ObjectDeclaration2Body.h" +#include "IFileNodeData.h" + +namespace libone +{ +class ObjectDeclaration2RefCountFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_blobRef; + + ObjectDeclaration2Body m_body; + + uint8_t m_cRef; +public: + ObjectDeclaration2RefCountFND(StpFormat stpFormat, + CbFormat cbFormat); + ~ObjectDeclaration2RefCountFND() = default; + + FileNodeChunkReference getBlobRef() const; + void setBlobRef(const FileNodeChunkReference &value); + + ObjectDeclaration2Body getBody() const; + void setBody(const ObjectDeclaration2Body &value); + + uint8_t getCRef() const; + void setCRef(const uint8_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // OBJECTDECLARATION2REFCOUNTFND_H diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.cpp b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.cpp new file mode 100644 index 0000000..7cf301d --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.cpp @@ -0,0 +1,78 @@ +#include "ObjectDeclarationFileData3LargeRefCountFND.h" + +namespace libone +{ + +ObjectDeclarationFileData3LargeRefCountFND:: +ObjectDeclarationFileData3LargeRefCountFND() : m_oid(), m_jcid(), m_cRef(), m_FileDataReference(), m_Extension() {} + +CompactID ObjectDeclarationFileData3LargeRefCountFND::oid() const +{ + return m_oid; +} + +void ObjectDeclarationFileData3LargeRefCountFND::setOid(const CompactID &oid) +{ + m_oid = oid; +} + +JCID ObjectDeclarationFileData3LargeRefCountFND::jcid() const +{ + return m_jcid; +} + +void ObjectDeclarationFileData3LargeRefCountFND::setJcid(const JCID &jcid) +{ + m_jcid = jcid; +} + +uint32_t ObjectDeclarationFileData3LargeRefCountFND::cRef() const +{ + return m_cRef; +} + +void ObjectDeclarationFileData3LargeRefCountFND::setCRef(const uint32_t &cRef) +{ + m_cRef = cRef; +} + +StringInStorageBuffer +ObjectDeclarationFileData3LargeRefCountFND::FileDataReference() const +{ + return m_FileDataReference; +} + +void ObjectDeclarationFileData3LargeRefCountFND::setFileDataReference( + const StringInStorageBuffer &FileDataReference) +{ + m_FileDataReference = FileDataReference; +} + +StringInStorageBuffer +ObjectDeclarationFileData3LargeRefCountFND::Extension() const +{ + return m_Extension; +} + +void ObjectDeclarationFileData3LargeRefCountFND::setExtension( + const StringInStorageBuffer &Extension) +{ + m_Extension = Extension; +} + + +void ObjectDeclarationFileData3LargeRefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + input >> m_jcid; + input >> m_cRef; + input >> m_FileDataReference; + input >> m_Extension; +} + +std::string ObjectDeclarationFileData3LargeRefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h index e69de29..b7ff0a2 100644 --- a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h @@ -0,0 +1,46 @@ +#ifndef OBJECTDECLARATIONFILEDATA3LARGEREFCOUNTFND_H +#define OBJECTDECLARATIONFILEDATA3LARGEREFCOUNTFND_H + +#include "../CompactID.h" +#include "../StringInStorageBuffer.h" +#include "../JCID.h" +#include "IFileNodeData.h" + +namespace libone +{ +class ObjectDeclarationFileData3LargeRefCountFND : public IFileNodeData +{ +private: + CompactID m_oid; + JCID m_jcid; + + uint32_t m_cRef; + + StringInStorageBuffer m_FileDataReference; + StringInStorageBuffer m_Extension; + +public: + ObjectDeclarationFileData3LargeRefCountFND(); + + CompactID oid() const; + void setOid(const CompactID &oid); + + JCID jcid() const; + void setJcid(const JCID &jcid); + + uint32_t cRef() const; + void setCRef(const uint32_t &cRef); + + StringInStorageBuffer FileDataReference() const; + void setFileDataReference(const StringInStorageBuffer &FileDataReference); + + StringInStorageBuffer Extension() const; + void setExtension(const StringInStorageBuffer &Extension); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone +#endif // OBJECTDECLARATIONFILEDATA3LARGEREFCOUNTFND_H diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.cpp b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.cpp new file mode 100644 index 0000000..f560b92 --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.cpp @@ -0,0 +1,73 @@ +#include "ObjectDeclarationFileData3RefCountFND.h" + +namespace libone +{ + +ObjectDeclarationFileData3RefCountFND::ObjectDeclarationFileData3RefCountFND() : + m_oid(), m_jcid(), m_cRef{}, m_FileDataReference(), m_Extension() {} + +CompactID ObjectDeclarationFileData3RefCountFND::oid() const +{ + return m_oid; +} + +void ObjectDeclarationFileData3RefCountFND::setOid(const CompactID &oid) +{ + m_oid = oid; +} + +JCID ObjectDeclarationFileData3RefCountFND::jcid() const +{ + return m_jcid; +} + +void ObjectDeclarationFileData3RefCountFND::setJcid(const JCID &jcid) +{ + m_jcid = jcid; +} + +uint8_t ObjectDeclarationFileData3RefCountFND::cRef() const +{ + return m_cRef; +} + +void ObjectDeclarationFileData3RefCountFND::setCRef(const uint8_t &cRef) +{ + m_cRef = cRef; +} + +StringInStorageBuffer ObjectDeclarationFileData3RefCountFND::FileDataReference() const +{ + return m_FileDataReference; +} + +void ObjectDeclarationFileData3RefCountFND::setFileDataReference(const StringInStorageBuffer &FileDataReference) +{ + m_FileDataReference = FileDataReference; +} + +StringInStorageBuffer ObjectDeclarationFileData3RefCountFND::Extension() const +{ + return m_Extension; +} + +void ObjectDeclarationFileData3RefCountFND::setExtension(const StringInStorageBuffer &Extension) +{ + m_Extension = Extension; +} + +void ObjectDeclarationFileData3RefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + input >> m_jcid; + input >> m_cRef; + input >> m_FileDataReference; + input >> m_Extension; +} + +std::string ObjectDeclarationFileData3RefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h index e69de29..b388d44 100644 --- a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h @@ -0,0 +1,48 @@ +#ifndef OBJECTDECLARATIONFILEDATA3REFCOUNTFND_H +#define OBJECTDECLARATIONFILEDATA3REFCOUNTFND_H + +#include "IFileNodeData.h" + +#include "../CompactID.h" +#include "../StringInStorageBuffer.h" +#include "../JCID.h" + +namespace libone +{ +class ObjectDeclarationFileData3RefCountFND : public IFileNodeData +{ +private: + CompactID m_oid; + JCID m_jcid; + + uint8_t m_cRef = 0; + + StringInStorageBuffer m_FileDataReference; + StringInStorageBuffer m_Extension; + +public: + ObjectDeclarationFileData3RefCountFND(); + + CompactID oid() const; + void setOid(const CompactID &oid); + + JCID jcid() const; + void setJcid(const JCID &jcid); + + uint8_t cRef() const; + void setCRef(const uint8_t &cRef); + + StringInStorageBuffer FileDataReference() const; + void setFileDataReference(const StringInStorageBuffer &FileDataReference); + + StringInStorageBuffer Extension() const; + void setExtension(const StringInStorageBuffer &Extension); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTDECLARATIONFILEDATA3REFCOUNTFND_H diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.cpp b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.cpp new file mode 100644 index 0000000..a892f3a --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.cpp @@ -0,0 +1,58 @@ +#include "ObjectDeclarationWithRefCount2FNDX.h" + + +namespace libone +{ +ObjectDeclarationWithRefCount2FNDX::ObjectDeclarationWithRefCount2FNDX( + StpFormat stpFormat, CbFormat cbFormat) + : m_objectRef(stpFormat, cbFormat), m_body(), m_cRef{} {} + +ObjectDeclarationWithRefCount2FNDX::~ObjectDeclarationWithRefCount2FNDX() {} + +FileNodeChunkReference +ObjectDeclarationWithRefCount2FNDX::getObjectRef() const +{ + return m_objectRef; +} + +void ObjectDeclarationWithRefCount2FNDX::setObjectRef( + const FileNodeChunkReference &value) +{ + m_objectRef = value; +} + +ObjectDeclarationWithRefCountBody +ObjectDeclarationWithRefCount2FNDX::getBody() const +{ + return m_body; +} + +void ObjectDeclarationWithRefCount2FNDX::setBody( + const ObjectDeclarationWithRefCountBody &value) +{ + m_body = value; +} + +uint32_t ObjectDeclarationWithRefCount2FNDX::getCRef() const +{ + return m_cRef; +} + +void ObjectDeclarationWithRefCount2FNDX::setCRef(const uint32_t &value) +{ + m_cRef = value; +} + +void ObjectDeclarationWithRefCount2FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_objectRef; + input >> m_body; + input >> m_cRef; +} + +std::string ObjectDeclarationWithRefCount2FNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h index e69de29..c19ed43 100644 --- a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h @@ -0,0 +1,44 @@ +#ifndef OBJECTDECLARATIONWITHREFCOUNT2FNDX_H +#define OBJECTDECLARATIONWITHREFCOUNT2FNDX_H + + +#include "../FileNodeChunkReference.h" +#include "../ObjectDeclarationWithRefCountBody.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectDeclarationWithRefCount2FNDX : public IFileNodeData +{ +private: + FileNodeChunkReference m_objectRef; + + ObjectDeclarationWithRefCountBody m_body; + + uint32_t m_cRef; +public: + ObjectDeclarationWithRefCount2FNDX(StpFormat stpFormat, + CbFormat cbFormat); + ~ObjectDeclarationWithRefCount2FNDX(); + + + + FileNodeChunkReference getObjectRef() const; + void setObjectRef(const FileNodeChunkReference &value); + + ObjectDeclarationWithRefCountBody getBody() const; + void setBody(const ObjectDeclarationWithRefCountBody &value); + + uint32_t getCRef() const; + void setCRef(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // OBJECTDECLARATIONWITHREFCOUNT2FNDX_H diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.cpp b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.cpp new file mode 100644 index 0000000..0aa2509 --- /dev/null +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.cpp @@ -0,0 +1,57 @@ +#include "ObjectDeclarationWithRefCountFNDX.h" + +namespace libone +{ + +ObjectDeclarationWithRefCountFNDX::ObjectDeclarationWithRefCountFNDX( + StpFormat stpFormat, CbFormat cbFormat) + : m_objectRef(stpFormat, cbFormat), m_body(), m_cRef() {} + +ObjectDeclarationWithRefCountFNDX::~ObjectDeclarationWithRefCountFNDX() {} + +FileNodeChunkReference ObjectDeclarationWithRefCountFNDX::getObjectRef() const +{ + return m_objectRef; +} + +void ObjectDeclarationWithRefCountFNDX::setObjectRef( + const FileNodeChunkReference &value) +{ + m_objectRef = value; +} + +ObjectDeclarationWithRefCountBody +ObjectDeclarationWithRefCountFNDX::getBody() const +{ + return m_body; +} + +void ObjectDeclarationWithRefCountFNDX::setBody( + const ObjectDeclarationWithRefCountBody &value) +{ + m_body = value; +} + +uint8_t ObjectDeclarationWithRefCountFNDX::getCRef() const +{ + return m_cRef; +} + +void ObjectDeclarationWithRefCountFNDX::setCRef(const uint8_t &value) +{ + m_cRef = value; +} + +void ObjectDeclarationWithRefCountFNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_objectRef; + input >> m_body; + input>> m_cRef; +} + +std::string ObjectDeclarationWithRefCountFNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h index e69de29..c01c5e6 100644 --- a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h @@ -0,0 +1,44 @@ +#ifndef OBJECTDECLARATIONWITHREFCOUNTFNDX_H +#define OBJECTDECLARATIONWITHREFCOUNTFNDX_H + +#include "../FileNodeChunkReference.h" +#include "../ObjectDeclarationWithRefCountBody.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectDeclarationWithRefCountFNDX : public IFileNodeData +{ +private: + + FileNodeChunkReference m_objectRef; + + ObjectDeclarationWithRefCountBody m_body; + + uint8_t m_cRef; + +public: + ObjectDeclarationWithRefCountFNDX(StpFormat stpFormat, + CbFormat cbFormat); + ~ObjectDeclarationWithRefCountFNDX(); + + + + FileNodeChunkReference getObjectRef() const; + void setObjectRef(const FileNodeChunkReference &value); + + ObjectDeclarationWithRefCountBody getBody() const; + void setBody(const ObjectDeclarationWithRefCountBody &value); + + uint8_t getCRef() const; + void setCRef(const uint8_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTDECLARATIONWITHREFCOUNTFNDX_H diff --git a/src/lib/FileNodeData/ObjectGroupListReferenceFND.cpp b/src/lib/FileNodeData/ObjectGroupListReferenceFND.cpp new file mode 100644 index 0000000..7d9e4d3 --- /dev/null +++ b/src/lib/FileNodeData/ObjectGroupListReferenceFND.cpp @@ -0,0 +1,42 @@ +#include "ObjectGroupListReferenceFND.h" + +namespace libone +{ + +ObjectGroupListReferenceFND::ObjectGroupListReferenceFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat), m_ObjectGroupID() {} + +ExtendedGUID ObjectGroupListReferenceFND::objectGroupID() const +{ + return m_ObjectGroupID; +} + +void ObjectGroupListReferenceFND::setObjectGroupID( + const ExtendedGUID &objectGroupID) +{ + m_ObjectGroupID = objectGroupID; +} + +FileNodeChunkReference ObjectGroupListReferenceFND::ref() const +{ + return m_ref; +} + +void ObjectGroupListReferenceFND::setRef(const FileNodeChunkReference &ref) +{ + m_ref = ref; +} + +void ObjectGroupListReferenceFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + input >> m_ObjectGroupID; +} + +std::string ObjectGroupListReferenceFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectGroupListReferenceFND.h b/src/lib/FileNodeData/ObjectGroupListReferenceFND.h index e69de29..5808733 100644 --- a/src/lib/FileNodeData/ObjectGroupListReferenceFND.h +++ b/src/lib/FileNodeData/ObjectGroupListReferenceFND.h @@ -0,0 +1,36 @@ +#ifndef OBJECTGROUPLISTREFERENCEFND_H +#define OBJECTGROUPLISTREFERENCEFND_H + +#include "../ExtendedGUID.h" +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectGroupListReferenceFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + + ExtendedGUID m_ObjectGroupID; + +public: + ObjectGroupListReferenceFND(StpFormat stpFormat, + CbFormat cbFormat); + ~ObjectGroupListReferenceFND() = default; + + FileNodeChunkReference ref() const; + void setRef(const FileNodeChunkReference &ref); + + ExtendedGUID objectGroupID() const; + void setObjectGroupID(const ExtendedGUID &objectGroupID); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTGROUPLISTREFERENCEFND_H diff --git a/src/lib/FileNodeData/ObjectGroupStartFND.cpp b/src/lib/FileNodeData/ObjectGroupStartFND.cpp new file mode 100644 index 0000000..cc56e48 --- /dev/null +++ b/src/lib/FileNodeData/ObjectGroupStartFND.cpp @@ -0,0 +1,31 @@ +#include "ObjectGroupStartFND.h" + + +namespace libone +{ +ObjectGroupStartFND::ObjectGroupStartFND() + : m_oid(ExtendedGUID()) +{ +} + +ExtendedGUID ObjectGroupStartFND::oid() const +{ + return m_oid; +} + +void ObjectGroupStartFND::setOid(const ExtendedGUID &oid) +{ + m_oid = oid; +} + + +void ObjectGroupStartFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; +} + +std::string ObjectGroupStartFND::to_string() const +{ + return ""; +} +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectGroupStartFND.h b/src/lib/FileNodeData/ObjectGroupStartFND.h index e69de29..c91dbdc 100644 --- a/src/lib/FileNodeData/ObjectGroupStartFND.h +++ b/src/lib/FileNodeData/ObjectGroupStartFND.h @@ -0,0 +1,27 @@ +#ifndef OBJECTGROUPSTARTFND_H +#define OBJECTGROUPSTARTFND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectGroupStartFND : public IFileNodeData +{ +private: + ExtendedGUID m_oid; +public: + ObjectGroupStartFND(); + + ExtendedGUID oid() const; + void setOid(const ExtendedGUID &oid); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTGROUPSTARTFND_H diff --git a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.cpp b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.cpp new file mode 100644 index 0000000..f2bd4c6 --- /dev/null +++ b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.cpp @@ -0,0 +1,56 @@ +#include "ObjectInfoDependencyOverridesFND.h" + +namespace libone +{ +ObjectInfoDependencyOverridesFND::ObjectInfoDependencyOverridesFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat), m_data() {} + +ObjectInfoDependencyOverridesFND::~ObjectInfoDependencyOverridesFND() {} + +ObjectInfoDependencyOverrideData +ObjectInfoDependencyOverridesFND::getData() const +{ + return m_data; +} + +void ObjectInfoDependencyOverridesFND::setData( + const ObjectInfoDependencyOverrideData &value) +{ + m_data = value; +} + +FileNodeChunkReference ObjectInfoDependencyOverridesFND::getRef() const +{ + return m_ref; +} + +void ObjectInfoDependencyOverridesFND::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void ObjectInfoDependencyOverridesFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + + if (m_ref.is_fcrNil()) + { + input >> m_data; + } + else + { + uint64_t currentloc = input->tell(); + input->seek(m_ref.stp(), librevenge::RVNG_SEEK_SET); + input >> m_data; + input->seek(currentloc, librevenge::RVNG_SEEK_SET); + } +} + +std::string ObjectInfoDependencyOverridesFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h index e69de29..713597c 100644 --- a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h +++ b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h @@ -0,0 +1,35 @@ +#ifndef OBJECTINFODEPENDENCYOVERRIDESFND_H +#define OBJECTINFODEPENDENCYOVERRIDESFND_H + +#include "IFileNodeData.h" +#include "../FileNodeChunkReference.h" +#include "../ObjectInfoDependencyOverrideData.h" + +namespace libone +{ + +class ObjectInfoDependencyOverridesFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + + ObjectInfoDependencyOverrideData m_data; + +public: + ObjectInfoDependencyOverridesFND(StpFormat stpFormat, CbFormat cbFormat); + ~ObjectInfoDependencyOverridesFND(); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + ObjectInfoDependencyOverrideData getData() const; + void setData(const ObjectInfoDependencyOverrideData &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTINFODEPENDENCYOVERRIDESFND_H diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.cpp b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.cpp new file mode 100644 index 0000000..71abea3 --- /dev/null +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.cpp @@ -0,0 +1,81 @@ +#include "ObjectRevisionWithRefCount2FNDX.h" + +namespace libone +{ + +ObjectRevisionWithRefCount2FNDX::ObjectRevisionWithRefCount2FNDX( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat), m_oid(), + m_fHasOidReferences(false), m_fHasOsidReferences(false), m_cRef(0) {} + +uint32_t ObjectRevisionWithRefCount2FNDX::getCRef() const +{ + return m_cRef; +} + +void ObjectRevisionWithRefCount2FNDX::setCRef(const uint32_t &value) +{ + m_cRef = value; +} + +bool ObjectRevisionWithRefCount2FNDX::getFHasOsidReferences() const +{ + return m_fHasOsidReferences; +} + +void ObjectRevisionWithRefCount2FNDX::setFHasOsidReferences(bool value) +{ + m_fHasOsidReferences = value; +} + +bool ObjectRevisionWithRefCount2FNDX::getFHasOidReferences() const +{ + return m_fHasOidReferences; +} + +void ObjectRevisionWithRefCount2FNDX::setFHasOidReferences(bool value) +{ + m_fHasOidReferences = value; +} + +CompactID ObjectRevisionWithRefCount2FNDX::getOid() const +{ + return m_oid; +} + +void ObjectRevisionWithRefCount2FNDX::setOid(const CompactID &value) +{ + m_oid = value; +} + +FileNodeChunkReference ObjectRevisionWithRefCount2FNDX::getRef() const +{ + return m_ref; +} + +void ObjectRevisionWithRefCount2FNDX::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void ObjectRevisionWithRefCount2FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + input >> m_oid; + + uint32_t temp; + input >> temp; + + m_fHasOidReferences = temp & 0x1; + m_fHasOsidReferences = (temp & 0x2) >> 1; + + input >> m_cRef; +} + +std::string ObjectRevisionWithRefCount2FNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h index e69de29..a58e578 100644 --- a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h @@ -0,0 +1,50 @@ +#ifndef OBJECTREVISIONWITHREFCOUNT2FNDX_H +#define OBJECTREVISIONWITHREFCOUNT2FNDX_H + +#include "../CompactID.h" +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectRevisionWithRefCount2FNDX : public IFileNodeData +{ +private: + + FileNodeChunkReference m_ref; + + CompactID m_oid; + + bool m_fHasOidReferences; + bool m_fHasOsidReferences; + + uint32_t m_cRef; + +public: + ObjectRevisionWithRefCount2FNDX(StpFormat stpFormat, + CbFormat cbFormat); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + CompactID getOid() const; + void setOid(const CompactID &value); + + bool getFHasOidReferences() const; + void setFHasOidReferences(bool value); + + bool getFHasOsidReferences() const; + void setFHasOsidReferences(bool value); + + uint32_t getCRef() const; + void setCRef(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTREVISIONWITHREFCOUNT2FNDX_H diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.cpp b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.cpp new file mode 100644 index 0000000..1c8934a --- /dev/null +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.cpp @@ -0,0 +1,79 @@ +#include "ObjectRevisionWithRefCountFNDX.h" + + +namespace libone +{ +ObjectRevisionWithRefCountFNDX::ObjectRevisionWithRefCountFNDX( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat), m_oid(), + m_fHasOidReferences(false), m_fHasOsidReferences(false), m_cRef(0) {} + +bool ObjectRevisionWithRefCountFNDX::getFHasOsidReferences() const +{ + return m_fHasOsidReferences; +} + +void ObjectRevisionWithRefCountFNDX::setFHasOsidReferences(bool value) +{ + m_fHasOsidReferences = value; +} + +bool ObjectRevisionWithRefCountFNDX::getFHasOidReferences() const +{ + return m_fHasOidReferences; +} + +void ObjectRevisionWithRefCountFNDX::setFHasOidReferences(bool value) +{ + m_fHasOidReferences = value; +} + +uint8_t ObjectRevisionWithRefCountFNDX::getCRef() const +{ + return m_cRef; +} + +void ObjectRevisionWithRefCountFNDX::setCRef(const uint8_t &value) +{ + m_cRef = value; +} + +CompactID ObjectRevisionWithRefCountFNDX::getOid() const +{ + return m_oid; +} + +void ObjectRevisionWithRefCountFNDX::setOid(const CompactID &value) +{ + m_oid = value; +} + +FileNodeChunkReference ObjectRevisionWithRefCountFNDX::getRef() const +{ + return m_ref; +} + +void ObjectRevisionWithRefCountFNDX::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void ObjectRevisionWithRefCountFNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + input >> m_oid; + input >> m_cRef; + + m_fHasOidReferences = m_cRef & 0x1; + m_fHasOsidReferences = m_cRef & 0x2; + + m_cRef = m_cRef >> 2; +} + +std::string ObjectRevisionWithRefCountFNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h index e69de29..ddbf0c0 100644 --- a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h @@ -0,0 +1,46 @@ +#ifndef OBJECTREVISIONWITHREFCOUNTFNDX_H +#define OBJECTREVISIONWITHREFCOUNTFNDX_H + +#include "../CompactID.h" +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectRevisionWithRefCountFNDX : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + + CompactID m_oid; + + bool m_fHasOidReferences; + bool m_fHasOsidReferences; + + uint8_t m_cRef; + +public: + ObjectRevisionWithRefCountFNDX(StpFormat stpFormat, + CbFormat cbFormat); + ~ObjectRevisionWithRefCountFNDX() = default; + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + CompactID getOid() const; + void setOid(const CompactID &value); + uint8_t getCRef() const; + void setCRef(const uint8_t &value); + bool getFHasOidReferences() const; + void setFHasOidReferences(bool value); + bool getFHasOsidReferences() const; + void setFHasOsidReferences(bool value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTREVISIONWITHREFCOUNTFNDX_H diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.cpp b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.cpp new file mode 100644 index 0000000..0fc8485 --- /dev/null +++ b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.cpp @@ -0,0 +1,43 @@ +#include "ObjectSpaceManifestListReferenceFND.h" + +namespace libone +{ +ObjectSpaceManifestListReferenceFND::ObjectSpaceManifestListReferenceFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref{FileNodeChunkReference(stpFormat, cbFormat)}, m_gosid() {} + +ObjectSpaceManifestListReferenceFND::~ObjectSpaceManifestListReferenceFND() {} + +ExtendedGUID ObjectSpaceManifestListReferenceFND::getGosid() const +{ + return m_gosid; +} + +void ObjectSpaceManifestListReferenceFND::setGosid(const ExtendedGUID &value) +{ + m_gosid = value; +} + +FileNodeChunkReference ObjectSpaceManifestListReferenceFND::getRef() const +{ + return m_ref; +} + +void ObjectSpaceManifestListReferenceFND::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void ObjectSpaceManifestListReferenceFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; + input >> m_gosid; +} + +std::string ObjectSpaceManifestListReferenceFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h index e69de29..35c8fdc 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h @@ -0,0 +1,37 @@ +#ifndef OBJECTSPACEMANIFESTLISTREFERENCEFND_H +#define OBJECTSPACEMANIFESTLISTREFERENCEFND_H + +#include "../ExtendedGUID.h" +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class ObjectSpaceManifestListReferenceFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + + ExtendedGUID m_gosid; +public: + ObjectSpaceManifestListReferenceFND(StpFormat stpFormat, + CbFormat cbFormat); + + ~ObjectSpaceManifestListReferenceFND(); + + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + ExtendedGUID getGosid() const; + void setGosid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTSPACEMANIFESTLISTREFERENCEFND_H diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.cpp b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.cpp new file mode 100644 index 0000000..a4edd08 --- /dev/null +++ b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.cpp @@ -0,0 +1,27 @@ +#include "ObjectSpaceManifestListStartFND.h" + +namespace libone +{ +ObjectSpaceManifestListStartFND::ObjectSpaceManifestListStartFND() : m_gosid() {} + +ExtendedGUID ObjectSpaceManifestListStartFND::getGosid() const +{ + return m_gosid; +} + +void ObjectSpaceManifestListStartFND::setGosid(const ExtendedGUID &value) +{ + m_gosid = value; +} + +void ObjectSpaceManifestListStartFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_gosid; +} + +std::string ObjectSpaceManifestListStartFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h index e69de29..2b40e58 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h @@ -0,0 +1,28 @@ +#ifndef OBJECTSPACEMANIFESTLISTSTARTFND_H +#define OBJECTSPACEMANIFESTLISTSTARTFND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" + +namespace libone +{ +class ObjectSpaceManifestListStartFND : public IFileNodeData +{ +private: + ExtendedGUID m_gosid; + +public: + ObjectSpaceManifestListStartFND(); + ~ObjectSpaceManifestListStartFND() = default; + + ExtendedGUID getGosid() const; + void setGosid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // OBJECTSPACEMANIFESTLISTSTARTFND_H diff --git a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.cpp b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.cpp new file mode 100644 index 0000000..9fff44e --- /dev/null +++ b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.cpp @@ -0,0 +1,30 @@ +#include "ObjectSpaceManifestRootFND.h" + +namespace libone +{ + +ObjectSpaceManifestRootFND::ObjectSpaceManifestRootFND() : m_gosidRoot() {} + +ObjectSpaceManifestRootFND::~ObjectSpaceManifestRootFND() {} + +ExtendedGUID ObjectSpaceManifestRootFND::getGosidRoot() const +{ + return m_gosidRoot; +} + +void ObjectSpaceManifestRootFND::setGosidRoot(const ExtendedGUID &value) +{ + m_gosidRoot = value; +} + +void ObjectSpaceManifestRootFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_gosidRoot; +} + +std::string ObjectSpaceManifestRootFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h index e69de29..0cde5f0 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h @@ -0,0 +1,30 @@ +#ifndef OBJECTSPACEMANIFESTROOTFND_H +#define OBJECTSPACEMANIFESTROOTFND_H + +#include "IFileNodeData.h" + +#include "../ExtendedGUID.h" + +namespace libone +{ +class ObjectSpaceManifestRootFND : public IFileNodeData +{ +private: + ExtendedGUID m_gosidRoot; + +public: + ObjectSpaceManifestRootFND(); + ~ObjectSpaceManifestRootFND(); + + ExtendedGUID getGosidRoot() const; + void setGosidRoot(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // OBJECTSPACEMANIFESTROOTFND_H diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.cpp b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.cpp new file mode 100644 index 0000000..7d00a64 --- /dev/null +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.cpp @@ -0,0 +1,67 @@ +#include "ReadOnlyObjectDeclaration2LargeRefCountFND.h" + +#include + +namespace libone +{ +ReadOnlyObjectDeclaration2LargeRefCountFND:: +ReadOnlyObjectDeclaration2LargeRefCountFND(StpFormat stpFormat, + CbFormat cbFormat) + : m_stpFormat(stpFormat), m_cbFormat(cbFormat), + m_base(stpFormat, cbFormat), m_md5hash() {} + +ReadOnlyObjectDeclaration2LargeRefCountFND:: +~ReadOnlyObjectDeclaration2LargeRefCountFND() {} + +StpFormat +ReadOnlyObjectDeclaration2LargeRefCountFND::getStpFormat() const +{ + return m_stpFormat; +} + +CbFormat ReadOnlyObjectDeclaration2LargeRefCountFND::getCbFormat() const +{ + return m_cbFormat; +} + +ObjectDeclaration2LargeRefCountFND +ReadOnlyObjectDeclaration2LargeRefCountFND::getBase() const +{ + return m_base; +} + +void ReadOnlyObjectDeclaration2LargeRefCountFND::setBase( + const ObjectDeclaration2LargeRefCountFND &value) +{ + m_base = value; +} + +std::array ReadOnlyObjectDeclaration2LargeRefCountFND::getMd5hash() const +{ + return m_md5hash; +} + +void ReadOnlyObjectDeclaration2LargeRefCountFND::setMd5hash( + const std::array &value) +{ + m_md5hash = value; +} + +void ReadOnlyObjectDeclaration2LargeRefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + + m_base = ObjectDeclaration2LargeRefCountFND(m_stpFormat, m_cbFormat); + input >> m_base; + + const unsigned char *md5hashRaw {}; + md5hashRaw = readNBytes(input, 16); + + std::copy_n(md5hashRaw, 16, std::begin(m_md5hash)); +} + +std::string ReadOnlyObjectDeclaration2LargeRefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h index e69de29..7a5a5cd 100644 --- a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h @@ -0,0 +1,48 @@ +#ifndef READONLYOBJECTDECLARATION2LARGEREFCOUNTFND_H +#define READONLYOBJECTDECLARATION2LARGEREFCOUNTFND_H + +#include + +#include "../FileNodeChunkReference.h" +#include "IFileNodeData.h" +#include "ObjectDeclaration2LargeRefCountFND.h" + +namespace libone +{ +class ReadOnlyObjectDeclaration2LargeRefCountFND : public IFileNodeData +{ +private: + StpFormat m_stpFormat; + CbFormat m_cbFormat; + + ObjectDeclaration2LargeRefCountFND m_base; + + std::array m_md5hash; + +public: + ReadOnlyObjectDeclaration2LargeRefCountFND(StpFormat stpFormat, + CbFormat cbFormat); + + ~ReadOnlyObjectDeclaration2LargeRefCountFND(); + + FileNodeChunkReference ref() const; + void setRef(const FileNodeChunkReference &ref); + ObjectDeclaration2LargeRefCountFND getBase() const; + void setBase(const ObjectDeclaration2LargeRefCountFND &value); + + std::array getMd5hash() const; + void setMd5hash(const std::array &value); + + StpFormat getStpFormat() const; + + CbFormat getCbFormat() const; + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; + +}; + +} // namespace libone + +#endif // READONLYOBJECTDECLARATION2LARGEREFCOUNTFND_H diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.cpp b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.cpp new file mode 100644 index 0000000..b04e5e4 --- /dev/null +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.cpp @@ -0,0 +1,67 @@ +#include "ReadOnlyObjectDeclaration2RefCountFND.h" + +#include + +namespace libone +{ + +ReadOnlyObjectDeclaration2RefCountFND::ReadOnlyObjectDeclaration2RefCountFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_stpFormat(stpFormat), m_cbFormat(cbFormat), + m_base(stpFormat, cbFormat), m_md5hash() {} + +ReadOnlyObjectDeclaration2RefCountFND:: +~ReadOnlyObjectDeclaration2RefCountFND() {} + + +StpFormat ReadOnlyObjectDeclaration2RefCountFND::getStpFormat() const +{ + return m_stpFormat; +} + +CbFormat ReadOnlyObjectDeclaration2RefCountFND::getCbFormat() const +{ + return m_cbFormat; +} + +ObjectDeclaration2RefCountFND +ReadOnlyObjectDeclaration2RefCountFND::getBase() const +{ + return m_base; +} + +void ReadOnlyObjectDeclaration2RefCountFND::setBase( + const ObjectDeclaration2RefCountFND &value) +{ + m_base = value; +} + +std::array ReadOnlyObjectDeclaration2RefCountFND::getMd5hash() const +{ + return m_md5hash; +} + +void ReadOnlyObjectDeclaration2RefCountFND::setMd5hash( + const std::array &value) +{ + m_md5hash = value; +} + +void ReadOnlyObjectDeclaration2RefCountFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + + m_base = ObjectDeclaration2RefCountFND(m_stpFormat, m_cbFormat); + input >> m_base; + + const unsigned char *md5hashRaw; + md5hashRaw = readNBytes(input, 16); + std::copy_n(md5hashRaw, 16, std::begin(m_md5hash)); + +} + +std::string ReadOnlyObjectDeclaration2RefCountFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h index e69de29..4c61657 100644 --- a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h @@ -0,0 +1,44 @@ +#ifndef READONLYOBJECTDECLARATION2REFCOUNTFND_H +#define READONLYOBJECTDECLARATION2REFCOUNTFND_H + +#include "IFileNodeData.h" +#include "ObjectDeclaration2RefCountFND.h" +#include "../FileNodeChunkReference.h" + +namespace libone +{ + +class ReadOnlyObjectDeclaration2RefCountFND : public IFileNodeData +{ +private: + StpFormat m_stpFormat; + CbFormat m_cbFormat; + ObjectDeclaration2RefCountFND m_base; + + std::array m_md5hash; + +public: + ReadOnlyObjectDeclaration2RefCountFND(StpFormat stpFormat, + CbFormat cbFormat); + + ~ReadOnlyObjectDeclaration2RefCountFND(); + + FileNodeChunkReference ref() const; + void setRef(const FileNodeChunkReference &ref); + ObjectDeclaration2RefCountFND getBase() const; + void setBase(const ObjectDeclaration2RefCountFND &value); + + std::array getMd5hash() const; + void setMd5hash(const std::array &value); + + StpFormat getStpFormat() const; + CbFormat getCbFormat() const; + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // READONLYOBJECTDECLARATION2REFCOUNTFND_H diff --git a/src/lib/FileNodeData/RevisionManifestListReferenceFND.cpp b/src/lib/FileNodeData/RevisionManifestListReferenceFND.cpp new file mode 100644 index 0000000..4253c9d --- /dev/null +++ b/src/lib/FileNodeData/RevisionManifestListReferenceFND.cpp @@ -0,0 +1,32 @@ +#include "RevisionManifestListReferenceFND.h" + +namespace libone +{ + +RevisionManifestListReferenceFND::RevisionManifestListReferenceFND( + StpFormat stpFormat, CbFormat cbFormat) + : m_ref(stpFormat, cbFormat) {} +RevisionManifestListReferenceFND::~RevisionManifestListReferenceFND() {} + +FileNodeChunkReference RevisionManifestListReferenceFND::getRef() const +{ + return m_ref; +} + +void RevisionManifestListReferenceFND::setRef( + const FileNodeChunkReference &value) +{ + m_ref = value; +} + +void RevisionManifestListReferenceFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_ref; +} + +std::string RevisionManifestListReferenceFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestListReferenceFND.h b/src/lib/FileNodeData/RevisionManifestListReferenceFND.h index e69de29..c5f49c0 100644 --- a/src/lib/FileNodeData/RevisionManifestListReferenceFND.h +++ b/src/lib/FileNodeData/RevisionManifestListReferenceFND.h @@ -0,0 +1,31 @@ +#ifndef REVISIONMANIFESTLISTREFERENCEFND_H +#define REVISIONMANIFESTLISTREFERENCEFND_H + +#include "IFileNodeData.h" +#include "../FileNodeChunkReference.h" + +namespace libone +{ + +class RevisionManifestListReferenceFND : public IFileNodeData +{ +private: + FileNodeChunkReference m_ref; + +public: + RevisionManifestListReferenceFND(StpFormat stpFormat, + CbFormat cbFormat); + + ~RevisionManifestListReferenceFND(); + + FileNodeChunkReference getRef() const; + void setRef(const FileNodeChunkReference &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONMANIFESTLISTREFERENCEFND_H diff --git a/src/lib/FileNodeData/RevisionManifestListStartFND.cpp b/src/lib/FileNodeData/RevisionManifestListStartFND.cpp new file mode 100644 index 0000000..d266ba1 --- /dev/null +++ b/src/lib/FileNodeData/RevisionManifestListStartFND.cpp @@ -0,0 +1,39 @@ +#include "RevisionManifestListStartFND.h" + +namespace libone +{ +RevisionManifestListStartFND::RevisionManifestListStartFND() : m_gosid(), m_nInstance() {} +RevisionManifestListStartFND::~RevisionManifestListStartFND() {} + +ExtendedGUID RevisionManifestListStartFND::getGosid() const +{ + return m_gosid; +} + +void RevisionManifestListStartFND::setGosid(const ExtendedGUID &value) +{ + m_gosid = value; +} + +uint32_t RevisionManifestListStartFND::getNInstance() const +{ + return m_nInstance; +} + +void RevisionManifestListStartFND::setNInstance(const uint32_t &value) +{ + m_nInstance = value; +} + +void RevisionManifestListStartFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_gosid; + input >> m_nInstance; +} + +std::string RevisionManifestListStartFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestListStartFND.h b/src/lib/FileNodeData/RevisionManifestListStartFND.h index e69de29..8cfc3c9 100644 --- a/src/lib/FileNodeData/RevisionManifestListStartFND.h +++ b/src/lib/FileNodeData/RevisionManifestListStartFND.h @@ -0,0 +1,34 @@ +#ifndef REVISIONMANIFESTLISTSTARTFND_H +#define REVISIONMANIFESTLISTSTARTFND_H + +#include "IFileNodeData.h" + +#include "../ExtendedGUID.h" + +namespace libone +{ + +class RevisionManifestListStartFND : public IFileNodeData +{ +private: + ExtendedGUID m_gosid; + + uint32_t m_nInstance; + +public: + RevisionManifestListStartFND(); + ~RevisionManifestListStartFND(); + + ExtendedGUID getGosid() const; + void setGosid(const ExtendedGUID &value); + uint32_t getNInstance() const; + void setNInstance(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONMANIFESTLISTSTARTFND_H diff --git a/src/lib/FileNodeData/RevisionManifestStart4FND.cpp b/src/lib/FileNodeData/RevisionManifestStart4FND.cpp new file mode 100644 index 0000000..a21cdce --- /dev/null +++ b/src/lib/FileNodeData/RevisionManifestStart4FND.cpp @@ -0,0 +1,73 @@ +#include "RevisionManifestStart4FND.h" + +namespace libone +{ + +RevisionManifestStart4FND::RevisionManifestStart4FND() : m_rid(), m_ridDependent(), + m_timeCreation(), m_revisionRole(), m_odcsDefault() {} + +ExtendedGUID RevisionManifestStart4FND::getRid() const +{ + return m_rid; +} + +void RevisionManifestStart4FND::setRid(const ExtendedGUID &value) +{ + m_rid = value; +} + +ExtendedGUID RevisionManifestStart4FND::getRidDependent() const +{ + return m_ridDependent; +} + +void RevisionManifestStart4FND::setRidDependent(const ExtendedGUID &value) +{ + m_ridDependent = value; +} + +uint64_t RevisionManifestStart4FND::getTimeCreation() const +{ + return m_timeCreation; +} + +void RevisionManifestStart4FND::setTimeCreation(const uint64_t &value) +{ + m_timeCreation = value; +} + +int32_t RevisionManifestStart4FND::getRevisionRole() const +{ + return m_revisionRole; +} + +void RevisionManifestStart4FND::setRevisionRole(const int32_t &value) +{ + m_revisionRole = value; +} + +uint16_t RevisionManifestStart4FND::getOdcsDefault() const +{ + return m_odcsDefault; +} + +void RevisionManifestStart4FND::setOdcsDefault(const uint16_t &value) +{ + m_odcsDefault = value; +} + +void RevisionManifestStart4FND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_rid; + input >> m_ridDependent; + input >> m_timeCreation; + input >> m_revisionRole; + input >> m_odcsDefault; +} + +std::string RevisionManifestStart4FND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart4FND.h b/src/lib/FileNodeData/RevisionManifestStart4FND.h index e69de29..62a9513 100644 --- a/src/lib/FileNodeData/RevisionManifestStart4FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart4FND.h @@ -0,0 +1,47 @@ +#ifndef REVISIONMANIFESTSTART4FND_H +#define REVISIONMANIFESTSTART4FND_H + + +#include "IFileNodeData.h" + +#include "../ExtendedGUID.h" + +namespace libone +{ + +class RevisionManifestStart4FND : public IFileNodeData +{ +private: + ExtendedGUID m_rid; + ExtendedGUID m_ridDependent; + + uint64_t m_timeCreation; + int32_t m_revisionRole; + uint16_t m_odcsDefault; + +public: + RevisionManifestStart4FND(); + + uint16_t getOdcsDefault() const; + void setOdcsDefault(const uint16_t &value); + + int32_t getRevisionRole() const; + void setRevisionRole(const int32_t &value); + + uint64_t getTimeCreation() const; + void setTimeCreation(const uint64_t &value); + + ExtendedGUID getRidDependent() const; + void setRidDependent(const ExtendedGUID &value); + + ExtendedGUID getRid() const; + void setRid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONMANIFESTSTART4FND_H diff --git a/src/lib/FileNodeData/RevisionManifestStart6FND.cpp b/src/lib/FileNodeData/RevisionManifestStart6FND.cpp new file mode 100644 index 0000000..f996acc --- /dev/null +++ b/src/lib/FileNodeData/RevisionManifestStart6FND.cpp @@ -0,0 +1,61 @@ +#include "RevisionManifestStart6FND.h" + +namespace libone +{ + +RevisionManifestStart6FND::RevisionManifestStart6FND() : m_rid(), m_ridDependent(), m_revisionRole(), m_odcsDefault() {} + +ExtendedGUID RevisionManifestStart6FND::getRid() const +{ + return m_rid; +} + +void RevisionManifestStart6FND::setRid(const ExtendedGUID &value) +{ + m_rid = value; +} + +ExtendedGUID RevisionManifestStart6FND::getRidDependent() const +{ + return m_ridDependent; +} + +void RevisionManifestStart6FND::setRidDependent(const ExtendedGUID &value) +{ + m_ridDependent = value; +} + +int32_t RevisionManifestStart6FND::getRevisionRole() const +{ + return m_revisionRole; +} + +void RevisionManifestStart6FND::setRevisionRole(const int32_t &value) +{ + m_revisionRole = value; +} + +uint16_t RevisionManifestStart6FND::getOdcsDefault() const +{ + return m_odcsDefault; +} + +void RevisionManifestStart6FND::setOdcsDefault(const uint16_t &value) +{ + m_odcsDefault = value; +} + +void RevisionManifestStart6FND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_rid; + input >> m_ridDependent; + input >> m_revisionRole; + input >> m_odcsDefault; +} + +std::string RevisionManifestStart6FND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart6FND.h b/src/lib/FileNodeData/RevisionManifestStart6FND.h index e69de29..7f5fd6a 100644 --- a/src/lib/FileNodeData/RevisionManifestStart6FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart6FND.h @@ -0,0 +1,41 @@ +#ifndef REVISIONMANIFESTSTART6FND_H +#define REVISIONMANIFESTSTART6FND_H + +#include "IFileNodeData.h" +#include "../ExtendedGUID.h" + +namespace libone +{ + +class RevisionManifestStart6FND : public IFileNodeData +{ +private: + ExtendedGUID m_rid; + ExtendedGUID m_ridDependent; + + int32_t m_revisionRole; + uint16_t m_odcsDefault; + +public: + RevisionManifestStart6FND(); + + uint16_t getOdcsDefault() const; + void setOdcsDefault(const uint16_t &value); + + int32_t getRevisionRole() const; + void setRevisionRole(const int32_t &value); + + ExtendedGUID getRidDependent() const; + void setRidDependent(const ExtendedGUID &value); + + ExtendedGUID getRid() const; + void setRid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONMANIFESTSTART6FND_H diff --git a/src/lib/FileNodeData/RevisionManifestStart7FND.cpp b/src/lib/FileNodeData/RevisionManifestStart7FND.cpp new file mode 100644 index 0000000..ac6054e --- /dev/null +++ b/src/lib/FileNodeData/RevisionManifestStart7FND.cpp @@ -0,0 +1,39 @@ +#include "RevisionManifestStart7FND.h" + +namespace libone +{ +RevisionManifestStart7FND::RevisionManifestStart7FND() : m_base(), m_gctxid() {} + +ExtendedGUID RevisionManifestStart7FND::getGctxid() const +{ + return m_gctxid; +} + +void RevisionManifestStart7FND::setGctxid(const ExtendedGUID &value) +{ + m_gctxid = value; +} + +RevisionManifestStart6FND RevisionManifestStart7FND::getBase() const +{ + return m_base; +} + +void RevisionManifestStart7FND::setBase( + const RevisionManifestStart6FND &value) +{ + m_base = value; +} + +void RevisionManifestStart7FND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_base; + input >> m_gctxid; +} + +std::string RevisionManifestStart7FND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart7FND.h b/src/lib/FileNodeData/RevisionManifestStart7FND.h index e69de29..445aad3 100644 --- a/src/lib/FileNodeData/RevisionManifestStart7FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart7FND.h @@ -0,0 +1,34 @@ +#ifndef REVISIONMANIFESTSTART7FND_H +#define REVISIONMANIFESTSTART7FND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" +#include "RevisionManifestStart6FND.h" + +namespace libone +{ + +class RevisionManifestStart7FND : public IFileNodeData +{ +private: + RevisionManifestStart6FND m_base; + + ExtendedGUID m_gctxid; + +public: + RevisionManifestStart7FND(); + + RevisionManifestStart6FND getBase() const; + void setBase(const RevisionManifestStart6FND &value); + + ExtendedGUID getGctxid() const; + void setGctxid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONMANIFESTSTART7FND_H diff --git a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.cpp b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.cpp new file mode 100644 index 0000000..2347e64 --- /dev/null +++ b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.cpp @@ -0,0 +1,42 @@ +#include "RevisionRoleAndContextDeclarationFND.h" + +namespace libone +{ + +RevisionRoleAndContextDeclarationFND::RevisionRoleAndContextDeclarationFND() :m_base(), m_gctxid() {} + +ExtendedGUID RevisionRoleAndContextDeclarationFND::getGctxid() const +{ + return m_gctxid; +} + +void RevisionRoleAndContextDeclarationFND::setGctxid( + const ExtendedGUID &value) +{ + m_gctxid = value; +} + +RevisionRoleDeclarationFND +RevisionRoleAndContextDeclarationFND::getBase() const +{ + return m_base; +} + +void RevisionRoleAndContextDeclarationFND::setBase( + const RevisionRoleDeclarationFND &value) +{ + m_base = value; +} + +void RevisionRoleAndContextDeclarationFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_base; + input >> m_gctxid; +} + +std::string RevisionRoleAndContextDeclarationFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h index e69de29..f1d63c4 100644 --- a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h +++ b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h @@ -0,0 +1,34 @@ +#ifndef REVISIONROLEANDCONTEXTDECLARATIONFND_H +#define REVISIONROLEANDCONTEXTDECLARATIONFND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" +#include "RevisionRoleDeclarationFND.h" + +namespace libone +{ + +class RevisionRoleAndContextDeclarationFND : public IFileNodeData +{ +private: + RevisionRoleDeclarationFND m_base; + + ExtendedGUID m_gctxid; + +public: + RevisionRoleAndContextDeclarationFND(); + + RevisionRoleDeclarationFND getBase() const; + void setBase(const RevisionRoleDeclarationFND &value); + + ExtendedGUID getGctxid() const; + void setGctxid(const ExtendedGUID &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONROLEANDCONTEXTDECLARATIONFND_H diff --git a/src/lib/FileNodeData/RevisionRoleDeclarationFND.cpp b/src/lib/FileNodeData/RevisionRoleDeclarationFND.cpp new file mode 100644 index 0000000..a23689e --- /dev/null +++ b/src/lib/FileNodeData/RevisionRoleDeclarationFND.cpp @@ -0,0 +1,38 @@ +#include "RevisionRoleDeclarationFND.h" + +namespace libone +{ +RevisionRoleDeclarationFND::RevisionRoleDeclarationFND(): m_rid(), m_RevisionRole() {} + +uint32_t RevisionRoleDeclarationFND::getRevisionRole() const +{ + return m_RevisionRole; +} + +void RevisionRoleDeclarationFND::setRevisionRole(const uint32_t &value) +{ + m_RevisionRole = value; +} + +ExtendedGUID RevisionRoleDeclarationFND::getRid() const +{ + return m_rid; +} + +void RevisionRoleDeclarationFND::setRid(const ExtendedGUID &value) +{ + m_rid = value; +} + +void RevisionRoleDeclarationFND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_rid; + input >> m_RevisionRole; +} + +std::string RevisionRoleDeclarationFND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RevisionRoleDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleDeclarationFND.h index e69de29..3d3341d 100644 --- a/src/lib/FileNodeData/RevisionRoleDeclarationFND.h +++ b/src/lib/FileNodeData/RevisionRoleDeclarationFND.h @@ -0,0 +1,32 @@ +#ifndef REVISIONROLEDECLARATIONFND_H +#define REVISIONROLEDECLARATIONFND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class RevisionRoleDeclarationFND : public IFileNodeData +{ +private: + ExtendedGUID m_rid; + uint32_t m_RevisionRole; + +public: + RevisionRoleDeclarationFND(); + + ExtendedGUID getRid() const; + void setRid(const ExtendedGUID &value); + + uint32_t getRevisionRole() const; + void setRevisionRole(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // REVISIONROLEDECLARATIONFND_H diff --git a/src/lib/FileNodeData/RootObjectReference2FNDX.cpp b/src/lib/FileNodeData/RootObjectReference2FNDX.cpp new file mode 100644 index 0000000..7260a82 --- /dev/null +++ b/src/lib/FileNodeData/RootObjectReference2FNDX.cpp @@ -0,0 +1,40 @@ +#include "RootObjectReference2FNDX.h" + +namespace libone +{ + +RootObjectReference2FNDX::RootObjectReference2FNDX() : + m_oidRoot(), m_RootRole(0) {} + +CompactID RootObjectReference2FNDX::getOidRoot() const +{ + return m_oidRoot; +} + +void RootObjectReference2FNDX::setOidRoot(const CompactID &value) +{ + m_oidRoot = value; +} + +uint32_t RootObjectReference2FNDX::getRootRole() const +{ + return m_RootRole; +} + +void RootObjectReference2FNDX::setRootRole(const uint32_t &value) +{ + m_RootRole = value; +} + +void RootObjectReference2FNDX::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oidRoot; + input >> m_RootRole; +} + +std::string RootObjectReference2FNDX::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RootObjectReference2FNDX.h b/src/lib/FileNodeData/RootObjectReference2FNDX.h index e69de29..b1fd4f6 100644 --- a/src/lib/FileNodeData/RootObjectReference2FNDX.h +++ b/src/lib/FileNodeData/RootObjectReference2FNDX.h @@ -0,0 +1,32 @@ +#ifndef ROOTOBJECTREFERENCE2FNDX_H +#define ROOTOBJECTREFERENCE2FNDX_H + +#include "../CompactID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class RootObjectReference2FNDX : public IFileNodeData +{ +private: + CompactID m_oidRoot; + uint32_t m_RootRole; + +public: + RootObjectReference2FNDX(); + + CompactID getOidRoot() const; + void setOidRoot(const CompactID &value); + + uint32_t getRootRole() const; + void setRootRole(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // ROOTOBJECTREFERENCE2FNDX_H diff --git a/src/lib/FileNodeData/RootObjectReference3FND.cpp b/src/lib/FileNodeData/RootObjectReference3FND.cpp new file mode 100644 index 0000000..4f22dd7 --- /dev/null +++ b/src/lib/FileNodeData/RootObjectReference3FND.cpp @@ -0,0 +1,38 @@ +#include "RootObjectReference3FND.h" + +namespace libone +{ +RootObjectReference3FND::RootObjectReference3FND() :m_oidRoot(), m_RootRole(0) {} + +uint32_t RootObjectReference3FND::getRootRole() const +{ + return m_RootRole; +} + +void RootObjectReference3FND::setRootRole(const uint32_t &value) +{ + m_RootRole = value; +} + +ExtendedGUID RootObjectReference3FND::getOidRoot() const +{ + return m_oidRoot; +} + +void RootObjectReference3FND::setOidRoot(const ExtendedGUID &value) +{ + m_oidRoot = value; +} + +void RootObjectReference3FND::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oidRoot; + input >> m_RootRole; +} + +std::string RootObjectReference3FND::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/FileNodeData/RootObjectReference3FND.h b/src/lib/FileNodeData/RootObjectReference3FND.h index e69de29..2cb93c4 100644 --- a/src/lib/FileNodeData/RootObjectReference3FND.h +++ b/src/lib/FileNodeData/RootObjectReference3FND.h @@ -0,0 +1,32 @@ +#ifndef ROOTOBJECTREFERENCE3FND_H +#define ROOTOBJECTREFERENCE3FND_H + +#include "../ExtendedGUID.h" +#include "IFileNodeData.h" + +namespace libone +{ + +class RootObjectReference3FND : public IFileNodeData +{ +private: + ExtendedGUID m_oidRoot; + uint32_t m_RootRole; + +public: + RootObjectReference3FND(); + + ExtendedGUID getOidRoot() const; + void setOidRoot(const ExtendedGUID &value); + + uint32_t getRootRole() const; + void setRootRole(const uint32_t &value); + + void parse(const libone::RVNGInputStreamPtr_t &input) override; + + std::string to_string() const override; +}; + +} // namespace libone + +#endif // ROOTOBJECTREFERENCE3FND_H diff --git a/src/lib/FileNodeData/meson.build b/src/lib/FileNodeData/meson.build index ec3f35c..bacee7f 100644 --- a/src/lib/FileNodeData/meson.build +++ b/src/lib/FileNodeData/meson.build @@ -1,4 +1,72 @@ libone_source_files += files( 'IFileNodeData.h', 'IFileNodeData.cpp', + 'DataSignatureGroupDefinitionFND.h', + 'DataSignatureGroupDefinitionFND.cpp', + 'FileDataStoreListReferenceFND.h', + 'FileDataStoreListReferenceFND.cpp', + 'FileDataStoreObjectReferenceFND.h', + 'FileDataStoreObjectReferenceFND.cpp', + 'GlobalIdTableEntry2FNDX.h', + 'GlobalIdTableEntry2FNDX.cpp', + 'GlobalIdTableEntry3FNDX.h', + 'GlobalIdTableEntry3FNDX.cpp', + 'GlobalIdTableEntryFNDX.h', + 'GlobalIdTableEntryFNDX.cpp', + 'GlobalIdTableStartFNDX.h', + 'GlobalIdTableStartFNDX.cpp', + 'HashedChunkDescriptor2FND.h', + 'HashedChunkDescriptor2FND.cpp', + 'ObjectDataEncryptionKeyV2FNDX.h', + 'ObjectDataEncryptionKeyV2FNDX.cpp', + 'ObjectDeclaration2LargeRefCountFND.h', + 'ObjectDeclaration2LargeRefCountFND.cpp', + 'ObjectDeclaration2RefCountFND.h', + 'ObjectDeclaration2RefCountFND.cpp', + 'ObjectDeclarationFileData3LargeRefCountFND.h', + 'ObjectDeclarationFileData3LargeRefCountFND.cpp', + 'ObjectDeclarationFileData3RefCountFND.h', + 'ObjectDeclarationFileData3RefCountFND.cpp', + 'ObjectDeclarationWithRefCount2FNDX.h', + 'ObjectDeclarationWithRefCount2FNDX.cpp', + 'ObjectDeclarationWithRefCountFNDX.h', + 'ObjectDeclarationWithRefCountFNDX.cpp', + 'ObjectGroupListReferenceFND.h', + 'ObjectGroupListReferenceFND.cpp', + 'ObjectGroupStartFND.h', + 'ObjectGroupStartFND.cpp', + 'ObjectInfoDependencyOverridesFND.h', + 'ObjectInfoDependencyOverridesFND.cpp', + 'ObjectRevisionWithRefCount2FNDX.h', + 'ObjectRevisionWithRefCount2FNDX.cpp', + 'ObjectRevisionWithRefCountFNDX.h', + 'ObjectRevisionWithRefCountFNDX.cpp', + 'ObjectSpaceManifestListReferenceFND.h', + 'ObjectSpaceManifestListReferenceFND.cpp', + 'ObjectSpaceManifestListStartFND.h', + 'ObjectSpaceManifestListStartFND.cpp', + 'ObjectSpaceManifestRootFND.h', + 'ObjectSpaceManifestRootFND.cpp', + 'ReadOnlyObjectDeclaration2LargeRefCountFND.h', + 'ReadOnlyObjectDeclaration2LargeRefCountFND.cpp', + 'ReadOnlyObjectDeclaration2RefCountFND.h', + 'ReadOnlyObjectDeclaration2RefCountFND.cpp', + 'RevisionManifestListReferenceFND.h', + 'RevisionManifestListReferenceFND.cpp', + 'RevisionManifestListStartFND.h', + 'RevisionManifestListStartFND.cpp', + 'RevisionManifestStart4FND.h', + 'RevisionManifestStart4FND.cpp', + 'RevisionManifestStart6FND.h', + 'RevisionManifestStart6FND.cpp', + 'RevisionManifestStart7FND.h', + 'RevisionManifestStart7FND.cpp', + 'RevisionRoleAndContextDeclarationFND.h', + 'RevisionRoleAndContextDeclarationFND.cpp', + 'RevisionRoleDeclarationFND.h', + 'RevisionRoleDeclarationFND.cpp', + 'RootObjectReference2FNDX.h', + 'RootObjectReference2FNDX.cpp', + 'RootObjectReference3FND.h', + 'RootObjectReference3FND.cpp', ) From 384476066e0cfb1028a53dfa9ef21d5dfadf535b Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Tue, 25 Aug 2020 00:53:52 +0200 Subject: [PATCH 12/21] Add ObjectInfoDependency classes --- src/lib/ObjectInfoDependencyOverride32.cpp | 46 +++++++++ src/lib/ObjectInfoDependencyOverride32.h | 34 +++++++ src/lib/ObjectInfoDependencyOverride8.cpp | 46 +++++++++ src/lib/ObjectInfoDependencyOverride8.h | 33 ++++++ src/lib/ObjectInfoDependencyOverrideData.cpp | 100 +++++++++++++++++++ src/lib/ObjectInfoDependencyOverrideData.h | 54 ++++++++++ src/lib/meson.build | 6 ++ 7 files changed, 319 insertions(+) create mode 100644 src/lib/ObjectInfoDependencyOverride32.cpp create mode 100644 src/lib/ObjectInfoDependencyOverride32.h create mode 100644 src/lib/ObjectInfoDependencyOverride8.cpp create mode 100644 src/lib/ObjectInfoDependencyOverride8.h create mode 100644 src/lib/ObjectInfoDependencyOverrideData.cpp create mode 100644 src/lib/ObjectInfoDependencyOverrideData.h diff --git a/src/lib/ObjectInfoDependencyOverride32.cpp b/src/lib/ObjectInfoDependencyOverride32.cpp new file mode 100644 index 0000000..ed67f22 --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverride32.cpp @@ -0,0 +1,46 @@ +#include "ObjectInfoDependencyOverride32.h" + +namespace libone +{ + +ObjectInfoDependencyOverride32::ObjectInfoDependencyOverride32() : m_oid(), m_cRef() {} + + +CompactID ObjectInfoDependencyOverride32::oid() const +{ + return m_oid; +} + +void ObjectInfoDependencyOverride32::setOid(const CompactID &oid) +{ + m_oid = oid; +} + +uint32_t ObjectInfoDependencyOverride32::cRef() const +{ + return m_cRef; +} + +void ObjectInfoDependencyOverride32::setCRef(const uint32_t &cRef) +{ + m_cRef = cRef; +} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, ObjectInfoDependencyOverride32 &obj) +{ + obj.parse(input); + return input; +} + +void ObjectInfoDependencyOverride32::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + input >> m_cRef; +} + +std::string ObjectInfoDependencyOverride32::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/ObjectInfoDependencyOverride32.h b/src/lib/ObjectInfoDependencyOverride32.h new file mode 100644 index 0000000..0a4289e --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverride32.h @@ -0,0 +1,34 @@ +#ifndef OBJECTINFODEPENDENCYOVERRIDE32_H +#define OBJECTINFODEPENDENCYOVERRIDE32_H + +#include "CompactID.h" + +namespace libone +{ + +class ObjectInfoDependencyOverride32 +{ +private: + CompactID m_oid; + uint32_t m_cRef; + +public: + ObjectInfoDependencyOverride32(); + + CompactID oid() const; + void setOid(const CompactID &oid); + + uint32_t cRef() const; + void setCRef(const uint32_t &cRef); + + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectInfoDependencyOverride32 &obj); + void parse(const libone::RVNGInputStreamPtr_t &input); + + std::string to_string() const; +}; + +} // namespace libone + +#endif // OBJECTINFODEPENDENCYOVERRIDE32_H diff --git a/src/lib/ObjectInfoDependencyOverride8.cpp b/src/lib/ObjectInfoDependencyOverride8.cpp new file mode 100644 index 0000000..cfe0a46 --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverride8.cpp @@ -0,0 +1,46 @@ +#include "ObjectInfoDependencyOverride8.h" + +namespace libone +{ + +ObjectInfoDependencyOverride8::ObjectInfoDependencyOverride8() : m_oid(), m_cRef() {} + + +CompactID ObjectInfoDependencyOverride8::oid() const +{ + return m_oid; +} + +void ObjectInfoDependencyOverride8::setOid(const CompactID &oid) +{ + m_oid = oid; +} + +uint8_t ObjectInfoDependencyOverride8::cRef() const +{ + return m_cRef; +} + +void ObjectInfoDependencyOverride8::setCRef(const uint8_t &cRef) +{ + m_cRef = cRef; +} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, ObjectInfoDependencyOverride8 &obj) +{ + obj.parse(input); + return input; +} + +void ObjectInfoDependencyOverride8::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + input >> m_cRef; +} + +std::string ObjectInfoDependencyOverride8::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/ObjectInfoDependencyOverride8.h b/src/lib/ObjectInfoDependencyOverride8.h new file mode 100644 index 0000000..1bcc97e --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverride8.h @@ -0,0 +1,33 @@ +#ifndef OBJECTINFODEPENDENCYOVERRIDE8_H +#define OBJECTINFODEPENDENCYOVERRIDE8_H + +#include "CompactID.h" + +namespace libone +{ + +class ObjectInfoDependencyOverride8 +{ +private: + CompactID m_oid; + uint8_t m_cRef; + +public: + ObjectInfoDependencyOverride8(); + + CompactID oid() const; + void setOid(const CompactID &oid); + + uint8_t cRef() const; + void setCRef(const uint8_t &cRef); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectInfoDependencyOverride8 &obj); + void parse(const libone::RVNGInputStreamPtr_t &input); + + std::string to_string() const; +}; + +} // namespace libone + +#endif // OBJECTINFODEPENDENCYOVERRIDE8_H diff --git a/src/lib/ObjectInfoDependencyOverrideData.cpp b/src/lib/ObjectInfoDependencyOverrideData.cpp new file mode 100644 index 0000000..6756a73 --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverrideData.cpp @@ -0,0 +1,100 @@ +#include "ObjectInfoDependencyOverrideData.h" + +namespace libone +{ + +ObjectInfoDependencyOverrideData::ObjectInfoDependencyOverrideData() + : m_c8BitOverrides(), m_c32BitOverrides(), m_crc(), m_Overrides1{}, m_Overrides2{} {} + + +uint32_t ObjectInfoDependencyOverrideData::c8BitOverrides() const +{ + return m_c8BitOverrides; +} + +void ObjectInfoDependencyOverrideData::setC8BitOverrides( + const uint32_t &c8BitOverrides) +{ + m_c8BitOverrides = c8BitOverrides; +} + +uint32_t ObjectInfoDependencyOverrideData::c32BitOverrides() const +{ + return m_c32BitOverrides; +} + +void ObjectInfoDependencyOverrideData::setC32BitOverrides( + const uint32_t &c32BitOverrides) +{ + m_c32BitOverrides = c32BitOverrides; +} + +uint32_t ObjectInfoDependencyOverrideData::crc() const +{ + return m_crc; +} + +void ObjectInfoDependencyOverrideData::setCrc(const uint32_t &crc) +{ + m_crc = crc; +} + +std::vector +ObjectInfoDependencyOverrideData::Overrides1() const +{ + return m_Overrides1; +} + +void ObjectInfoDependencyOverrideData::setOverrides1( + const std::vector &Overrides1) +{ + m_Overrides1 = Overrides1; +} + +std::vector +ObjectInfoDependencyOverrideData::Overrides2() const +{ + return m_Overrides2; +} + +void ObjectInfoDependencyOverrideData::setOverrides2( + const std::vector &Overrides2) +{ + m_Overrides2 = Overrides2; +} + + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectInfoDependencyOverrideData &obj) +{ + obj.parse(input); + return input; +} + +void ObjectInfoDependencyOverrideData::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_c8BitOverrides; + input >> m_c32BitOverrides; + input >> m_crc; + + ObjectInfoDependencyOverride8 temp8; + for (size_t i{0}; i < m_c8BitOverrides; i++) + { + input >> temp8; + m_Overrides1.push_back(temp8); + } + + ObjectInfoDependencyOverride32 temp32; + for (size_t i{0}; i < m_c8BitOverrides; i++) + { + input >> temp32; + m_Overrides2.push_back(temp32); + } +} + +std::string ObjectInfoDependencyOverrideData::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/ObjectInfoDependencyOverrideData.h b/src/lib/ObjectInfoDependencyOverrideData.h new file mode 100644 index 0000000..0a74bc9 --- /dev/null +++ b/src/lib/ObjectInfoDependencyOverrideData.h @@ -0,0 +1,54 @@ +#ifndef OBJECTINFODEPENDENCYOVERRIDEDATA_H +#define OBJECTINFODEPENDENCYOVERRIDEDATA_H + +#include + +#include "ObjectInfoDependencyOverride32.h" +#include "ObjectInfoDependencyOverride8.h" + +namespace libone +{ + +class ObjectInfoDependencyOverrideData +{ +private: + uint32_t m_c8BitOverrides; + uint32_t m_c32BitOverrides; + + uint32_t m_crc; + + std::vector m_Overrides1; + std::vector m_Overrides2; + +public: + ObjectInfoDependencyOverrideData(); + + + uint32_t c8BitOverrides() const; + void setC8BitOverrides(const uint32_t &c8BitOverrides); + + uint32_t c32BitOverrides() const; + void setC32BitOverrides(const uint32_t &c32BitOverrides); + + uint32_t crc() const; + void setCrc(const uint32_t &crc); + + std::vector Overrides1() const; + void + setOverrides1(const std::vector &Overrides1); + + std::vector Overrides2() const; + void + setOverrides2(const std::vector &Overrides2); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectInfoDependencyOverrideData &obj); + + void parse(const libone::RVNGInputStreamPtr_t &input); + + std::string to_string() const; +}; + +} // namespace libone + +#endif // OBJECTINFODEPENDENCYOVERRIDEDATA_H diff --git a/src/lib/meson.build b/src/lib/meson.build index b12b993..3329d08 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -33,6 +33,12 @@ libone_source_files = [ 'JCID.cpp', 'OneNoteParser.h', 'OneNoteParser.cpp', + 'ObjectInfoDependencyOverride32.cpp', + 'ObjectInfoDependencyOverride32.h', + 'ObjectInfoDependencyOverride8.cpp', + 'ObjectInfoDependencyOverride8.h', + 'ObjectInfoDependencyOverrideData.cpp', + 'ObjectInfoDependencyOverrideData.h', 'PropertySet.h', 'PropertySet.cpp', 'PropertyID.h', From 7c941b7a0c65432c8404d81468d61931866bcaec Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Tue, 25 Aug 2020 01:01:27 +0200 Subject: [PATCH 13/21] Add ObjectDeclaration* classes --- src/lib/ObjectDeclaration2Body.cpp | 70 ++++++++++++++++ src/lib/ObjectDeclaration2Body.h | 42 ++++++++++ src/lib/ObjectDeclarationWithRefCountBody.cpp | 82 +++++++++++++++++++ src/lib/ObjectDeclarationWithRefCountBody.h | 53 ++++++++++++ src/lib/meson.build | 4 + 5 files changed, 251 insertions(+) create mode 100644 src/lib/ObjectDeclaration2Body.cpp create mode 100644 src/lib/ObjectDeclaration2Body.h create mode 100644 src/lib/ObjectDeclarationWithRefCountBody.cpp create mode 100644 src/lib/ObjectDeclarationWithRefCountBody.h diff --git a/src/lib/ObjectDeclaration2Body.cpp b/src/lib/ObjectDeclaration2Body.cpp new file mode 100644 index 0000000..11434d8 --- /dev/null +++ b/src/lib/ObjectDeclaration2Body.cpp @@ -0,0 +1,70 @@ +#include "ObjectDeclaration2Body.h" + +namespace libone +{ + +ObjectDeclaration2Body::ObjectDeclaration2Body() :m_oid(), m_jcid(), m_fHasOidReferences(false), m_fHasOsidReferences(false) {} + +bool ObjectDeclaration2Body::getFHasOsidReferences() const +{ + return m_fHasOsidReferences; +} + +void ObjectDeclaration2Body::setFHasOsidReferences(bool value) +{ + m_fHasOsidReferences = value; +} + +bool ObjectDeclaration2Body::getFHasOidReferences() const +{ + return m_fHasOidReferences; +} + +void ObjectDeclaration2Body::setFHasOidReferences(bool value) +{ + m_fHasOidReferences = value; +} + +JCID ObjectDeclaration2Body::getJcid() const +{ + return m_jcid; +} + +void ObjectDeclaration2Body::setJcid(const JCID &value) +{ + m_jcid = value; +} + +CompactID ObjectDeclaration2Body::getOid() const +{ + return m_oid; +} + +void ObjectDeclaration2Body::setOid(const CompactID &value) +{ + m_oid = value; +} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, ObjectDeclaration2Body &obj) +{ + obj.parse(input); + return input; +} + +void ObjectDeclaration2Body::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + input >> m_jcid; + + uint8_t temp; + input >> temp; + m_fHasOidReferences = temp & 0x1; + m_fHasOsidReferences = (temp >> 1) & 0x1; +} + +std::string ObjectDeclaration2Body::to_string() const +{ + return ""; +} + +} // namespace libone diff --git a/src/lib/ObjectDeclaration2Body.h b/src/lib/ObjectDeclaration2Body.h new file mode 100644 index 0000000..20350cc --- /dev/null +++ b/src/lib/ObjectDeclaration2Body.h @@ -0,0 +1,42 @@ +#ifndef OBJECTDECLARATION2BODY_H +#define OBJECTDECLARATION2BODY_H + +#include "CompactID.h" +#include "JCID.h" + +#include "libone_utils.h" + +namespace libone +{ + +class ObjectDeclaration2Body +{ +private: + CompactID m_oid; + JCID m_jcid; + + bool m_fHasOidReferences; + bool m_fHasOsidReferences; + +public: + ObjectDeclaration2Body(); + + CompactID getOid() const; + void setOid(const CompactID &value); + JCID getJcid() const; + void setJcid(const JCID &value); + bool getFHasOidReferences() const; + void setFHasOidReferences(bool value); + bool getFHasOsidReferences() const; + void setFHasOsidReferences(bool value); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, ObjectDeclaration2Body &obj); + + void parse(const libone::RVNGInputStreamPtr_t &input); + + std::string to_string() const; +}; + +} // namespace libone + +#endif // OBJECTDECLARATION2BODY_H diff --git a/src/lib/ObjectDeclarationWithRefCountBody.cpp b/src/lib/ObjectDeclarationWithRefCountBody.cpp new file mode 100644 index 0000000..6232286 --- /dev/null +++ b/src/lib/ObjectDeclarationWithRefCountBody.cpp @@ -0,0 +1,82 @@ +#include "ObjectDeclarationWithRefCountBody.h" + +namespace libone +{ + +ObjectDeclarationWithRefCountBody::ObjectDeclarationWithRefCountBody() + : m_oid(), m_jci(), m_odcs(), m_fReserved1(), + m_fHasOidReferences(false), m_fHasOsidReferences(false), m_fReserved2() {} + +bool ObjectDeclarationWithRefCountBody::getFHasOsidReferences() const +{ + return m_fHasOsidReferences; +} + +void ObjectDeclarationWithRefCountBody::setFHasOsidReferences(bool value) +{ + m_fHasOsidReferences = value; +} + +bool ObjectDeclarationWithRefCountBody::getFHasOidReferences() const +{ + return m_fHasOidReferences; +} + +void ObjectDeclarationWithRefCountBody::setFHasOidReferences(bool value) +{ + m_fHasOidReferences = value; +} + +uint8_t ObjectDeclarationWithRefCountBody::getOdc() const +{ + return m_odcs; +} + +void ObjectDeclarationWithRefCountBody::setOdc(const uint8_t &value) +{ + m_odcs = value; +} + +uint8_t ObjectDeclarationWithRefCountBody::getJci() const +{ + return m_jci; +} + +void ObjectDeclarationWithRefCountBody::setJci(const uint8_t &value) +{ + m_jci = value; +} + +CompactID ObjectDeclarationWithRefCountBody::getOid() const +{ + return m_oid; +} + +void ObjectDeclarationWithRefCountBody::setOid(const CompactID &value) +{ + m_oid = value; +} + +const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectDeclarationWithRefCountBody &obj) +{ + obj.parse(input); + return input; +} + +void ObjectDeclarationWithRefCountBody::parse(const libone::RVNGInputStreamPtr_t &input) +{ + input >> m_oid; + uint32_t temp; + + input >> temp; + m_jci = temp & 0x3FF; + m_odcs = (temp >> 10) & 0xF; + m_fReserved1 = (temp >> 14) & 0x3; + m_fHasOidReferences = (temp >> 16) & 0x1; + m_fHasOsidReferences = (temp >> 17) & 0x1; + + skip(input, 2u); +} + +} // namespace libone diff --git a/src/lib/ObjectDeclarationWithRefCountBody.h b/src/lib/ObjectDeclarationWithRefCountBody.h new file mode 100644 index 0000000..a12eb21 --- /dev/null +++ b/src/lib/ObjectDeclarationWithRefCountBody.h @@ -0,0 +1,53 @@ +#ifndef OBJECTDECLARATIONWITHREFCOUNTBODY_H +#define OBJECTDECLARATIONWITHREFCOUNTBODY_H + +#include "CompactID.h" + +namespace libone +{ + +class ObjectDeclarationWithRefCountBody +{ +private: + CompactID m_oid; + + uint8_t m_jci; + uint8_t m_odcs; + + uint8_t m_fReserved1; + + bool m_fHasOidReferences; + bool m_fHasOsidReferences; + + uint32_t m_fReserved2; + +public: + ObjectDeclarationWithRefCountBody(); + + + CompactID getOid() const; + void setOid(const CompactID &value); + + uint8_t getJci() const; + void setJci(const uint8_t &value); + + uint8_t getOdc() const; + void setOdc(const uint8_t &value); + + bool getFHasOidReferences() const; + void setFHasOidReferences(bool value); + + bool getFHasOsidReferences() const; + void setFHasOsidReferences(bool value); + + friend const libone::RVNGInputStreamPtr_t &operator>>(const libone::RVNGInputStreamPtr_t &input, + ObjectDeclarationWithRefCountBody &obj); + + void parse(const libone::RVNGInputStreamPtr_t &input); + + std::string to_string() const; +}; + +} // namespace libone + +#endif // OBJECTDECLARATIONWITHREFCOUNTBODY_H diff --git a/src/lib/meson.build b/src/lib/meson.build index 3329d08..e654956 100644 --- a/src/lib/meson.build +++ b/src/lib/meson.build @@ -39,6 +39,10 @@ libone_source_files = [ 'ObjectInfoDependencyOverride8.h', 'ObjectInfoDependencyOverrideData.cpp', 'ObjectInfoDependencyOverrideData.h', + 'ObjectDeclaration2Body.cpp', + 'ObjectDeclaration2Body.h', + 'ObjectDeclarationWithRefCountBody.cpp', + 'ObjectDeclarationWithRefCountBody.h', 'PropertySet.h', 'PropertySet.cpp', 'PropertyID.h', From 8af2e2d74901bdbd8dfeb0ad0e03eee17399863b Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Tue, 25 Aug 2020 01:07:40 +0200 Subject: [PATCH 14/21] JCID: modify ctor to get empty, implicit ctor --- src/lib/JCID.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/JCID.h b/src/lib/JCID.h index 59b6377..85b6374 100644 --- a/src/lib/JCID.h +++ b/src/lib/JCID.h @@ -22,7 +22,7 @@ namespace libone class JCID { public: - JCID(const uint32_t val) + JCID(const uint32_t val = 0) { value = val; } From 797b8b581afccf0d79368798421d8782d35837c7 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Thu, 27 Aug 2020 15:28:20 +0200 Subject: [PATCH 15/21] Add Parsing method for FileNodeListFragment tree --- src/lib/FileNodeListFragment.cpp | 33 +++++++++++++++++++++++++++++++- src/lib/FileNodeListFragment.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/lib/FileNodeListFragment.cpp b/src/lib/FileNodeListFragment.cpp index eaa4a04..8c3675a 100644 --- a/src/lib/FileNodeListFragment.cpp +++ b/src/lib/FileNodeListFragment.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -123,6 +124,36 @@ std::string FileNodeListFragment::to_string() { return std::string(); } -} +std::vector parseFileNodeListFragments(const libone::RVNGInputStreamPtr_t &input, const FileChunkReference &ref) +{ + uint64_t originalLocation = input->tell(); + + std::vector fragments {}; + + + input->seek(ref.get_location(), librevenge::RVNG_SEEK_SET); + FileNodeListFragment fragment(ref.get_location(), ref.get_size()); + + fragment.parse(input); + fragments.push_back(fragment); + + + FileChunkReference nextFragmentRef = fragment.get_next_fragment(); + while (!nextFragmentRef.is_fcrNil() && !nextFragmentRef.is_fcrZero()) + { + FileNodeListFragment nextFragment(nextFragmentRef.get_location(), nextFragmentRef.get_size()); + input->seek(nextFragmentRef.get_location(), librevenge::RVNG_SEEK_SET); + fragment.parse(input); + + nextFragmentRef = nextFragment.get_next_fragment(); + fragments.push_back(fragment); + } + + + input->seek(originalLocation, librevenge::RVNG_SEEK_SET); + return fragments; +} + +} diff --git a/src/lib/FileNodeListFragment.h b/src/lib/FileNodeListFragment.h index 1a617a7..21c3cc1 100644 --- a/src/lib/FileNodeListFragment.h +++ b/src/lib/FileNodeListFragment.h @@ -22,6 +22,7 @@ namespace libone { + class FileNodeListFragment { public: @@ -70,6 +71,7 @@ class FileNodeListFragment const size_t field_size_footer = sizeof(footer_magic_id); }; +std::vector parseFileNodeListFragments(const libone::RVNGInputStreamPtr_t &input, const FileChunkReference &ref); } From f76e4887d72755462b3b21dec8531c9e72014b8f Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:12:07 +0200 Subject: [PATCH 16/21] give fnd_invalid an explict value: 0 This doubles as marker when no FileNodes are left in a FileNodeListFragment --- src/lib/FileNode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index af6fd1f..9f39b39 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -71,7 +71,7 @@ enum class FndId ReadOnlyObjectDeclaration2RefCountFND = 0x0C4, ReadOnlyObjectDeclaration2LargeRefCountFND = 0x0F5, ChunkTerminatorFND = 0x0FF, - fnd_invalid_id + fnd_invalid_id = 0x0 }; std::string fnd_id_to_string(FndId id_fnd); From ca1b119c1965a383749d4273fcca96c41b918a7e Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:34:35 +0200 Subject: [PATCH 17/21] Refactor FileNodeListFragment: simpily parsing loop this removes the structures which checks for the end of the FileNodeListFragment. Moreove, it removes FileNode skipping, since all types of Nodes can be parsed now. And finally, the FileNodeListFragment's padding skipper is removed because its prone to found invalid FileNodes when the padding is not all zerod. Additionally a switch for TransactionEntry's count for specific FileNodeListFragment is added, though, there is no direct way to get that information yet. Maybe, the transaction log could be parsed for each FileNodeListFragment if the overhead is small, since it's location is given in the header also found in the input stream which is given to FileNodeListFragment. --- src/lib/FileNode.cpp | 1 - src/lib/FileNodeListFragment.cpp | 73 +++++++++++++------------------- 2 files changed, 30 insertions(+), 44 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index dfd4dc9..b4d71f4 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -262,7 +262,6 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) break; case FndId::fnd_invalid_id: default: - assert(false); m_fnd = nullptr; break; } diff --git a/src/lib/FileNodeListFragment.cpp b/src/lib/FileNodeListFragment.cpp index 8c3675a..e2d05c3 100644 --- a/src/lib/FileNodeListFragment.cpp +++ b/src/lib/FileNodeListFragment.cpp @@ -52,24 +52,45 @@ void FileNodeListFragment::parse(const libone::RVNGInputStreamPtr_t &input) m_fnd_list_id = readU32(input, false); m_fragment_sequence = readU32(input, false); - FileNode node; - + uint32_t fileNodeCount = 0xFFFFFFFF; + /* TODO: not sure how to satisfy the 'Transaction' requirement */ +// TODO: set the Transaction's count to fileNodeCount, something like: +// +// if (getFileNodeCountMapping().contains(m_fnd_list_id)) { +// fileNodeCount = getFileNodeCountMapping()[m_fnd_list_id]; +// } do { + FileNode node; node.parse(input); DBMSG << "input@" << input->tell() << ", node " << node.to_string() << std::endl; - if (node.get_FileNodeID() != FndId::ChunkTerminatorFND) + if (node.get_FileNodeID() != FndId::fnd_invalid_id) { - m_fnd_list.push_back(node); - DBMSG << "Added node to node list of size " << m_fnd_list.size() << std::endl; + if (node.get_FileNodeID() != FndId::ChunkTerminatorFND) + { + fileNodeCount--; + m_fnd_list.push_back(node); + DBMSG << "Added node to node list of size " << m_fnd_list.size() << std::endl; + } + else + { + DBMSG << "Returning because ChunkTerminatorFND" << std::endl; + break; + } + } + else + { + DBMSG << "Returning because padding found" << std::endl; + break; } - - node.skip_node(input); - skip_padding(input); } - while (!is_end_of_list(node, input->tell())); + while ((m_offset + m_size - input->tell() - 20 > 4) && (fileNodeCount > 0)); + // the footer structure is 20 bytes long (FileChunkReference (12bytes), and magic (8bytes) + + // skip padding and ChunkTerminatorFND + input->seek(m_offset + m_size - 20, librevenge::RVNG_SEEK_SET); m_next_fragment.parse(input); @@ -85,40 +106,6 @@ void FileNodeListFragment::parse(const libone::RVNGInputStreamPtr_t &input) return; } -void FileNodeListFragment::skip_padding(const libone::RVNGInputStreamPtr_t &input) -{ - int i; - for (i=0;; i++) - { - if (readU8(input, false) != 0) - { - input->seek(- sizeof(uint8_t), librevenge::RVNG_SEEK_CUR); - break; - } - } - DBMSG << "Skipped " << i << " bytes" << std::endl; -} - -/* TODO: not sure how to satisfy the 'Transaction' requirement */ -bool FileNodeListFragment::is_end_of_list(FileNode current_node, long current_offset) -{ - if (current_node.get_FileNodeID() == FndId::ChunkTerminatorFND) - { - DBMSG << "Returning true because ChunkTerminatorFND" << std::endl; - return true; - } - - if (m_next_fragment_offset - current_offset < 4) - { - DBMSG << "Returning true because < 4 bytes" << std::endl; - return true; - } - - DBMSG << "Returning false (current_node " << fnd_id_to_string(current_node.get_FileNodeID()) - << ", current_offset@" << current_offset << ", next_fragment@" << m_next_fragment_offset - << std::endl; - return false; -} std::string FileNodeListFragment::to_string() { From f61f1f5951861290bacdc77d2450f0583db82999 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:48:52 +0200 Subject: [PATCH 18/21] Remove a check, which interferes with parsing The previous commit modified the parsing structure for fileNodeListFragments. There is no more walker for zeroed padding. That's why FileNode can parse a zeroed head - which allowed d to become zero, which is not valid. However, this validity check only applies to valid filenode structures. --- src/lib/FileNode.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index b4d71f4..73890fa 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -106,22 +106,14 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) uint32_t temp; StpFormat format_stp; CbFormat format_cb; - int d; temp = readU32(input, false); - d = temp >> 31; format_stp = static_cast((temp >> shift_format_stp) & mask_format_stp); format_cb = static_cast((temp >> shift_format_cb) & mask_format_cb); m_base_type = static_cast((temp >> shift_base_type) & mask_fnd_base_type); m_fnd_id = static_cast(temp & mask_fnd_id); m_size_in_file = (temp >> shift_fnd_size) & mask_fnd_size; - if (d == 0) - { - std::bitset<13> z(m_size_in_file); - ONE_DEBUG_MSG(("%s\n", z.to_string().c_str())); - ONE_DEBUG_MSG(("warning: d is zero\n")); - } - assert(d == 1); + FileNodeChunkReference reference(format_stp, format_cb); std::bitset<32> y(temp); From 4a1f5339a0eeaacec772aee8a3b26d6dd3b9cd5e Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:56:33 +0200 Subject: [PATCH 19/21] FileNode: Add copy ctor & assign, requires IFileNodeData.clone() --- src/lib/FileNode.cpp | 27 +++++++++++++++++++++++++++ src/lib/FileNode.h | 3 +++ 2 files changed, 30 insertions(+) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 73890fa..9ae241e 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -23,6 +23,33 @@ namespace libone { +FileNode::FileNode() + : m_offset(0), m_size_in_file(0), m_header_size(0), m_fncr(), + m_fnd_id(FndId::fnd_invalid_id), + m_base_type(fnd_basetype::fnd_invalid_basetype), m_fnd(nullptr) {} + +FileNode::FileNode(const FileNode &source) + : m_offset(source.m_offset), m_size_in_file(source.m_size_in_file), + m_header_size(source.m_header_size), m_fncr(source.m_fncr), + m_fnd_id(source.m_fnd_id), m_base_type(source.m_base_type), + m_fnd(nullptr) +{ + m_fnd = source.m_fnd->clone(); +} + +FileNode &FileNode::operator=(const FileNode &source) +{ + if (this == &source) + { + return *this; + } + delete m_fnd; + + m_fnd = source.m_fnd->clone(); + + return *this; +} + FileNode::~FileNode() { diff --git a/src/lib/FileNode.h b/src/lib/FileNode.h index 9f39b39..b644d4b 100644 --- a/src/lib/FileNode.h +++ b/src/lib/FileNode.h @@ -80,6 +80,9 @@ class FileNode { public: + FileNode(); + FileNode(const FileNode &source); + FileNode &operator=(const FileNode &source); ~FileNode(); void parse(const libone::RVNGInputStreamPtr_t &input); std::string to_string(); From be7e56ee2c8ea6a56ef39cbe6c464aee6273ef65 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 00:59:35 +0200 Subject: [PATCH 20/21] FileNode: Remove obsolete parsing structure the respective switch structure interferes with the discreet FileNodeData. The previous FileChunkReference m_fnd is now contained in the respective FileNodeData (if applicable). --- src/lib/FileNode.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/lib/FileNode.cpp b/src/lib/FileNode.cpp index 9ae241e..1c5beb9 100644 --- a/src/lib/FileNode.cpp +++ b/src/lib/FileNode.cpp @@ -141,25 +141,7 @@ void FileNode::parse(const libone::RVNGInputStreamPtr_t &input) m_fnd_id = static_cast(temp & mask_fnd_id); m_size_in_file = (temp >> shift_fnd_size) & mask_fnd_size; - FileNodeChunkReference reference(format_stp, format_cb); - - std::bitset<32> y(temp); - ONE_DEBUG_MSG((" filenode bits %s\n", y.to_string().c_str())); - switch (m_base_type) - { - case fnd_ref_data: - case fnd_ref_filenodelist: - reference.parse(input, input->tell()); - ONE_DEBUG_MSG(("\n")); - break; - case fnd_no_data: - reference.set_zero(); - break; - default: - assert(false); - break; - } - m_fncr = reference; + m_fncr = FileNodeChunkReference(m_offset, m_size_in_file, format_stp, format_cb); switch (m_fnd_id) { From 310f6722645ff0d983e7771bdb3b512617d53d67 Mon Sep 17 00:00:00 2001 From: Sebastian Engel Date: Fri, 28 Aug 2020 01:05:43 +0200 Subject: [PATCH 21/21] Implement IFileNodeData clone() method for deep copying --- .../DataSignatureGroupDefinitionFND.h | 5 +++++ .../FileDataStoreListReferenceFND.h | 4 ++++ .../FileDataStoreObjectReferenceFND.h | 5 +++++ .../FileNodeData/GlobalIdTableEntry2FNDX.h | 4 ++++ .../FileNodeData/GlobalIdTableEntry3FNDX.h | 4 ++++ src/lib/FileNodeData/GlobalIdTableEntryFNDX.h | 5 +++++ src/lib/FileNodeData/GlobalIdTableStartFNDX.h | 5 +++++ .../FileNodeData/HashedChunkDescriptor2FND.h | 5 +++++ src/lib/FileNodeData/IFileNodeData.h | 3 +++ .../ObjectDataEncryptionKeyV2FNDX.cpp | 21 ++++++++++++------- .../ObjectDataEncryptionKeyV2FNDX.h | 6 ++++++ .../ObjectDeclaration2LargeRefCountFND.h | 5 +++++ .../ObjectDeclaration2RefCountFND.h | 4 ++++ ...jectDeclarationFileData3LargeRefCountFND.h | 5 +++++ .../ObjectDeclarationFileData3RefCountFND.h | 5 +++++ .../ObjectDeclarationWithRefCount2FNDX.h | 4 ++++ .../ObjectDeclarationWithRefCountFNDX.h | 5 +++++ .../ObjectGroupListReferenceFND.h | 5 +++++ src/lib/FileNodeData/ObjectGroupStartFND.h | 5 +++++ .../ObjectInfoDependencyOverridesFND.h | 5 +++++ .../ObjectRevisionWithRefCount2FNDX.h | 5 +++++ .../ObjectRevisionWithRefCountFNDX.h | 5 +++++ .../ObjectSpaceManifestListReferenceFND.h | 5 +++++ .../ObjectSpaceManifestListStartFND.h | 5 +++++ .../FileNodeData/ObjectSpaceManifestRootFND.h | 4 ++++ ...adOnlyObjectDeclaration2LargeRefCountFND.h | 4 ++++ .../ReadOnlyObjectDeclaration2RefCountFND.h | 5 +++++ .../RevisionManifestListReferenceFND.h | 5 +++++ .../RevisionManifestListStartFND.h | 5 +++++ .../FileNodeData/RevisionManifestStart4FND.h | 5 +++++ .../FileNodeData/RevisionManifestStart6FND.h | 5 +++++ .../FileNodeData/RevisionManifestStart7FND.h | 5 +++++ .../RevisionRoleAndContextDeclarationFND.h | 5 +++++ .../FileNodeData/RevisionRoleDeclarationFND.h | 5 +++++ .../FileNodeData/RootObjectReference2FNDX.h | 5 +++++ .../FileNodeData/RootObjectReference3FND.h | 5 +++++ 36 files changed, 181 insertions(+), 7 deletions(-) diff --git a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h index 8cd985d..1675481 100644 --- a/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h +++ b/src/lib/FileNodeData/DataSignatureGroupDefinitionFND.h @@ -21,6 +21,11 @@ class DataSignatureGroupDefinitionFND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new DataSignatureGroupDefinitionFND(*this); + } + }; } // namespace libone diff --git a/src/lib/FileNodeData/FileDataStoreListReferenceFND.h b/src/lib/FileNodeData/FileDataStoreListReferenceFND.h index a8a0b1d..81af968 100644 --- a/src/lib/FileNodeData/FileDataStoreListReferenceFND.h +++ b/src/lib/FileNodeData/FileDataStoreListReferenceFND.h @@ -22,6 +22,10 @@ class FileDataStoreListReferenceFND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new FileDataStoreListReferenceFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h index b011823..105aa57 100644 --- a/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h +++ b/src/lib/FileNodeData/FileDataStoreObjectReferenceFND.h @@ -28,6 +28,11 @@ class FileDataStoreObjectReferenceFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new FileDataStoreObjectReferenceFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h index 618481b..75ab749 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntry2FNDX.h @@ -27,6 +27,10 @@ class GlobalIdTableEntry2FNDX : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new GlobalIdTableEntry2FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h index 3860f46..babc606 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntry3FNDX.h @@ -29,6 +29,10 @@ class GlobalIdTableEntry3FNDX : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new GlobalIdTableEntry3FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h index 06aba6b..f0c113b 100644 --- a/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableEntryFNDX.h @@ -26,7 +26,12 @@ class GlobalIdTableEntryFNDX : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new GlobalIdTableEntryFNDX(*this); + } }; + } //namespace libone #endif // GLOBALIDTABLEENTRYFNDX_H diff --git a/src/lib/FileNodeData/GlobalIdTableStartFNDX.h b/src/lib/FileNodeData/GlobalIdTableStartFNDX.h index 67fa825..39fab96 100644 --- a/src/lib/FileNodeData/GlobalIdTableStartFNDX.h +++ b/src/lib/FileNodeData/GlobalIdTableStartFNDX.h @@ -20,6 +20,11 @@ class GlobalIdTableStartFNDX : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new GlobalIdTableStartFNDX(*this); + } + }; } // namespace libone diff --git a/src/lib/FileNodeData/HashedChunkDescriptor2FND.h b/src/lib/FileNodeData/HashedChunkDescriptor2FND.h index 1994cde..69dac78 100644 --- a/src/lib/FileNodeData/HashedChunkDescriptor2FND.h +++ b/src/lib/FileNodeData/HashedChunkDescriptor2FND.h @@ -31,6 +31,11 @@ class HashedChunkDescriptor2FND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new HashedChunkDescriptor2FND(*this); + } + }; } // namespace libone diff --git a/src/lib/FileNodeData/IFileNodeData.h b/src/lib/FileNodeData/IFileNodeData.h index c2e4985..16657ff 100644 --- a/src/lib/FileNodeData/IFileNodeData.h +++ b/src/lib/FileNodeData/IFileNodeData.h @@ -23,8 +23,11 @@ class IFileNodeData virtual std::string to_string() const = 0; + virtual IFileNodeData *clone() const = 0; + }; + } // namespace libone #endif // IFILENODEDATA_H diff --git a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp index d769eaf..890b9b0 100644 --- a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp +++ b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.cpp @@ -8,16 +8,18 @@ ObjectDataEncryptionKeyV2FNDX::ObjectDataEncryptionKeyV2FNDX( StpFormat stpFormat, CbFormat cbFormat) : m_ref(stpFormat, cbFormat), m_EncryptionData() {} -// ObjectDataEncryptionKeyV2FNDX::ObjectDataEncryptionKeyV2FNDX(const ObjectDataEncryptionKeyV2FNDX &source) -// : m_ref(source.m_ref), -// { -// std::copy(source.getEncryptionData(), source.getEncryptionData() + source.getEncryptionDataLength(), m_EncryptionData); -// } - -ObjectDataEncryptionKeyV2FNDX::~ObjectDataEncryptionKeyV2FNDX() +ObjectDataEncryptionKeyV2FNDX::ObjectDataEncryptionKeyV2FNDX(const ObjectDataEncryptionKeyV2FNDX &source) + : m_ref(source.m_ref), m_EncryptionData(std::unique_ptr { + new unsigned char[source.getEncryptionDataLength()] +}) +{ + std::copy(source.getEncryptionData(), source.getEncryptionData() + source.getEncryptionDataLength(), m_EncryptionData.get()); } +ObjectDataEncryptionKeyV2FNDX::~ObjectDataEncryptionKeyV2FNDX() = default; + + // ObjectDataEncryptionKeyV2FNDX &ObjectDataEncryptionKeyV2FNDX::operator=(const ObjectDataEncryptionKeyV2FNDX &rhs) // { // if (this == &rhs) @@ -36,6 +38,11 @@ unsigned char *ObjectDataEncryptionKeyV2FNDX::getEncryptionData() const return m_EncryptionData.get(); } +uint64_t ObjectDataEncryptionKeyV2FNDX::getEncryptionDataLength() const +{ + return m_ref.cb(); +} + void ObjectDataEncryptionKeyV2FNDX::setEncryptionData(const unsigned char *value, const uint64_t length) { if (0 < length) diff --git a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h index 069bff2..10cd11d 100644 --- a/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h +++ b/src/lib/FileNodeData/ObjectDataEncryptionKeyV2FNDX.h @@ -18,6 +18,7 @@ class ObjectDataEncryptionKeyV2FNDX : public IFileNodeData std::unique_ptr m_EncryptionData; public: ObjectDataEncryptionKeyV2FNDX(const StpFormat stpFormat, const CbFormat cbFormat); + ObjectDataEncryptionKeyV2FNDX(const ObjectDataEncryptionKeyV2FNDX &source); ~ObjectDataEncryptionKeyV2FNDX(); // ObjectDataEncryptionKeyV2FNDX &operator=(const ObjectDataEncryptionKeyV2FNDX &rhs); @@ -32,6 +33,11 @@ class ObjectDataEncryptionKeyV2FNDX : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectDataEncryptionKeyV2FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h index 1a3b32a..9dd28f6 100644 --- a/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclaration2LargeRefCountFND.h @@ -36,6 +36,11 @@ class ObjectDeclaration2LargeRefCountFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectDeclaration2LargeRefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h index 4de4272..ced43c4 100644 --- a/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclaration2RefCountFND.h @@ -33,6 +33,10 @@ class ObjectDeclaration2RefCountFND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new ObjectDeclaration2RefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h index b7ff0a2..3110e37 100644 --- a/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3LargeRefCountFND.h @@ -40,6 +40,11 @@ class ObjectDeclarationFileData3LargeRefCountFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectDeclarationFileData3LargeRefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h index b388d44..6301058 100644 --- a/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h +++ b/src/lib/FileNodeData/ObjectDeclarationFileData3RefCountFND.h @@ -41,6 +41,11 @@ class ObjectDeclarationFileData3RefCountFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectDeclarationFileData3RefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h index c19ed43..b25c4d4 100644 --- a/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCount2FNDX.h @@ -37,6 +37,10 @@ class ObjectDeclarationWithRefCount2FNDX : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new ObjectDeclarationWithRefCount2FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h index c01c5e6..bb6876e 100644 --- a/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h +++ b/src/lib/FileNodeData/ObjectDeclarationWithRefCountFNDX.h @@ -37,6 +37,11 @@ class ObjectDeclarationWithRefCountFNDX : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectDeclarationWithRefCountFNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectGroupListReferenceFND.h b/src/lib/FileNodeData/ObjectGroupListReferenceFND.h index 5808733..87db417 100644 --- a/src/lib/FileNodeData/ObjectGroupListReferenceFND.h +++ b/src/lib/FileNodeData/ObjectGroupListReferenceFND.h @@ -29,6 +29,11 @@ class ObjectGroupListReferenceFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectGroupListReferenceFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectGroupStartFND.h b/src/lib/FileNodeData/ObjectGroupStartFND.h index c91dbdc..26c2347 100644 --- a/src/lib/FileNodeData/ObjectGroupStartFND.h +++ b/src/lib/FileNodeData/ObjectGroupStartFND.h @@ -20,6 +20,11 @@ class ObjectGroupStartFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectGroupStartFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h index 713597c..db2bf84 100644 --- a/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h +++ b/src/lib/FileNodeData/ObjectInfoDependencyOverridesFND.h @@ -28,6 +28,11 @@ class ObjectInfoDependencyOverridesFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectInfoDependencyOverridesFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h index a58e578..d9acbe4 100644 --- a/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCount2FNDX.h @@ -43,6 +43,11 @@ class ObjectRevisionWithRefCount2FNDX : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectRevisionWithRefCount2FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h index ddbf0c0..2d90cc3 100644 --- a/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h +++ b/src/lib/FileNodeData/ObjectRevisionWithRefCountFNDX.h @@ -39,6 +39,11 @@ class ObjectRevisionWithRefCountFNDX : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectRevisionWithRefCountFNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h index 35c8fdc..14e5067 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestListReferenceFND.h @@ -30,6 +30,11 @@ class ObjectSpaceManifestListReferenceFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectSpaceManifestListReferenceFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h index 2b40e58..363a870 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestListStartFND.h @@ -21,6 +21,11 @@ class ObjectSpaceManifestListStartFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ObjectSpaceManifestListStartFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h index 0cde5f0..14b0dea 100644 --- a/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h +++ b/src/lib/FileNodeData/ObjectSpaceManifestRootFND.h @@ -23,6 +23,10 @@ class ObjectSpaceManifestRootFND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new ObjectSpaceManifestRootFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h index 7a5a5cd..992dcdb 100644 --- a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2LargeRefCountFND.h @@ -41,6 +41,10 @@ class ReadOnlyObjectDeclaration2LargeRefCountFND : public IFileNodeData std::string to_string() const override; + IFileNodeData *clone() const override + { + return new ReadOnlyObjectDeclaration2LargeRefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h index 4c61657..96069da 100644 --- a/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h +++ b/src/lib/FileNodeData/ReadOnlyObjectDeclaration2RefCountFND.h @@ -37,6 +37,11 @@ class ReadOnlyObjectDeclaration2RefCountFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new ReadOnlyObjectDeclaration2RefCountFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestListReferenceFND.h b/src/lib/FileNodeData/RevisionManifestListReferenceFND.h index c5f49c0..095607b 100644 --- a/src/lib/FileNodeData/RevisionManifestListReferenceFND.h +++ b/src/lib/FileNodeData/RevisionManifestListReferenceFND.h @@ -24,6 +24,11 @@ class RevisionManifestListReferenceFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionManifestListReferenceFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestListStartFND.h b/src/lib/FileNodeData/RevisionManifestListStartFND.h index 8cfc3c9..e7bd375 100644 --- a/src/lib/FileNodeData/RevisionManifestListStartFND.h +++ b/src/lib/FileNodeData/RevisionManifestListStartFND.h @@ -27,6 +27,11 @@ class RevisionManifestListStartFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionManifestListStartFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart4FND.h b/src/lib/FileNodeData/RevisionManifestStart4FND.h index 62a9513..fb96315 100644 --- a/src/lib/FileNodeData/RevisionManifestStart4FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart4FND.h @@ -40,6 +40,11 @@ class RevisionManifestStart4FND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionManifestStart4FND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart6FND.h b/src/lib/FileNodeData/RevisionManifestStart6FND.h index 7f5fd6a..552b7bb 100644 --- a/src/lib/FileNodeData/RevisionManifestStart6FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart6FND.h @@ -34,6 +34,11 @@ class RevisionManifestStart6FND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionManifestStart6FND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionManifestStart7FND.h b/src/lib/FileNodeData/RevisionManifestStart7FND.h index 445aad3..080c7cf 100644 --- a/src/lib/FileNodeData/RevisionManifestStart7FND.h +++ b/src/lib/FileNodeData/RevisionManifestStart7FND.h @@ -27,6 +27,11 @@ class RevisionManifestStart7FND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionManifestStart7FND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h index f1d63c4..a1dc2dc 100644 --- a/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h +++ b/src/lib/FileNodeData/RevisionRoleAndContextDeclarationFND.h @@ -27,6 +27,11 @@ class RevisionRoleAndContextDeclarationFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionRoleAndContextDeclarationFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RevisionRoleDeclarationFND.h b/src/lib/FileNodeData/RevisionRoleDeclarationFND.h index 3d3341d..1e662fe 100644 --- a/src/lib/FileNodeData/RevisionRoleDeclarationFND.h +++ b/src/lib/FileNodeData/RevisionRoleDeclarationFND.h @@ -25,6 +25,11 @@ class RevisionRoleDeclarationFND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RevisionRoleDeclarationFND(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RootObjectReference2FNDX.h b/src/lib/FileNodeData/RootObjectReference2FNDX.h index b1fd4f6..516d213 100644 --- a/src/lib/FileNodeData/RootObjectReference2FNDX.h +++ b/src/lib/FileNodeData/RootObjectReference2FNDX.h @@ -25,6 +25,11 @@ class RootObjectReference2FNDX : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RootObjectReference2FNDX(*this); + } }; } // namespace libone diff --git a/src/lib/FileNodeData/RootObjectReference3FND.h b/src/lib/FileNodeData/RootObjectReference3FND.h index 2cb93c4..c1ad1b7 100644 --- a/src/lib/FileNodeData/RootObjectReference3FND.h +++ b/src/lib/FileNodeData/RootObjectReference3FND.h @@ -25,6 +25,11 @@ class RootObjectReference3FND : public IFileNodeData void parse(const libone::RVNGInputStreamPtr_t &input) override; std::string to_string() const override; + + IFileNodeData *clone() const override + { + return new RootObjectReference3FND(*this); + } }; } // namespace libone