Add Mdx bin structures

This commit is contained in:
Viktor Andreev
2024-07-11 18:53:39 +06:00
parent d69b861ff7
commit a452a20049
7 changed files with 420 additions and 1 deletions

View File

@ -703,6 +703,8 @@ SOURCES += \
../../../XlsbFormat/Biff12_records/Mdb.cpp \
../../../XlsbFormat/Biff12_records/BeginEsmdx.cpp \
../../../XlsbFormat/Biff12_records/EndEsmdx.cpp \
../../../XlsbFormat/Biff12_records/BeginMdx.cpp \
../../../XlsbFormat/Biff12_records/EndMdx.cpp \
### Biff12_structures
../../../XlsbFormat/Biff12_structures/LPByteBuf.cpp \
../../../XlsbFormat/Biff12_structures/IsoPasswordData.cpp \
@ -1080,6 +1082,7 @@ SOURCES += \
../../../XlsbFormat/Biff12_unions/ESSTR.cpp \
../../../XlsbFormat/Biff12_unions/ESMDB.cpp \
../../../XlsbFormat/Biff12_unions/ESMDX.cpp \
../../../XlsbFormat/Biff12_unions/MDX.cpp \
}
HEADERS += \
../../../XlsbFormat/Biff12_unions/COMMENTS.h \
@ -1757,6 +1760,8 @@ HEADERS += \
../../../XlsbFormat/Biff12_records/Mdb.h \
../../../XlsbFormat/Biff12_records/BeginEsmdx.h \
../../../XlsbFormat/Biff12_records/EndEsmdx.h \
../../../XlsbFormat/Biff12_records/BeginMdx.h \
../../../XlsbFormat/Biff12_records/EndMdx.h \
### Biff12_structures
../../../XlsbFormat/Biff12_structures/ACProductVersion.h \
../../../XlsbFormat/Biff12_structures/Blxf.h \
@ -2133,4 +2138,5 @@ HEADERS += \
../../../XlsbFormat/Biff12_unions/RICHDATAMETADATA.h \
../../../XlsbFormat/Biff12_unions/ESSTR.h \
../../../XlsbFormat/Biff12_unions/ESMDB.h \
../../../XlsbFormat/Biff12_unions/ESMDX.h \
../../../XlsbFormat/Biff12_unions/ESMDX.h \
../../../XlsbFormat/Biff12_unions/MDX.h \

View File

@ -0,0 +1,65 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "BeginMdx.h"
using namespace XLS;
namespace XLSB
{
BeginMdx::BeginMdx()
{
}
BeginMdx::~BeginMdx()
{
}
BaseObjectPtr BeginMdx::clone()
{
return BaseObjectPtr(new BeginMdx(*this));
}
void BeginMdx::readFields(XLS::CFRecord& record)
{
record >> istrConnName >> tfnSrc;
}
void BeginMdx::writeFields(XLS::CFRecord& record)
{
record << istrConnName << tfnSrc;
}
} // namespace XLSB

View File

@ -0,0 +1,63 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BiffRecord.h"
#include "../../XlsxFormat/WritingElement.h"
namespace XLSB
{
enum class TagFnMdx {CUBEMEMBER = 1, CUBEVALUE, CUBESET, CUBESETCOUNT, CUBERANKEDMEMBER, CUBEMEMBERPROPERTY, CUBEKPIMEMBER};
// Logical representation of BrtBeginMdx record in BIFF12
class BeginMdx: public XLS::BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(BeginMdx)
BASE_OBJECT_DEFINE_CLASS_NAME(BeginMdx)
public:
BeginMdx();
~BeginMdx();
XLS::BaseObjectPtr clone();
void readFields(XLS::CFRecord& record) override;
void writeFields(XLS::CFRecord& record) override;
_INT32 istrConnName;
TagFnMdx tfnSrc;
};
} // namespace XLSB

View File

@ -0,0 +1,53 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "EndMdx.h"
using namespace XLS;
namespace XLSB
{
EndMdx::EndMdx()
{
}
EndMdx::~EndMdx()
{
}
BaseObjectPtr EndMdx::clone()
{
return BaseObjectPtr(new EndMdx(*this));
}
} // namespace XLSB

View File

@ -0,0 +1,54 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BiffRecord.h"
#include "../../XlsxFormat/WritingElement.h"
namespace XLSB
{
// Logical representation of BrtEndMdx record in BIFF12
class EndMdx: public XLS::BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(EndMdx)
BASE_OBJECT_DEFINE_CLASS_NAME(EndMdx)
public:
EndMdx();
~EndMdx();
XLS::BaseObjectPtr clone();
};
} // namespace XLSB

View File

@ -0,0 +1,115 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "MDX.h"
#include "../Biff12_records/BeginMdx.h"
#include "../Biff12_records/EndMdx.h"
using namespace XLS;
namespace XLSB
{
MDX::MDX()
{
}
MDX::~MDX()
{
}
BaseObjectPtr MDX::clone()
{
return BaseObjectPtr(new MDX(*this));
}
//MDX = BrtBeginMDX COMMENTAUTHORS COMMENTLIST *FRT BrtEndMDX
const bool MDX::loadContent(BinProcessor& proc)
{
/*if (proc.optional<BeginMDX>())
{
m_bBrtBeginMDX = true;
elements_.pop_back();
}
else
m_bBrtBeginMDX = false;
if (proc.optional<COMMENTAUTHORS>())
{
m_COMMENTAUTHORS = elements_.back();
elements_.pop_back();
}
if (proc.optional<COMMENTLIST>())
{
m_COMMENTLIST = elements_.back();
elements_.pop_back();
}
int count = proc.repeated<FRT>(0, 0);
while(count > 0)
{
//m_arFRT.insert(m_arFRT.begin(), elements_.back());
elements_.pop_back();
count--;
}
if (proc.optional<EndMDX>())
{
m_bBrtEndMDX = true;
elements_.pop_back();
}
else
m_bBrtEndMDX = false;*/
return true;
}
const bool MDX::saveContent(XLS::BinProcessor & proc)
{
if (m_BrtBeginMdx != nullptr)
proc.mandatory(*m_BrtBeginMdx);
if(MDXTUPLE != nullptr)
proc.mandatory(*MDXTUPLE);
else if(MDXSET != nullptr)
proc.mandatory(*MDXSET);
else if(MDXMBRPROP != nullptr)
proc.mandatory(*MDXMBRPROP);
else if(MDXKPI != nullptr)
proc.mandatory(*MDXKPI);
proc.mandatory<XLSB::EndMdx>();
return true;
}
} // namespace XLSB

View File

@ -0,0 +1,63 @@
/*
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../../../MsBinaryFile/XlsFile/Format/Logic/CompositeObject.h"
namespace XLSB
{
class MDX: public XLS::CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(MDX)
public:
MDX();
~MDX();
XLS::BaseObjectPtr clone();
const bool loadContent(XLS::BinProcessor& proc) override;
const bool saveContent(XLS::BinProcessor& proc) override;
XLS::BaseObjectPtr m_BrtBeginMdx;
XLS::BaseObjectPtr MDXTUPLE;
XLS::BaseObjectPtr MDXSET;
XLS::BaseObjectPtr MDXMBRPROP;
XLS::BaseObjectPtr MDXKPI;
bool m_bBrtEndMdx;
};
} // namespace XLSB