mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
32 Commits
v5.0.1.3
...
v5.0.99.73
| Author | SHA1 | Date | |
|---|---|---|---|
| 48d4b72d4b | |||
| 9e6d4950c2 | |||
| cb4befa078 | |||
| ac1292a17a | |||
| f624f731de | |||
| c94768902b | |||
| 16bdbafa75 | |||
| 089871d3ae | |||
| a43639587f | |||
| 46d022388d | |||
| 0366bcb341 | |||
| ab3add9577 | |||
| 54939bca61 | |||
| 6bdfa26c7e | |||
| a5bae64959 | |||
| 4d04a0d649 | |||
| fb7af5b902 | |||
| 77172fb39c | |||
| 80b1e5e886 | |||
| d1a7800f36 | |||
| e223ffd0db | |||
| b140f4b521 | |||
| 2bf55b7c8b | |||
| cf2159cd54 | |||
| 8df6286e80 | |||
| 54d0260ea2 | |||
| 792a722063 | |||
| a7a78a09c1 | |||
| 0fc749f839 | |||
| c0a061f2cb | |||
| 65e7372cf7 | |||
| 1ea27ad7f8 |
@ -902,7 +902,7 @@ namespace DocFileFormat
|
||||
{
|
||||
int shape_type = oPicture.shapeContainer->getShapeType();
|
||||
|
||||
if (shape_type != msosptPictureFrame) picture = false;//шаблон 1.doc картинка в колонтитуле
|
||||
if (shape_type != msosptPictureFrame) picture = false;
|
||||
}
|
||||
|
||||
if (picture)
|
||||
|
||||
@ -149,14 +149,7 @@ namespace DocFileFormat
|
||||
point.y = guides[index].param3;
|
||||
}
|
||||
}
|
||||
if ((size_t)point.y > 0xffff)
|
||||
{
|
||||
point.y &= 0xffff;
|
||||
}
|
||||
if ((size_t)point.x > 0xffff)
|
||||
{
|
||||
point.x &= 0xffff;
|
||||
}
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,25 +63,8 @@ namespace DocFileFormat
|
||||
Shape* sh = dynamic_cast<Shape*>( *iter );
|
||||
if (sh)
|
||||
{
|
||||
if (sh->shapeType)
|
||||
{
|
||||
return sh->shapeType->GetTypeCode();
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( std::vector<Record*>::const_iterator iter1 = this->Children.begin(); iter1 != this->Children.end(); iter1++ )
|
||||
{
|
||||
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( *iter1 );
|
||||
if (sh_options)
|
||||
{
|
||||
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib))
|
||||
{
|
||||
return msosptPictureFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (sh->shapeType) return sh->shapeType->GetTypeCode();
|
||||
else return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -36,7 +36,7 @@ namespace BinDocxRW {
|
||||
|
||||
int Binary_VbaProjectTableReader::Read()
|
||||
{
|
||||
m_oFileWriter.m_pVbaProject = new OOX::VbaProject();
|
||||
m_oFileWriter.m_pVbaProject = new OOX::VbaProject();
|
||||
m_oFileWriter.m_pVbaProject->fromPPTY(&m_oBufferedStream);
|
||||
|
||||
return c_oSerConstants::ReadOk;
|
||||
@ -118,4 +118,4 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItemContent(BYTE type, long length, void
|
||||
return pBinary_DocumentTableReader->ReadDocumentContent(type, length, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -285,7 +285,7 @@ public:
|
||||
}
|
||||
|
||||
int Read ();
|
||||
};
|
||||
};
|
||||
|
||||
class Binary_HdrFtrTableReader : public Binary_CommonReader<Binary_HdrFtrTableReader>
|
||||
{
|
||||
|
||||
@ -95,7 +95,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, co
|
||||
oDrawingConverter.SetMainDocument(this);
|
||||
|
||||
oDrawingConverter.SetDstPath(pathMain.GetDirectory() + FILE_SEPARATOR_STR + L"word");
|
||||
oDrawingConverter.SetMediaDstPath(pathMedia.GetPath());
|
||||
oDrawingConverter.SetMediaDstPath(pathMedia.GetPath());
|
||||
|
||||
m_pParamsWriter = new ParamsWriter(&oBufferedStream, &fp, &oDrawingConverter, pEmbeddedFontsManager);
|
||||
|
||||
@ -265,10 +265,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
|
||||
if (NULL != pData)
|
||||
{
|
||||
oDrawingConverter.SetMainDocument(this);
|
||||
oDrawingConverter.SetMainDocument(this);
|
||||
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"word");
|
||||
|
||||
oDrawingConverter.SetMediaDstPath(sMediaPath);
|
||||
oDrawingConverter.SetMediaDstPath(sMediaPath);
|
||||
oDrawingConverter.SetEmbedDstPath(sEmbedPath);
|
||||
|
||||
m_pCurFileWriter = new Writers::FileWriter(sDstPath, m_sFontDir, false, nVersion, m_bSaveChartAsImg, &oDrawingConverter, sThemePath);
|
||||
|
||||
@ -88,12 +88,12 @@ namespace BinXlsxRW{
|
||||
{
|
||||
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
|
||||
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
|
||||
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
|
||||
oDrawingConverter.SetSrcPath(strFileInDir, 2);
|
||||
|
||||
oDrawingConverter.SetMediaDstPath(sMediaDir);
|
||||
oDrawingConverter.SetMediaDstPath(sMediaDir);
|
||||
oDrawingConverter.SetEmbedDstPath(sEmbedDir);
|
||||
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
|
||||
@ -314,7 +314,7 @@
|
||||
17E17ED41AC453F800BEA2EA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0710;
|
||||
LastUpgradeCheck = 0830;
|
||||
ORGANIZATIONNAME = "Ascensio System SIA";
|
||||
};
|
||||
buildConfigurationList = 17E17ED71AC453F800BEA2EA /* Build configuration list for PBXProject "ASCOfficeDocxFile2Lib" */;
|
||||
@ -446,8 +446,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@ -455,6 +457,7 @@
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@ -488,8 +491,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@ -497,6 +502,7 @@
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
||||
@ -34,11 +34,9 @@
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include "../../Common/OfficeFileFormatChecker.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../src/ConvertOO2OOX.h"
|
||||
#include "../include/logging.h"
|
||||
|
||||
|
||||
#if defined(_WIN64)
|
||||
@ -47,55 +45,30 @@
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
HRESULT convert_single(std::wstring srcFileName)
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
COfficeFileFormatChecker fileChecker(srcFileName);
|
||||
|
||||
std::wstring dstPath = srcFileName;// + ; //xlsx pptx docx
|
||||
switch(fileChecker.nFileType)
|
||||
{
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT:
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT_FLAT: dstPath += L"-my.docx"; break;
|
||||
|
||||
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS:
|
||||
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT: dstPath += L"-my.xlsx"; break;
|
||||
|
||||
case AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP:
|
||||
case AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP_FLAT: dstPath += L"-my.pptx"; break;
|
||||
|
||||
default:
|
||||
return S_FALSE;
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
std::wstring srcFileName = argv[1];
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx docx
|
||||
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
|
||||
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
std::wstring srcTempPath;
|
||||
|
||||
if (fileChecker.nFileType == AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT ||
|
||||
fileChecker.nFileType == AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS ||
|
||||
fileChecker.nFileType == AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP)
|
||||
{
|
||||
srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
|
||||
if (S_OK != oCOfficeUtils.ExtractToDirectory(srcFileName.c_str(), srcTempPath.c_str(), NULL, 0))
|
||||
return S_FALSE;
|
||||
}
|
||||
else // flat
|
||||
{
|
||||
srcTempPath = srcFileName;
|
||||
}
|
||||
_CP_LOG << L"[info] " << srcFileName << std::endl;
|
||||
|
||||
std::wstring srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
|
||||
// распаковываем исходник во временную директорию
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK != oCOfficeUtils.ExtractToDirectory(srcFileName.c_str(), srcTempPath.c_str(), NULL, 0))
|
||||
return S_FALSE;
|
||||
|
||||
hr = ConvertOO2OOX(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", false, NULL);
|
||||
|
||||
if (srcTempPath != srcFileName)
|
||||
{
|
||||
NSDirectory::DeleteDirectory(srcTempPath);
|
||||
}
|
||||
NSDirectory::DeleteDirectory(srcTempPath);
|
||||
|
||||
if (hr != S_OK) return hr;
|
||||
|
||||
@ -104,35 +77,6 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
|
||||
NSDirectory::DeleteDirectory(dstTempPath);
|
||||
|
||||
return hr;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
return 0;
|
||||
}
|
||||
|
||||
HRESULT convert_directory(std::wstring pathName)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(pathName, false);
|
||||
|
||||
for (size_t i = 0; i < arFiles.size(); i++)
|
||||
{
|
||||
convert_single(arFiles[i]);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
|
||||
HRESULT hr = -1;
|
||||
if (NSFile::CFileBinary::Exists(argv[1]))
|
||||
{
|
||||
hr = convert_single(argv[1]);
|
||||
}
|
||||
else if (NSDirectory::Exists(argv[1]))
|
||||
{
|
||||
hr = convert_directory(argv[1]);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
@ -336,14 +336,6 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
|
||||
>
|
||||
|
||||
@ -389,37 +389,29 @@ namespace formulasconvert {
|
||||
}
|
||||
|
||||
|
||||
//std::wstring forbidden_formulas[] =
|
||||
//{
|
||||
// L"NULLFORMULA"
|
||||
// //L"BETADIST",
|
||||
// //L"CEILING",
|
||||
// //L"FLOOR",
|
||||
// //L"RANK",
|
||||
// //L"ROUND",
|
||||
// //L"ROUNDDOWN",
|
||||
// //L"ROUNDUP",
|
||||
// //L"SUBTOTAL",
|
||||
// //L"FORMULA",
|
||||
// //L"ISREF"
|
||||
//};
|
||||
|
||||
std::wstring is_forbidden(const std::wstring & formula)
|
||||
std::wstring forbidden_formulas[] =
|
||||
{
|
||||
std::wstring result = formula;
|
||||
std::map<std::wstring, std::wstring> forbidden_formulas;
|
||||
L"NULLFORMULA"
|
||||
//L"BETADIST",
|
||||
//L"CEILING",
|
||||
//L"FLOOR",
|
||||
//L"RANK",
|
||||
//L"ROUND",
|
||||
//L"ROUNDDOWN",
|
||||
//L"ROUNDUP",
|
||||
//L"SUBTOTAL",
|
||||
//L"FORMULA",
|
||||
//L"ISREF"
|
||||
};
|
||||
|
||||
forbidden_formulas.insert(std::make_pair(L"FORMULA", L"_xlfn.FORMULATEXT"));
|
||||
|
||||
for (std::map<std::wstring, std::wstring>::iterator it = forbidden_formulas.begin(); it != forbidden_formulas.end(); it++)
|
||||
bool is_forbidden(const std::wstring & formula)
|
||||
{
|
||||
for (size_t i = 0; i < 1/*forbidden_formulas.size()*/; i++)
|
||||
{
|
||||
if (boost::algorithm::contains(formula, it->first))
|
||||
{
|
||||
|
||||
XmlUtils::replace_all(result, it->first, it->second);
|
||||
}
|
||||
if (boost::algorithm::contains(formula, forbidden_formulas[i]))
|
||||
return true;
|
||||
}
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк
|
||||
@ -445,7 +437,10 @@ namespace formulasconvert {
|
||||
|
||||
std::wstring odf2oox_converter::Impl::convert(const std::wstring& expr)
|
||||
{
|
||||
std::wstring workstr = is_forbidden(expr);
|
||||
if (is_forbidden(expr))
|
||||
return L"NULLFORMULA()";
|
||||
|
||||
std::wstring workstr = expr;
|
||||
//boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// Better_Donut.ods- cell(c27)
|
||||
//std::wstring workstr = boost::regex_replace(
|
||||
// expr,
|
||||
@ -522,8 +517,10 @@ namespace formulasconvert {
|
||||
|
||||
std::wstring odf2oox_converter::Impl::convert_chart_distance(const std::wstring& expr)
|
||||
{
|
||||
std::wstring workstr = is_forbidden(expr);
|
||||
if (is_forbidden(expr))
|
||||
return L"NULLFORMULA()";
|
||||
|
||||
std::wstring workstr = expr;
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
|
||||
@ -35,15 +35,11 @@
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "../CPScopedPtr.h"
|
||||
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml
|
||||
{
|
||||
class sax;
|
||||
}
|
||||
|
||||
namespace oox {
|
||||
class docx_conversion_context;
|
||||
class xlsx_conversion_context;
|
||||
@ -58,10 +54,9 @@ class odf_document
|
||||
{
|
||||
public:
|
||||
odf_document(const std::wstring & Folder, const ProgressCallback* CallBack);
|
||||
odf_document(xml::sax * Reader);
|
||||
|
||||
~odf_document();
|
||||
~odf_document();
|
||||
|
||||
public:
|
||||
odf_read_context & odf_context();
|
||||
|
||||
bool docx_convert(oox::docx_conversion_context & Context);
|
||||
@ -82,7 +77,6 @@ private:
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
};
|
||||
typedef shared_ptr<odf_document>::Type odf_document_ptr;
|
||||
|
||||
}
|
||||
}
|
||||
@ -217,7 +217,6 @@ SOURCES += \
|
||||
../src/odf/datatypes/tableorientation.cpp \
|
||||
../src/odf/datatypes/tablefunction.cpp \
|
||||
../src/odf/datatypes/tableorder.cpp \
|
||||
../src/odf/datatypes/dategroup.cpp \
|
||||
../src/docx/xlsx_conditionalFormatting.cpp \
|
||||
../src/docx/xlsx_dxfs.cpp \
|
||||
../src/docx/docx_content_type.cpp \
|
||||
|
||||
@ -126,4 +126,3 @@
|
||||
#include "../src/odf/datatypes/tableorientation.cpp"
|
||||
#include "../src/odf/datatypes/tablefunction.cpp"
|
||||
#include "../src/odf/datatypes/tableorder.cpp"
|
||||
#include "../src/odf/datatypes/dategroup.cpp"
|
||||
|
||||
@ -97,6 +97,14 @@ HRESULT ConvertOO2OOX(const std::wstring & srcPath, const std::wstring & dstPath
|
||||
|
||||
if (encrypted) return AVS_ERROR_DRM;
|
||||
|
||||
//if (type<1)
|
||||
//{
|
||||
// if (ext == L".odt")type = 1;
|
||||
// if (ext == L".ods")type = 2;
|
||||
// if (ext == L".odp")type = 3;
|
||||
|
||||
//}
|
||||
|
||||
if (bOnlyPresentation && type != 3)return AVS_ERROR_UNEXPECTED;
|
||||
|
||||
switch (type)
|
||||
|
||||
@ -127,7 +127,6 @@ public:
|
||||
if (sExt == L"m4v") return typeVideo;
|
||||
if (sExt == L"mp4") return typeVideo;
|
||||
if (sExt == L"mov") return typeVideo;
|
||||
if (sExt == L"mkv") return typeVideo;
|
||||
|
||||
return typeMedia;
|
||||
}
|
||||
|
||||
@ -118,23 +118,6 @@ void oox_chart_context::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"val",L"en-US");
|
||||
}
|
||||
|
||||
if (pivot_source_.empty() == false)
|
||||
{
|
||||
set_cache_only(true);
|
||||
|
||||
CP_XML_NODE(L"c:pivotSource")
|
||||
{
|
||||
CP_XML_NODE(L"c:name")
|
||||
{
|
||||
CP_XML_STREAM() << pivot_source_;
|
||||
}
|
||||
CP_XML_NODE(L"c:fmtId")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:chart")
|
||||
{
|
||||
if (plot_area_.current_chart_->is3D_)
|
||||
@ -165,42 +148,10 @@ void oox_chart_context::serialize(std::wostream & strm)
|
||||
shape.set(graphic_properties_, fill_);
|
||||
shape.oox_serialize(CP_XML_STREAM());
|
||||
|
||||
if (pivot_source_.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:extLst")
|
||||
{
|
||||
CP_XML_NODE(L"c:ext")
|
||||
{
|
||||
CP_XML_ATTR(L"uri", L"{781A3756-C4B2-4CAC-9D66-4F8BD8637D16}");
|
||||
CP_XML_ATTR(L"xmlns:c14", L"http://schemas.microsoft.com/office/drawing/2007/8/2/chart");
|
||||
CP_XML_NODE(L"c14:pivotOptions")
|
||||
{
|
||||
CP_XML_NODE(L"c14:dropZoneFilter")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
}
|
||||
CP_XML_NODE(L"c14:dropZoneCategories")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
}
|
||||
CP_XML_NODE(L"c14:dropZoneData")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
}
|
||||
CP_XML_NODE(L"c14:dropZoneSeries")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
}
|
||||
CP_XML_NODE(L"c14:dropZonesVisible")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
oox_chart_context::~oox_chart_context()
|
||||
@ -209,7 +160,7 @@ oox_chart_context::~oox_chart_context()
|
||||
|
||||
void oox_chart_context::set_cache_only (bool val)
|
||||
{
|
||||
for (size_t i = 0 ; i < plot_area_.charts_.size(); i++)
|
||||
for (int i = 0 ; i < plot_area_.charts_.size(); i++)
|
||||
{
|
||||
plot_area_.charts_[i]->set_cache_only(val);
|
||||
}
|
||||
|
||||
@ -63,10 +63,6 @@ public:
|
||||
void serialize(std::wostream & strm);
|
||||
void dump_rels(rels & Rels);
|
||||
|
||||
void set_pivot_chart(const std::wstring &source)
|
||||
{
|
||||
pivot_source_ = source;
|
||||
}
|
||||
void set_title(odf_reader::chart::title & t)
|
||||
{
|
||||
title_.set_content(t);
|
||||
@ -134,8 +130,6 @@ private:
|
||||
cpdoccore::oox::oox_plot_area plot_area_;
|
||||
cpdoccore::oox::oox_chart_legend legend_;
|
||||
|
||||
std::wstring pivot_source_;
|
||||
|
||||
std::vector<odf_reader::_property> graphic_properties_;
|
||||
_oox_fill fill_;
|
||||
};
|
||||
|
||||
@ -37,8 +37,6 @@
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
#include "oox_chart_series.h"
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
|
||||
@ -260,11 +258,8 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
|
||||
CP_XML_ATTR(L"idx", j);
|
||||
double val = 0;
|
||||
|
||||
if (oox::IsNumber(v))
|
||||
{
|
||||
try { val = boost::lexical_cast<double>(v);}
|
||||
catch(...){}
|
||||
}
|
||||
try { val = boost::lexical_cast<double>(v);}
|
||||
catch(...){}
|
||||
CP_XML_NODE(L"c:v")
|
||||
{
|
||||
CP_XML_CONTENT(val);
|
||||
@ -298,11 +293,8 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
|
||||
CP_XML_ATTR(L"idx", j);
|
||||
double val = 0;
|
||||
|
||||
if (oox::IsNumber(v))
|
||||
{
|
||||
try { val = boost::lexical_cast<double>(v);}
|
||||
catch(...){}
|
||||
}
|
||||
try { val = boost::lexical_cast<double>(v);}
|
||||
catch(...){}
|
||||
CP_XML_NODE(L"c:v")
|
||||
{
|
||||
CP_XML_CONTENT(val);
|
||||
|
||||
@ -171,7 +171,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
if ( color.empty() )
|
||||
{
|
||||
if (always_draw) color = L"000000";
|
||||
else color = L"FFFFFFFF";
|
||||
else color = L"ffffff";
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
@ -232,11 +232,11 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
|
||||
if (values[i].empty()) continue;
|
||||
CP_XML_NODE(L"a:gd")
|
||||
{
|
||||
//if (values.size() > 1 || bModifiers)
|
||||
if (values.size() > 1 || bModifiers)
|
||||
//весьма странное .. для некоторых модификаторов (напр math...) нужно указывать множественность их
|
||||
CP_XML_ATTR(L"name", L"adj" + std::to_wstring(i+1));
|
||||
//else
|
||||
// CP_XML_ATTR(L"name", L"adj");
|
||||
else
|
||||
CP_XML_ATTR(L"name", L"adj");
|
||||
|
||||
CP_XML_ATTR(L"fmla", L"val " + values[i]);
|
||||
}
|
||||
@ -263,8 +263,8 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
|
||||
odf_reader::GetProperty(prop,L"text-padding-bottom" , dPaddingBottom);
|
||||
|
||||
if (dPaddingLeft) CP_XML_ATTR(L"lIns", (int)(*dPaddingLeft));
|
||||
if (dPaddingTop) CP_XML_ATTR(L"tIns", (int)(*dPaddingTop));
|
||||
if (dPaddingRight) CP_XML_ATTR(L"rIns", (int)(*dPaddingRight));
|
||||
if (dPaddingTop) CP_XML_ATTR(L"tIns", (int)(*dPaddingTop));
|
||||
if (dPaddingBottom) CP_XML_ATTR(L"bIns", (int)(*dPaddingBottom));
|
||||
|
||||
if (inGroup == false)
|
||||
|
||||
@ -168,7 +168,7 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
|
||||
{
|
||||
if (val.bitmap->isInternal)
|
||||
{
|
||||
//CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"r:embed", val.bitmap->rId );
|
||||
}
|
||||
else
|
||||
|
||||
@ -81,7 +81,6 @@ static std::wstring get_mime_type(const std::wstring & extension)
|
||||
else if (L"mov" == extension) return L"video/unknown";
|
||||
else if (L"mp4" == extension) return L"video/unknown";
|
||||
else if (L"m4v" == extension) return L"video/unknown";
|
||||
else if (L"mkv" == extension) return L"video/unknown";
|
||||
|
||||
else if (L"bin" == extension) return L"application/vnd.openxmlformats-officedocument.oleObject";
|
||||
else if (L"xlsx" == extension) return L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -49,36 +49,21 @@ public:
|
||||
void start_table();
|
||||
int end_table();
|
||||
|
||||
void start_field ();
|
||||
void set_field_name (std::wstring name);
|
||||
void set_field_type (int type, int hierarchy);
|
||||
void set_field_function (int type);
|
||||
void set_field_user_function (std::wstring f);
|
||||
void add_field_subtotal (int function_type);
|
||||
void add_field_cache (int index, std::wstring value);
|
||||
void set_field_show_empty (bool val);
|
||||
void set_field_data_layout (bool val);
|
||||
void set_field_sort (int type);
|
||||
void set_field_groups (int type);
|
||||
void set_repeat_item_labels(bool val);
|
||||
void start_field();
|
||||
void set_field_name(std::wstring name);
|
||||
void set_field_type(int type);
|
||||
void set_field_function(int type);
|
||||
void set_field_user_function(std::wstring f);
|
||||
void add_field_subtotal(int function_type);
|
||||
void add_field_cache(int index, std::wstring value);
|
||||
void end_field();
|
||||
|
||||
int get_count();
|
||||
|
||||
void set_view_name(std::wstring name);
|
||||
void set_view_target_range(std::wstring ref);
|
||||
void set_view_target_table_name(std::wstring name);
|
||||
|
||||
void add_button_header(std::wstring ref);
|
||||
|
||||
void set_identify_categories(bool val);
|
||||
void set_drill(bool val);
|
||||
|
||||
void set_source_range(std::wstring table_name, std::wstring ref);
|
||||
|
||||
void set_source_database(std::wstring database, std::wstring table_name);
|
||||
void set_source_database_query(std::wstring database, std::wstring query);
|
||||
void set_source_database_sql(std::wstring database, std::wstring sql);
|
||||
|
||||
void write_cache_definitions_to (int index, std::wostream & strm);
|
||||
void write_cache_records_to (int index, std::wostream & strm);
|
||||
@ -89,8 +74,6 @@ public:
|
||||
void dump_rels_cache(int index, rels & Rels);
|
||||
void dump_rels_view (int index, rels & Rels);
|
||||
|
||||
std::wstring get_chart_source(std::wstring name);
|
||||
|
||||
void add_connections(std::wstring connections);
|
||||
bool is_connections();
|
||||
|
||||
|
||||
@ -394,7 +394,6 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"dimension")
|
||||
{
|
||||
if (current_table_column_ < 0) current_table_column_ = columns_count_;
|
||||
std::wstring ref2 = getCellAddress( current_table_column_, current_table_row_);
|
||||
CP_XML_ATTR(L"ref", L"A1:" + ref2);
|
||||
}
|
||||
@ -434,10 +433,10 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"selection")
|
||||
{
|
||||
CP_XML_ATTR(L"activeCell", getCellAddress(col, row));
|
||||
CP_XML_ATTR(L"activeCellId", 0);
|
||||
CP_XML_ATTR(L"pane", L"topLeft");
|
||||
CP_XML_ATTR(L"sqref", getCellAddress(col, row));
|
||||
CP_XML_ATTR(L"activeCellId", 0);
|
||||
CP_XML_ATTR(L"activeCell", getCellAddress(col, row));
|
||||
CP_XML_ATTR(L"pane", L"topLeft");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
@ -45,14 +46,6 @@ namespace cpdoccore {
|
||||
|
||||
namespace oox {
|
||||
|
||||
bool IsNumber(const std::wstring &value)
|
||||
{
|
||||
boost::wregex rule(L"\\-?^[0-9]*[.,]?[0-9]*$");
|
||||
boost::match_results<std::wstring::const_iterator> results;
|
||||
|
||||
return boost::regex_search(value/*.begin(), value.end(), results*/, rule);
|
||||
}
|
||||
|
||||
std::wstring getColAddress(size_t col)
|
||||
{
|
||||
static const size_t r = (L'Z' - L'A' + 1);
|
||||
@ -69,6 +62,8 @@ std::wstring getColAddress(size_t col)
|
||||
return std::wstring(1, (wchar_t)(L'A' + col));
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::wstring getRowAddress(size_t row)
|
||||
{
|
||||
return std::to_wstring(row + 1);
|
||||
|
||||
@ -40,8 +40,6 @@ namespace cpdoccore {
|
||||
|
||||
namespace oox {
|
||||
|
||||
bool IsNumber(const std::wstring &value);
|
||||
|
||||
std::wstring getColAddress(size_t col);
|
||||
std::wstring getRowAddress(size_t row);
|
||||
|
||||
|
||||
@ -447,18 +447,6 @@ void xlsx_conversion_context::end_table()
|
||||
get_table_context().dump_rels_hyperlinks (current_sheet().sheet_rels());
|
||||
get_table_context().dump_rels_ole_objects (current_sheet().sheet_rels());
|
||||
|
||||
typedef std::multimap<std::wstring, int> _mapPivotsTableView;
|
||||
std::pair<_mapPivotsTableView::iterator, _mapPivotsTableView::iterator> range;
|
||||
|
||||
range = mapPivotsTableView_.equal_range(current_sheet().name());
|
||||
|
||||
for (_mapPivotsTableView::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
current_sheet().sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(it->second),
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
|
||||
L"../pivotTables/pivotTable" + std::to_wstring(it->second) + L".xml"));
|
||||
}
|
||||
|
||||
if (!get_drawing_context().empty())
|
||||
{
|
||||
std::wstringstream strm;
|
||||
@ -714,10 +702,6 @@ void xlsx_conversion_context::end_hyperlink(std::wstring const & href)
|
||||
xlsx_text_context_.end_span2();
|
||||
}
|
||||
}
|
||||
void xlsx_conversion_context::add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view)
|
||||
{//ващето в либре жесткая привязка что на одном листе тока одна сводная может быть ..
|
||||
mapPivotsTableView_.insert(std::make_pair(sheet_name, index_table_view));
|
||||
}
|
||||
|
||||
void xlsx_conversion_context::start_conditional_format(std::wstring ref)
|
||||
{
|
||||
|
||||
@ -137,8 +137,6 @@ public:
|
||||
void end_hyperlink (std::wstring const & href);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
void add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view);
|
||||
|
||||
void start_conditional_format (std::wstring ref);
|
||||
void end_conditional_format (){}
|
||||
|
||||
@ -202,7 +200,6 @@ private:
|
||||
num_format_context num_format_context_;
|
||||
size_t default_style_;
|
||||
mediaitems mediaitems_;
|
||||
std::multimap<std::wstring, int> mapPivotsTableView_;
|
||||
|
||||
xlsx_style_manager xlsx_style_;
|
||||
xlsx_defined_names xlsx_defined_names_;
|
||||
|
||||
@ -77,15 +77,6 @@ typedef shared_ptr<const office_element>::Type office_element_ptr_const;
|
||||
|
||||
// Класс для конструирования чартов
|
||||
using namespace chart;
|
||||
|
||||
void object_odf_context::set_pivot_source(std::wstring const & val)
|
||||
{
|
||||
pivot_source_ = val;
|
||||
if (pivot_source_.empty() == false)
|
||||
{
|
||||
bPivotChart_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void object_odf_context::set_width(double valPt)
|
||||
{
|
||||
@ -176,11 +167,6 @@ void object_odf_context::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (object_type_ == 1)
|
||||
{
|
||||
if (pivot_source_.empty() == false)
|
||||
{
|
||||
pivot_source_ = Context.get_pivots_context().get_chart_source(pivot_source_);
|
||||
|
||||
}
|
||||
Context.start_chart(L"");
|
||||
oox::oox_chart_context & chart = Context.current_chart();
|
||||
|
||||
@ -280,60 +266,23 @@ void object_odf_context::calc_cache_series(std::wstring adress, std::vector<std:
|
||||
{
|
||||
if (adress.empty()) return;
|
||||
|
||||
if (bPivotChart_)
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
|
||||
std::wstring ref_1, ref_2, table;
|
||||
size_t col_1=0, row_1=0, col_2=0, row_2=0;
|
||||
|
||||
if (!converter.find_first_last_ref(adress, table, ref_1, ref_2))return;
|
||||
//if ((res = table.find(L"local-table"))<0)return;
|
||||
|
||||
oox::getCellAddressInv(ref_1, col_1,row_1);
|
||||
oox::getCellAddressInv(ref_2, col_2,row_2);
|
||||
|
||||
for (size_t i = 0; i < cash_values.size(); i++)
|
||||
{
|
||||
std::map<std::wstring, _cell>::iterator pFind = cash_pivot.find(adress);
|
||||
if (pFind != cash_pivot.end())
|
||||
if (cash_values[i].col >= col_1 && cash_values[i].col <= col_2 &&
|
||||
cash_values[i].row >= row_1 && cash_values[i].row <= row_2)
|
||||
{
|
||||
int col = pFind->second.col;
|
||||
int row = pFind->second.row;
|
||||
|
||||
if (col == 0 || row == 0)
|
||||
{
|
||||
for (size_t i = 0; i < cash_values.size(); i++)
|
||||
{
|
||||
if (col == 0)
|
||||
{
|
||||
if (cash_values[i].col == col)
|
||||
{
|
||||
cash.push_back(cash_values[i].val);
|
||||
}
|
||||
}
|
||||
if (row == 0)
|
||||
{
|
||||
if (cash_values[i].row == row)
|
||||
{
|
||||
cash.push_back(cash_values[i].val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cash.push_back(pFind->second.val);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
|
||||
std::wstring ref_1, ref_2, table;
|
||||
size_t col_1 = 0, row_1 = 0, col_2 = 0, row_2 = 0;
|
||||
|
||||
if (!converter.find_first_last_ref(adress, table, ref_1, ref_2))return;
|
||||
//if ((res = table.find(L"local-table"))<0)return;
|
||||
|
||||
oox::getCellAddressInv(ref_1, col_1, row_1);
|
||||
oox::getCellAddressInv(ref_2, col_2, row_2);
|
||||
|
||||
for (size_t i = 0; i < cash_values.size(); i++)
|
||||
{
|
||||
if (cash_values[i].col >= col_1 && cash_values[i].col <= col_2 &&
|
||||
cash_values[i].row >= row_1 && cash_values[i].row <= row_2)
|
||||
{
|
||||
cash.push_back(cash_values[i].val);
|
||||
}
|
||||
cash.push_back(cash_values[i].val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -348,8 +297,6 @@ struct axises_sort
|
||||
|
||||
void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
{
|
||||
chart_context.set_pivot_chart (pivot_source_);
|
||||
|
||||
chart_context.set_title (title_);
|
||||
chart_context.set_wall (wall_);
|
||||
chart_context.set_floor (floor_);
|
||||
@ -423,36 +370,30 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
{
|
||||
if (last_set_type == chart_bubble)
|
||||
{ //bubble(x)
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(4, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_formula_series(4, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (4, domain_cash);
|
||||
//y
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (3, cell_cash);
|
||||
}
|
||||
else
|
||||
{ //x
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (2, domain_cash);
|
||||
//y
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (3, cell_cash);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //common
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(1, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_formula_series(1, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series(1, cell_cash);
|
||||
}
|
||||
|
||||
if (categories_.empty() == false)//названия
|
||||
{
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(0, categories_[0], L"General", true);
|
||||
current->set_formula_series(0, categories_[0], L"General", true);
|
||||
current->set_values_series(0, cat_cash);
|
||||
}
|
||||
current->set_name(series_[i].name_);
|
||||
@ -619,13 +560,7 @@ void process_build_object::on_not_impl(std::string const & message)
|
||||
_CP_LOG << L"[process_object visitor] : not impliment for \"" << utf8_to_utf16(message) << L"\"" << std::endl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
void process_build_object::visit(office_document & val)
|
||||
{
|
||||
if (val.office_body_)
|
||||
val.office_body_->accept(*this);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
void process_build_object::visit(const office_document_content& val)
|
||||
{
|
||||
if (val.office_body_)
|
||||
@ -664,21 +599,18 @@ void process_build_object::visit(const chart_chart& val)
|
||||
{
|
||||
object_odf_context_.object_type_ = 1;
|
||||
|
||||
if (val.attlist_.common_draw_size_attlist_.svg_width_)
|
||||
if (val.chart_chart_attlist_.common_draw_size_attlist_.svg_width_)
|
||||
{
|
||||
object_odf_context_.set_width(val.attlist_.common_draw_size_attlist_.svg_width_->get_value_unit(length::pt));
|
||||
object_odf_context_.set_width(val.chart_chart_attlist_.common_draw_size_attlist_.svg_width_->get_value_unit(length::pt));
|
||||
}
|
||||
|
||||
if (val.attlist_.common_draw_size_attlist_.svg_height_)
|
||||
if (val.chart_chart_attlist_.common_draw_size_attlist_.svg_height_)
|
||||
{
|
||||
object_odf_context_.set_height(val.attlist_.common_draw_size_attlist_.svg_height_->get_value_unit(length::pt));
|
||||
object_odf_context_.set_height(val.chart_chart_attlist_.common_draw_size_attlist_.svg_height_->get_value_unit(length::pt));
|
||||
}
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.chart_graphic_properties_, object_odf_context_.chart_fill_);
|
||||
ApplyGraphicProperties (val.chart_chart_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.chart_graphic_properties_, object_odf_context_.chart_fill_);
|
||||
|
||||
object_odf_context_.set_class(val.attlist_.chart_class_);
|
||||
|
||||
if (val.attlist_.loext_data_pilot_source_)
|
||||
object_odf_context_.set_pivot_source(*val.attlist_.loext_data_pilot_source_);
|
||||
object_odf_context_.set_class(val.chart_chart_attlist_.chart_class_);
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
|
||||
@ -694,13 +626,13 @@ void process_build_object::visit(const chart_title& val)
|
||||
val.text_p_->text_to_stream(v);
|
||||
t.content_ = v.str();
|
||||
}
|
||||
ApplyTextProperties(val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), t.text_properties_);
|
||||
ApplyTextProperties(val.chart_title_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), t.text_properties_);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
if (val.attlist_.common_draw_position_attlist_.svg_x_)
|
||||
if (val.chart_title_attlist_.common_draw_position_attlist_.svg_x_)
|
||||
{
|
||||
t.pos_x = val.attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
|
||||
t.pos_y = val.attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
|
||||
t.pos_x = val.chart_title_attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
|
||||
t.pos_y = val.chart_title_attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
|
||||
}
|
||||
t.bEnabled = true;
|
||||
|
||||
@ -718,10 +650,10 @@ void process_build_object::visit(const chart_subtitle & val)
|
||||
val.text_p_->text_to_stream(v);
|
||||
t.content_ = v.str();
|
||||
|
||||
if (val.attlist_.common_draw_position_attlist_.svg_x_)
|
||||
if (val.chart_title_attlist_.common_draw_position_attlist_.svg_x_)
|
||||
{
|
||||
t.pos_x = val.attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
|
||||
t.pos_y = val.attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
|
||||
t.pos_x = val.chart_title_attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
|
||||
t.pos_y = val.chart_title_attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
|
||||
}
|
||||
t.bEnabled = true;
|
||||
object_odf_context_.sub_title_ = t;
|
||||
@ -740,32 +672,32 @@ void process_build_object::visit(const chart_legend& val)
|
||||
{
|
||||
object_odf_context_.legend_.bEnabled = true;
|
||||
|
||||
ApplyChartProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.properties_);
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.graphic_properties_,object_odf_context_.legend_.fill_);
|
||||
ApplyTextProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.text_properties_);
|
||||
ApplyChartProperties (val.chart_legend_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.properties_);
|
||||
ApplyGraphicProperties (val.chart_legend_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.graphic_properties_,object_odf_context_.legend_.fill_);
|
||||
ApplyTextProperties (val.chart_legend_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_plot_area& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
|
||||
object_odf_context_.plot_area_.cell_range_address_ = val.attlist_.table_cell_range_address_.get_value_or(L"");
|
||||
object_odf_context_.plot_area_.cell_range_address_ = val.chart_plot_area_attlist_.table_cell_range_address_.get_value_or(L"");
|
||||
|
||||
ApplyChartProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.properties_);
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.graphic_properties_, object_odf_context_.plot_area_.fill_);
|
||||
ApplyTextProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.text_properties_);
|
||||
ApplyChartProperties (val.chart_plot_area_attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.properties_);
|
||||
ApplyGraphicProperties (val.chart_plot_area_attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.graphic_properties_, object_odf_context_.plot_area_.fill_);
|
||||
ApplyTextProperties (val.chart_plot_area_attlist_.common_attlist_.chart_style_name_.get_value_or(L""),object_odf_context_.plot_area_.text_properties_);
|
||||
}
|
||||
|
||||
|
||||
void process_build_object::visit(const chart_axis& val)
|
||||
{
|
||||
object_odf_context_.start_axis(val.attlist_.chart_dimension_.get_value_or(L""),
|
||||
val.attlist_.chart_name_.get_value_or(L""),
|
||||
val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""));
|
||||
object_odf_context_.start_axis(val.chart_axis_attlist_.chart_dimension_.get_value_or(L""),
|
||||
val.chart_axis_attlist_.chart_name_.get_value_or(L""),
|
||||
val.chart_axis_attlist_.common_attlist_.chart_style_name_.get_value_or(L""));
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
|
||||
std::wstring style_name = val.attlist_.common_attlist_.chart_style_name_.get_value_or(L"");
|
||||
std::wstring style_name = val.chart_axis_attlist_.common_attlist_.chart_style_name_.get_value_or(L"");
|
||||
|
||||
ApplyChartProperties (style_name, object_odf_context_.axises_.back().properties_);
|
||||
ApplyGraphicProperties (style_name, object_odf_context_.axises_.back().graphic_properties_, object_odf_context_.axises_.back().fill_);
|
||||
@ -776,7 +708,7 @@ void process_build_object::visit(const chart_axis& val)
|
||||
|
||||
void process_build_object::visit(const chart_series& val)
|
||||
{
|
||||
const chart_series_attlist & att = val.attlist_;
|
||||
const chart_series_attlist & att = val.chart_series_attlist_;
|
||||
|
||||
chart::class_type chartClass = get_series_class_type(att.chart_class_.get_value_or(object_odf_context_.str_class_));
|
||||
|
||||
@ -805,21 +737,21 @@ void process_build_object::visit(const chart_domain& val)
|
||||
}
|
||||
void process_build_object::visit(const chart_grid& val)
|
||||
{
|
||||
object_odf_context_.add_grid(val.attlist_.chart_class_.get_value_or(L""),
|
||||
val.attlist_.common_attlist_.chart_style_name_.get_value_or(L"") );
|
||||
object_odf_context_.add_grid(val.chart_grid_attlist_.chart_class_.get_value_or(L""),
|
||||
val.chart_grid_attlist_.common_attlist_.chart_style_name_.get_value_or(L"") );
|
||||
|
||||
oox::_oox_fill fill;
|
||||
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), (object_odf_context_.axises_.back()).grids_.back().graphic_properties_, fill);
|
||||
ApplyGraphicProperties (val.chart_grid_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), (object_odf_context_.axises_.back()).grids_.back().graphic_properties_, fill);
|
||||
|
||||
}
|
||||
void process_build_object::visit(const chart_wall& val)
|
||||
{
|
||||
object_odf_context_.wall_.bEnabled = true;
|
||||
|
||||
ApplyChartProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.properties_);
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.graphic_properties_,object_odf_context_.wall_.fill_);
|
||||
ApplyTextProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.text_properties_);
|
||||
ApplyChartProperties (val.chart_wall_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.properties_);
|
||||
ApplyGraphicProperties (val.chart_wall_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.graphic_properties_,object_odf_context_.wall_.fill_);
|
||||
ApplyTextProperties (val.chart_wall_attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_floor& val)
|
||||
@ -833,12 +765,12 @@ void process_build_object::visit(const chart_floor& val)
|
||||
|
||||
void process_build_object::visit(const chart_data_point & val)
|
||||
{
|
||||
object_odf_context_.add_point( val.attlist_.chart_repeated_.get_value_or(1));
|
||||
object_odf_context_.add_point( val.chart_data_point_attlist_.chart_repeated_.get_value_or(1));
|
||||
|
||||
if (val.attlist_.common_attlist_.chart_style_name_)
|
||||
if (val.chart_data_point_attlist_.common_attlist_.chart_style_name_)
|
||||
{
|
||||
object_odf_context_.series_.back().points_.back().bEnabled = true;
|
||||
std::wstring style_name = val.attlist_.common_attlist_.chart_style_name_.get_value_or(L"");
|
||||
std::wstring style_name = val.chart_data_point_attlist_.common_attlist_.chart_style_name_.get_value_or(L"");
|
||||
|
||||
ApplyGraphicProperties (style_name, object_odf_context_.series_.back().points_.back().graphic_properties_,
|
||||
object_odf_context_.series_.back().points_.back().fill_);
|
||||
@ -963,21 +895,12 @@ void process_build_object::visit(const table_table_cell& val)
|
||||
|
||||
unsigned int repeated = val.attlist_.table_number_columns_repeated_;
|
||||
|
||||
std::wstring cell_val, cell_cash, cell_desc;
|
||||
|
||||
for (size_t i = 0 ; i < val.content_.elements_.size(); i++)
|
||||
{
|
||||
std::wstringstream wstream_temp;
|
||||
val.content_.elements_[i]->text_to_stream(wstream_temp);
|
||||
if (val.content_.elements_[i]->get_type() == typeTextP)
|
||||
{
|
||||
cell_cash += wstream_temp.str();
|
||||
}
|
||||
else if (val.content_.elements_[i]->get_type() == typeDrawG)
|
||||
{
|
||||
cell_desc += wstream_temp.str();
|
||||
}
|
||||
}
|
||||
std::wstringstream wstream_temp;
|
||||
|
||||
val.content_.text_to_stream(wstream_temp);
|
||||
std::wstring cell_cash = wstream_temp.str();
|
||||
|
||||
std::wstring cell_val;
|
||||
|
||||
if (attlist.common_value_and_type_attlist_.office_value_) cell_val = *attlist.common_value_and_type_attlist_.office_value_;
|
||||
else if (attlist.common_value_and_type_attlist_.office_currency_) cell_val = *attlist.common_value_and_type_attlist_.office_currency_;
|
||||
@ -989,16 +912,11 @@ void process_build_object::visit(const table_table_cell& val)
|
||||
if (cell_cash.empty())
|
||||
cell_cash = cell_val;
|
||||
|
||||
object_odf_context::_cell cell_= {object_odf_context_.current_table_column_, object_odf_context_.current_table_row_, cell_cash};
|
||||
object_odf_context::_cell cell_={object_odf_context_.current_table_column_, object_odf_context_.current_table_row_, cell_cash};
|
||||
|
||||
object_odf_context_.cash_values.push_back(cell_);
|
||||
|
||||
object_odf_context_.current_table_column_+=repeated;
|
||||
|
||||
if (object_odf_context_.bPivotChart_)
|
||||
{
|
||||
object_odf_context_.cash_pivot.insert(std::make_pair(cell_desc, cell_));
|
||||
}
|
||||
}
|
||||
void process_build_object::visit(const table_covered_table_cell& val)
|
||||
{
|
||||
|
||||
@ -111,7 +111,6 @@ public:
|
||||
width_pt_ (0),
|
||||
height_pt_ (0),
|
||||
in_axis_ (false),
|
||||
bPivotChart_ (false),
|
||||
current_table_column_ (0),
|
||||
current_table_row_ (0),
|
||||
columns_spanned_num_ (0),
|
||||
@ -125,8 +124,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void set_pivot_source(std::wstring const & val);
|
||||
|
||||
void set_width(double valPt);
|
||||
|
||||
void set_height(double valPt);
|
||||
@ -173,9 +170,6 @@ public:
|
||||
std::wstring style_name_;
|
||||
std::wstring name_;
|
||||
|
||||
std::wstring pivot_source_;
|
||||
bool bPivotChart_;
|
||||
|
||||
bool in_axis_;
|
||||
std::vector<chart::axis> axises_;
|
||||
std::vector<chart::series> series_;
|
||||
@ -201,7 +195,6 @@ public:
|
||||
oox::_oox_fill chart_fill_;
|
||||
|
||||
std::vector<_cell> cash_values;
|
||||
std::map<std::wstring, _cell>cash_pivot;
|
||||
|
||||
//---------------------------------------
|
||||
std::wstring target_table_;
|
||||
@ -223,8 +216,6 @@ public:
|
||||
|
||||
class process_build_object
|
||||
: public base_visitor,
|
||||
public visitor<office_document>,
|
||||
|
||||
public const_visitor<office_document_content>,
|
||||
public visitor<office_document_content>,
|
||||
|
||||
@ -292,8 +283,7 @@ private:
|
||||
virtual void on_not_impl(std::string const & message);
|
||||
|
||||
public:
|
||||
virtual void visit(office_document & val);
|
||||
|
||||
|
||||
virtual void visit(const office_document_content& val);
|
||||
virtual void visit(office_document_content & val);
|
||||
|
||||
|
||||
@ -86,8 +86,7 @@ const std::wstring color::get_hex_value() const
|
||||
{
|
||||
boost::algorithm::trim(tmp);
|
||||
boost::algorithm::trim_left_if(tmp, boost::algorithm::is_any_of("#"));
|
||||
|
||||
return XmlUtils::GetUpper(tmp);
|
||||
return tmp;
|
||||
}
|
||||
else if (tmp.size() == 6)
|
||||
{
|
||||
@ -97,7 +96,7 @@ const std::wstring color::get_hex_value() const
|
||||
unsigned int t = 0;
|
||||
if ((s << tmp) && (s >> std::hex >> t) && (s >> std::ws).eof())
|
||||
{
|
||||
return XmlUtils::GetUpper(tmp);
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
|
||||
@ -1,94 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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 "dategroup.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <ostream>
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const date_group & _Val)
|
||||
{
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case date_group::seconds:
|
||||
_Wostream << L"seconds";
|
||||
break;
|
||||
case date_group::minutes:
|
||||
_Wostream << L"minutes";
|
||||
break;
|
||||
case date_group::hours:
|
||||
_Wostream << L"hours";
|
||||
break;
|
||||
case date_group::days:
|
||||
_Wostream << L"days";
|
||||
break;
|
||||
case date_group::months:
|
||||
_Wostream << L"months";
|
||||
break;
|
||||
case date_group::quarters:
|
||||
_Wostream << L"quarters";
|
||||
break;
|
||||
case date_group::years:
|
||||
_Wostream << L"years";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
date_group date_group::parse(const std::wstring & Str)
|
||||
{
|
||||
std::wstring tmp = Str;
|
||||
boost::algorithm::to_lower(tmp);
|
||||
|
||||
if (tmp == L"seconds")
|
||||
return date_group( seconds );
|
||||
else if (tmp == L"minutes")
|
||||
return date_group( minutes );
|
||||
else if (tmp == L"hours")
|
||||
return date_group( hours );
|
||||
else if (tmp == L"days")
|
||||
return date_group( days );
|
||||
else if (tmp == L"months")
|
||||
return date_group( months );
|
||||
else if (tmp == L"quarters")
|
||||
return date_group( quarters );
|
||||
else if (tmp == L"years")
|
||||
return date_group( years );
|
||||
else
|
||||
{
|
||||
return date_group( months );
|
||||
}
|
||||
}
|
||||
|
||||
} }
|
||||
@ -1,78 +0,0 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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 <iosfwd>
|
||||
#include <string>
|
||||
#include "odfattributes.h"
|
||||
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
class date_group
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
seconds,
|
||||
minutes,
|
||||
hours,
|
||||
days,
|
||||
months,
|
||||
quarters,
|
||||
years
|
||||
};
|
||||
|
||||
date_group() {}
|
||||
|
||||
date_group(type _Type) : type_(_Type)
|
||||
{}
|
||||
|
||||
type get_type() const
|
||||
{
|
||||
return type_;
|
||||
};
|
||||
|
||||
static date_group parse(const std::wstring & Str);
|
||||
|
||||
private:
|
||||
type type_;
|
||||
|
||||
};
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const date_group & _Val);
|
||||
|
||||
}
|
||||
|
||||
APPLY_PARSE_XML_ATTRIBUTES(odf_types::date_group);
|
||||
|
||||
}
|
||||
@ -105,10 +105,7 @@ void draw_image::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
//CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
}
|
||||
std::wostream & draw_image::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
// draw:chart
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * draw_chart::ns = L"draw";
|
||||
@ -154,13 +151,6 @@ void draw_g::add_child_element( xml::sax * Reader, const std::wstring & Ns, cons
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
std::wostream & draw_g::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
CP_SERIALIZE_TEXT(content_);
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
// draw:frame
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * draw_frame::ns = L"draw";
|
||||
@ -271,11 +261,7 @@ void draw_object::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
void draw_object::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"office", L"document")
|
||||
{
|
||||
//embedded
|
||||
odf_document_ = odf_document_ptr( new odf_document(Reader));
|
||||
}
|
||||
CP_NOT_APPLICABLE_ELM(); // TODO
|
||||
}
|
||||
|
||||
// draw:object
|
||||
@ -342,10 +328,8 @@ std::wstring draw_object_ole::detectObject(const std::wstring &fileName)
|
||||
}
|
||||
|
||||
|
||||
std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
|
||||
{
|
||||
if (!odfDocument) return L"";
|
||||
|
||||
std::wstring href_result;
|
||||
std::wstring folderPath = odfDocument->get_folder();
|
||||
std::wstring objectOutPath = NSDirectory::CreateDirectoryWithUniqueName(folderPath);
|
||||
@ -353,7 +337,7 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
if (type == 1)
|
||||
{
|
||||
oox::package::docx_document outputDocx;
|
||||
oox::docx_conversion_context conversionDocxContext ( odfDocument.get());
|
||||
oox::docx_conversion_context conversionDocxContext ( odfDocument);
|
||||
|
||||
conversionDocxContext.set_output_document (&outputDocx);
|
||||
//conversionContext.set_font_directory (fontsPath);
|
||||
@ -372,7 +356,7 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
if (type == 2)
|
||||
{
|
||||
oox::package::xlsx_document outputXlsx;
|
||||
oox::xlsx_conversion_context conversionXlsxContext ( odfDocument.get());
|
||||
oox::xlsx_conversion_context conversionXlsxContext ( odfDocument);
|
||||
|
||||
conversionXlsxContext.set_output_document (&outputXlsx);
|
||||
//conversionContext.set_font_directory (fontsPath);
|
||||
|
||||
@ -49,14 +49,13 @@ namespace cpdoccore {
|
||||
|
||||
namespace odf_reader {
|
||||
|
||||
class odf_document;
|
||||
typedef shared_ptr<odf_document>::Type odf_document_ptr;
|
||||
|
||||
/// draw-image-attlist
|
||||
class draw_image_attlist
|
||||
{
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) draw_filter_name_;
|
||||
|
||||
};
|
||||
@ -70,9 +69,7 @@ public:
|
||||
static const ElementType type = typeDrawImage;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
@ -82,15 +79,14 @@ private:
|
||||
|
||||
draw_image_attlist draw_image_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
|
||||
office_element_ptr office_binary_data_;
|
||||
|
||||
office_element_ptr office_binary_data_;
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_image);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//draw-chart-attlist
|
||||
class draw_chart_attlist
|
||||
{
|
||||
public:
|
||||
@ -138,6 +134,7 @@ class draw_frame_attlist
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) draw_copy_of_;
|
||||
_CP_OPT(odf_types::length_or_percent) fo_min_width_;
|
||||
_CP_OPT(odf_types::length_or_percent) fo_min_height_;
|
||||
@ -194,12 +191,15 @@ private:
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_frame);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
//draw-frame-attlist
|
||||
class draw_g_attlist
|
||||
{
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
};
|
||||
|
||||
|
||||
class draw_g : public office_element_impl<draw_g>
|
||||
{
|
||||
public:
|
||||
@ -209,9 +209,7 @@ public:
|
||||
static const ElementType type = typeDrawG;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
@ -228,6 +226,7 @@ private:
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_g);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
// draw-text-box-attlist
|
||||
class draw_text_box_attlist
|
||||
{
|
||||
public:
|
||||
@ -269,6 +268,7 @@ private:
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_text_box);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
/// draw-object-attlist
|
||||
class draw_object_attlist
|
||||
{
|
||||
public:
|
||||
@ -280,6 +280,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
// draw:object
|
||||
class draw_object : public office_element_impl<draw_object>
|
||||
{
|
||||
public:
|
||||
@ -296,17 +297,16 @@ public:
|
||||
draw_object_attlist draw_object_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
|
||||
odf_document_ptr odf_document_;
|
||||
|
||||
private:
|
||||
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
std::wstring office_convert(odf_document_ptr odfDocument, int type);
|
||||
std::wstring office_convert(odf_document * odfDocument, int type);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_object);
|
||||
|
||||
// draw:object-ole
|
||||
class draw_object_ole : public office_element_impl<draw_object>
|
||||
{
|
||||
public:
|
||||
@ -332,6 +332,7 @@ private:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_object_ole);
|
||||
|
||||
// draw:param
|
||||
class draw_param : public office_element_impl<draw_param>
|
||||
{
|
||||
public:
|
||||
@ -355,6 +356,7 @@ private:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_param);
|
||||
|
||||
// draw:plugin
|
||||
class draw_plugin : public office_element_impl<draw_plugin>
|
||||
{
|
||||
public:
|
||||
|
||||
@ -1408,25 +1408,22 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (!odf_document_)
|
||||
{
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
//normalize path ??? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
|
||||
odf_document_ = odf_document_ptr(new odf_document(objectPath, NULL));
|
||||
}
|
||||
cpdoccore::odf_reader::odf_document objectSubDoc(objectPath ,NULL);
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
draw_frame* frame = NULL;
|
||||
oox::_docx_drawing * drawing = NULL;
|
||||
office_element* contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL;
|
||||
office_element* contentSubDoc = objectSubDoc.get_impl()->get_content();
|
||||
|
||||
object_odf_context objectBuild (href);
|
||||
if (contentSubDoc)
|
||||
{
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context());
|
||||
process_build_object process_build_object_(objectBuild, objectSubDoc.odf_context());
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
|
||||
objectBuild.docx_convert(Context);
|
||||
@ -1496,7 +1493,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
bool & use_image_replace = Context.get_drawing_context().get_use_image_replace();
|
||||
use_image_replace = true;
|
||||
|
||||
std::wstring href_new = office_convert(odf_document_, 2);
|
||||
std::wstring href_new = office_convert(&objectSubDoc, 2);
|
||||
|
||||
if (!href_new.empty())
|
||||
{
|
||||
|
||||
@ -255,22 +255,18 @@ void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
try
|
||||
{
|
||||
try {
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (!odf_document_)
|
||||
{
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
//normalize path ??? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
|
||||
odf_document_ = odf_document_ptr(new odf_document(objectPath, NULL));
|
||||
}
|
||||
cpdoccore::odf_reader::odf_document objectSubDoc(objectPath, NULL);
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
office_element *contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL;
|
||||
office_element *contentSubDoc = objectSubDoc.get_impl()->get_content();
|
||||
if (!contentSubDoc)
|
||||
{
|
||||
//здесь другой формат xml (не Open Office)
|
||||
@ -279,13 +275,13 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
object_odf_context objectBuild(href);
|
||||
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context() );
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
process_build_object process_build_object_(objectBuild, objectSubDoc.odf_context());
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
if (objectBuild.object_type_ == 1)//диаграмма
|
||||
{
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"Chart");
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
objectBuild.pptx_convert(Context);
|
||||
|
||||
Context.get_slide_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы
|
||||
@ -294,7 +290,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href_new = office_convert( odf_document_, 1);
|
||||
std::wstring href_new = office_convert( &objectSubDoc, 1);
|
||||
|
||||
if (!href_new.empty())
|
||||
{
|
||||
@ -328,7 +324,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href_new = office_convert( odf_document_, 2);
|
||||
std::wstring href_new = office_convert( &objectSubDoc, 2);
|
||||
|
||||
if (!href_new.empty())
|
||||
{
|
||||
|
||||
@ -203,19 +203,8 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (href.empty() && office_binary_data_)
|
||||
{
|
||||
office_binary_data* binary_data = dynamic_cast<office_binary_data*>(office_binary_data_.get());
|
||||
|
||||
if (binary_data)
|
||||
{
|
||||
href = binary_data->write_to(Context.root()->get_folder());
|
||||
}
|
||||
}
|
||||
|
||||
Context.get_drawing_context().set_image(href);
|
||||
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
Context.get_drawing_context().set_image(href);
|
||||
|
||||
////////////////////////////////////в принципе достаточно общая часть ...
|
||||
Context.get_text_context().start_drawing_content();//... если в объекте есть текст он привяжется к объекту - иначе к ячейке
|
||||
@ -257,39 +246,34 @@ void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
if (text_content_.length()>0)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"text-content", text_content_));
|
||||
Context.get_drawing_context().set_property(_property(L"text-content",text_content_));
|
||||
}
|
||||
}
|
||||
void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
if (!odf_document_)
|
||||
{
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
try {
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
odf_document_ = odf_document_ptr(new odf_document(objectPath, NULL));
|
||||
}
|
||||
office_element *contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL;
|
||||
if (!contentSubDoc)
|
||||
{
|
||||
//здесь другой формат xml (не Open Office)
|
||||
//временно - замещающая картинка(если она конечно присутствует)
|
||||
return;
|
||||
}
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
|
||||
cpdoccore::odf_reader::odf_document objectSubDoc(objectPath,NULL);
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
office_element *contentSubDoc = objectSubDoc.get_impl()->get_content();
|
||||
object_odf_context objectBuild(href);
|
||||
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context() );
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
if (contentSubDoc)
|
||||
{
|
||||
process_build_object process_build_object_(objectBuild, objectSubDoc.odf_context());
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
if (objectBuild.object_type_ == 1) //диаграмма
|
||||
{
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"chart");
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
objectBuild.xlsx_convert(Context);
|
||||
|
||||
Context.get_drawing_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы
|
||||
@ -298,7 +282,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_drawing_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href_new = office_convert( odf_document_, 1);
|
||||
std::wstring href_new = office_convert( &objectSubDoc, 1);
|
||||
|
||||
if (!href_new.empty())
|
||||
{
|
||||
|
||||
@ -41,22 +41,9 @@
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
const wchar_t * svg_desc::ns = L"svg";
|
||||
const wchar_t * svg_desc::name = L"desc";
|
||||
|
||||
std::wostream & svg_desc::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
_Wostream << text_ ;
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
void svg_desc::add_text(const std::wstring & Text)
|
||||
{
|
||||
text_ = Text;
|
||||
}
|
||||
|
||||
// svg:font-face-uri
|
||||
//---------------------------------------------------------------------------------------
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * svg_font_face_uri::ns = L"svg";
|
||||
const wchar_t * svg_font_face_uri::name = L"font-face-uri";
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ public:
|
||||
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
};
|
||||
|
||||
// svg:font-face-uri
|
||||
class svg_font_face_uri : public office_element_impl<svg_font_face_uri>
|
||||
{
|
||||
@ -79,31 +80,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_uri);
|
||||
|
||||
// svg:desc
|
||||
class svg_desc : public office_element_impl<svg_desc>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeSvgDesc;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
std::wstring text_;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(svg_desc);
|
||||
|
||||
// svg:font-face-format
|
||||
class svg_font_face_format : public office_element_impl<svg_font_face_format>
|
||||
{
|
||||
public:
|
||||
@ -123,6 +100,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_format);
|
||||
|
||||
// svg:font-face-name
|
||||
|
||||
@ -64,11 +64,7 @@ void content_xml_t::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
void content_xml_t::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"office", L"document")
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"office", L"document-content")
|
||||
if CP_CHECK_NAME(L"office", L"document-content")
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true);
|
||||
}
|
||||
@ -88,10 +84,6 @@ void content_xml_t::add_child_element( xml::sax * Reader, const std::wstring & N
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"manifest", L"manifest")
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true);
|
||||
}
|
||||
}
|
||||
|
||||
void content_xml_t::add_text(const std::wstring & Text)
|
||||
|
||||
@ -38,9 +38,7 @@
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
odf_document::odf_document(const std::wstring & Folder, const ProgressCallback* CallBack) : impl_(new Impl(Folder, CallBack))
|
||||
{}
|
||||
odf_document::odf_document( xml::sax * Reader) : impl_(new Impl(Reader))
|
||||
odf_document::odf_document(const std::wstring & Folder, const ProgressCallback* CallBack) : impl_(new Impl(Folder,CallBack))
|
||||
{}
|
||||
|
||||
odf_document::~odf_document()
|
||||
|
||||
@ -106,122 +106,47 @@ content_xml_t_ptr read_file_content(const std::wstring & Path)
|
||||
|
||||
return result;
|
||||
}
|
||||
content_xml_t_ptr read_file_content(xml::sax * reader_owner)
|
||||
{
|
||||
if (!reader_owner) return content_xml_t_ptr();
|
||||
|
||||
content_xml_t_ptr result( new content_xml_t() );
|
||||
|
||||
const std::wstring namespacePrefix = reader_owner->namespacePrefix();
|
||||
const std::wstring localName = reader_owner->nodeLocalName();
|
||||
|
||||
result->add_child_element(reader_owner, namespacePrefix, localName);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
odf_document::Impl::Impl(xml::sax * Reader):
|
||||
context_(new odf_read_context()), base_folder_(L""), pCallBack(NULL), bUserStopConvert (0)
|
||||
|
||||
odf_document::Impl::Impl(const std::wstring & folderPath, const ProgressCallback* CallBack) :
|
||||
context_(new odf_read_context()), base_folder_(folderPath), pCallBack(CallBack), bUserStopConvert (0)
|
||||
{
|
||||
office_mime_type_ = 0;
|
||||
encrypted = false;
|
||||
|
||||
content_xml_ = read_file_content(Reader);
|
||||
|
||||
if (content_xml_)
|
||||
{
|
||||
_CP_LOG << L"[info] parse fonts" << std::endl;
|
||||
parse_fonts(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse styles" << std::endl;
|
||||
parse_styles(content_xml_->get_content());
|
||||
std::wstring content_xml = folderPath + FILE_SEPARATOR_STR + L"content.xml";
|
||||
std::wstring styles_xml = folderPath + FILE_SEPARATOR_STR + L"styles.xml";
|
||||
std::wstring meta_xml = folderPath + FILE_SEPARATOR_STR + L"meta.xml";
|
||||
std::wstring settings_xml = folderPath + FILE_SEPARATOR_STR + L"settings.xml";
|
||||
std::wstring manifest_xml = folderPath + FILE_SEPARATOR_STR + L"META-INF" + FILE_SEPARATOR_STR + L"manifest.xml";
|
||||
|
||||
_CP_LOG << L"[info] parse manifest" << std::endl;
|
||||
parse_manifests(content_xml_->get_content());
|
||||
_CP_LOG << L"[info] read manifest.xml" << std::endl;
|
||||
manifest_xml_ = read_file_content(manifest_xml);
|
||||
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings(content_xml_->get_content());
|
||||
|
||||
tmp_folder_ = NSDirectory::CreateDirectoryWithUniqueName(NSDirectory::GetTempPath());
|
||||
}
|
||||
}
|
||||
_CP_LOG << L"[info] read settings.xml" << std::endl;
|
||||
settings_xml_ = read_file_content(settings_xml);
|
||||
|
||||
odf_document::Impl::Impl(const std::wstring & srcPath, const ProgressCallback* CallBack) :
|
||||
context_(new odf_read_context()), pCallBack(CallBack), bUserStopConvert (0)
|
||||
{
|
||||
office_mime_type_ = 0;
|
||||
encrypted = false;
|
||||
_CP_LOG << L"[info] read content.xml" << std::endl;
|
||||
content_xml_ = read_file_content(content_xml);
|
||||
|
||||
if (NSDirectory::Exists(srcPath))
|
||||
{
|
||||
base_folder_ = srcPath;
|
||||
_CP_LOG << L"[info] read styles.xml" << std::endl;
|
||||
styles_xml_ = read_file_content(styles_xml);
|
||||
|
||||
std::wstring content_xml = srcPath + FILE_SEPARATOR_STR + L"content.xml";
|
||||
std::wstring styles_xml = srcPath + FILE_SEPARATOR_STR + L"styles.xml";
|
||||
std::wstring meta_xml = srcPath + FILE_SEPARATOR_STR + L"meta.xml";
|
||||
std::wstring settings_xml = srcPath + FILE_SEPARATOR_STR + L"settings.xml";
|
||||
std::wstring manifest_xml = srcPath + FILE_SEPARATOR_STR + L"META-INF" + FILE_SEPARATOR_STR + L"manifest.xml";
|
||||
_CP_LOG << L"[info] parse fonts" << std::endl;
|
||||
parse_fonts();
|
||||
|
||||
_CP_LOG << L"[info] read manifest.xml" << std::endl;
|
||||
manifest_xml_ = read_file_content(manifest_xml);
|
||||
_CP_LOG << L"[info] parse styles" << std::endl;
|
||||
parse_styles();
|
||||
|
||||
_CP_LOG << L"[info] read settings.xml" << std::endl;
|
||||
settings_xml_ = read_file_content(settings_xml);
|
||||
_CP_LOG << L"[info] parse manifest" << std::endl;
|
||||
parse_manifests();
|
||||
|
||||
_CP_LOG << L"[info] read content.xml" << std::endl;
|
||||
content_xml_ = read_file_content(content_xml);
|
||||
|
||||
_CP_LOG << L"[info] read styles.xml" << std::endl;
|
||||
styles_xml_ = read_file_content(styles_xml);
|
||||
//----------------------------------------------------------------------------------------
|
||||
_CP_LOG << L"[info] parse fonts" << std::endl;
|
||||
parse_fonts(content_xml_ ? content_xml_->get_content() : NULL);
|
||||
|
||||
_CP_LOG << L"[info] parse styles" << std::endl;
|
||||
parse_styles(styles_xml_ ? styles_xml_->get_content() : NULL);
|
||||
|
||||
_CP_LOG << L"[info] parse manifest" << std::endl;
|
||||
parse_manifests(manifest_xml_ ? manifest_xml_->get_content() : NULL);
|
||||
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings(settings_xml_ ? settings_xml_->get_content() : NULL);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_CP_LOG << L"[info] read flat document" << std::endl;
|
||||
content_xml_ = read_file_content(srcPath);
|
||||
|
||||
if (content_xml_)
|
||||
{
|
||||
_CP_LOG << L"[info] parse fonts" << std::endl;
|
||||
parse_fonts(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse styles" << std::endl;
|
||||
parse_styles(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse manifest" << std::endl;
|
||||
parse_manifests(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings(content_xml_->get_content());
|
||||
|
||||
tmp_folder_ = NSDirectory::CreateDirectoryWithUniqueName(NSDirectory::GetTempPath());
|
||||
}
|
||||
}
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings();
|
||||
|
||||
UpdateProgress(400000);
|
||||
}
|
||||
odf_document::Impl::~Impl()
|
||||
{
|
||||
if (!tmp_folder_.empty())
|
||||
NSDirectory::DeleteDirectory(tmp_folder_);
|
||||
}
|
||||
const std::wstring & odf_document::Impl::get_folder() const
|
||||
{
|
||||
if (!base_folder_.empty()) return base_folder_;
|
||||
else return tmp_folder_;
|
||||
}
|
||||
|
||||
bool odf_document::Impl::UpdateProgress(long nComplete)
|
||||
{
|
||||
if (pCallBack)
|
||||
@ -237,11 +162,17 @@ bool odf_document::Impl::UpdateProgress(long nComplete)
|
||||
return false;
|
||||
}
|
||||
|
||||
void odf_document::Impl::parse_fonts(office_element *element)
|
||||
void odf_document::Impl::parse_fonts()
|
||||
{
|
||||
do
|
||||
{
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( element );
|
||||
if (!content_xml_)
|
||||
{
|
||||
_CP_LOG << L"[warning] empty content xml\n";
|
||||
break;
|
||||
}
|
||||
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( content_xml_->get_content() );
|
||||
if (!document)
|
||||
{
|
||||
_CP_LOG << L"[warning] empty document\n";
|
||||
@ -305,12 +236,15 @@ void odf_document::Impl::parse_fonts(office_element *element)
|
||||
}
|
||||
while (0);
|
||||
}
|
||||
void odf_document::Impl::parse_manifests(office_element *element)
|
||||
void odf_document::Impl::parse_manifests()
|
||||
{
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( element );
|
||||
if (!manifest_xml_)return;
|
||||
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( manifest_xml_->get_content() );
|
||||
|
||||
if (!document)return;
|
||||
|
||||
int res =-1;
|
||||
for (size_t i = 0; i < document->manifests_.size(); i++)
|
||||
{
|
||||
office_element_ptr & elm = document->manifests_[i];
|
||||
@ -318,44 +252,34 @@ void odf_document::Impl::parse_manifests(office_element *element)
|
||||
manifest_entry * entry = dynamic_cast<manifest_entry *>(elm.get());
|
||||
if (!entry)continue;
|
||||
|
||||
if (entry->full_path_ == L"content.xml" && entry->encryption_) encrypted = true;
|
||||
if (entry->full_path_==L"content.xml" && entry->encryption_) encrypted = true;
|
||||
|
||||
if (entry->full_path_ == L"/")
|
||||
if (entry->full_path_==L"/")
|
||||
{
|
||||
if (std::wstring::npos != entry->media_type_.find(L"application/vnd.oasis.opendocument.text"))
|
||||
res = entry->media_type_.find(L"application/vnd.oasis.opendocument.text");
|
||||
if (res>=0)
|
||||
{
|
||||
office_mime_type_ = 1;
|
||||
}
|
||||
else if (std::wstring::npos != entry->media_type_.find(L"application/vnd.oasis.opendocument.spreadsheet"))
|
||||
res = entry->media_type_.find(L"application/vnd.oasis.opendocument.spreadsheet");
|
||||
if (res>=0)
|
||||
{
|
||||
office_mime_type_ = 2;
|
||||
}
|
||||
else if (std::wstring::npos != entry->media_type_.find(L"application/vnd.oasis.opendocument.presentation"))
|
||||
res = entry->media_type_.find(L"application/vnd.oasis.opendocument.presentation");
|
||||
if (res>=0)
|
||||
{
|
||||
office_mime_type_ = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!office_mime_type_ && !document->office_mimetype_.empty())
|
||||
{
|
||||
if (std::wstring::npos != document->office_mimetype_.find(L"application/vnd.oasis.opendocument.text"))
|
||||
{
|
||||
office_mime_type_ = 1;
|
||||
}
|
||||
else if (std::wstring::npos != document->office_mimetype_.find(L"application/vnd.oasis.opendocument.spreadsheet"))
|
||||
{
|
||||
office_mime_type_ = 2;
|
||||
}
|
||||
else if (std::wstring::npos != document->office_mimetype_.find(L"application/vnd.oasis.opendocument.presentation"))
|
||||
{
|
||||
office_mime_type_ = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void odf_document::Impl::parse_settings(office_element *element)
|
||||
void odf_document::Impl::parse_settings()
|
||||
{
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( element );
|
||||
if (!settings_xml_)return;
|
||||
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( settings_xml_->get_content() );
|
||||
if (!document) return;
|
||||
|
||||
office_settings * settings = dynamic_cast<office_settings*>(document->office_settings_.get());
|
||||
@ -434,14 +358,20 @@ void odf_document::Impl::parse_settings(office_element *element)
|
||||
}
|
||||
}
|
||||
|
||||
void odf_document::Impl::parse_styles(office_element *element)
|
||||
void odf_document::Impl::parse_styles()
|
||||
{
|
||||
do
|
||||
{
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( element );
|
||||
if (!styles_xml_)
|
||||
{
|
||||
_CP_LOG << L"[warning] empty styles xml\n";
|
||||
break;
|
||||
}
|
||||
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( styles_xml_->get_content() );
|
||||
if (!document)
|
||||
{
|
||||
_CP_LOG << L"[warning] empty styles\n";
|
||||
_CP_LOG << L"[warning] empty document\n";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -54,19 +54,16 @@ class odf_document::Impl
|
||||
{
|
||||
public:
|
||||
Impl(const std::wstring & Folder, const ProgressCallback* CallBack);
|
||||
Impl(xml::sax * Reader);
|
||||
virtual ~Impl();
|
||||
|
||||
odf_read_context & odf_context();
|
||||
|
||||
bool docx_convert(oox::docx_conversion_context & Context);
|
||||
bool xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
bool pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
const std::wstring & get_folder() const;
|
||||
const std::wstring & get_folder() const { return base_folder_; }
|
||||
|
||||
const office_element * get_content() const;
|
||||
office_element * get_content();
|
||||
const office_element * get_content() const;
|
||||
office_element * get_content();
|
||||
|
||||
long get_office_mime_type() {return office_mime_type_;}
|
||||
|
||||
@ -80,20 +77,20 @@ private:
|
||||
|
||||
odf_read_context_ptr context_;
|
||||
|
||||
void parse_styles (office_element *element);
|
||||
void parse_fonts (office_element *elemen);
|
||||
void parse_manifests(office_element *element);
|
||||
void parse_settings (office_element *element);
|
||||
void parse_styles();
|
||||
void parse_fonts();
|
||||
void parse_manifests();
|
||||
void parse_settings();
|
||||
|
||||
private:
|
||||
content_xml_t_ptr content_xml_;
|
||||
content_xml_t_ptr styles_xml_;
|
||||
content_xml_t_ptr meta_xml_;
|
||||
content_xml_t_ptr settings_xml_;
|
||||
content_xml_t_ptr manifest_xml_;
|
||||
|
||||
private:
|
||||
std::wstring base_folder_;
|
||||
std::wstring tmp_folder_;
|
||||
|
||||
long office_mime_type_;
|
||||
bool encrypted;
|
||||
|
||||
|
||||
@ -61,34 +61,7 @@ void office_binary_data::add_child_element( xml::sax * Reader, const std::wstrin
|
||||
|
||||
void office_binary_data::add_text(const std::wstring & Text)
|
||||
{
|
||||
base64Binary_ = std::string(Text.begin(), Text.end());
|
||||
}
|
||||
|
||||
std::wstring office_binary_data::write_to(const std::wstring & path)
|
||||
{
|
||||
std::wstring result;
|
||||
|
||||
NSFile::CBase64Converter base64;
|
||||
int nLength = 0;
|
||||
unsigned char *pData = NULL;
|
||||
|
||||
NSFile::CBase64Converter::Decode(base64Binary_.c_str(), base64Binary_.length(), pData, nLength);
|
||||
if (pData)
|
||||
{
|
||||
NSFile::CFileBinary file;
|
||||
|
||||
std::wstring bin_file = file.CreateTempFileWithUniqueName(path + FILE_SEPARATOR_STR, L"bin");
|
||||
if (file.CreateFileW(bin_file))
|
||||
{
|
||||
file.WriteFile(pData, nLength);
|
||||
file.CloseFile();
|
||||
|
||||
int pos = bin_file.rfind(FILE_SEPARATOR_STR);
|
||||
result = bin_file.substr(pos + 1);
|
||||
}
|
||||
delete []pData; pData = NULL;
|
||||
}
|
||||
return result;
|
||||
base64Binary_ = Text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -53,15 +53,17 @@ public:
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
public:
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
std::wstring write_to(const std::wstring & path);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
private:
|
||||
std::wstring base64Binary_;
|
||||
|
||||
std::string base64Binary_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(office_binary_data);
|
||||
|
||||
@ -63,10 +63,9 @@ void chart_chart_attlist::add_attributes( const xml::attributes_wc_ptr & Attribu
|
||||
common_draw_size_attlist_.add_attributes(Attributes);
|
||||
common_attlist_.add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"chart:class", chart_class_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"chart:column-mapping", chart_column_mapping_);
|
||||
CP_APPLY_ATTR(L"chart:row-mapping", chart_row_mapping_);
|
||||
CP_APPLY_ATTR(L"loext:data-pilot-source", loext_data_pilot_source_);
|
||||
CP_APPLY_ATTR(L"chart:class", chart_class_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"chart:column-mapping", chart_column_mapping_);
|
||||
CP_APPLY_ATTR(L"chart:row-mapping", chart_row_mapping_);
|
||||
}
|
||||
|
||||
// chart:chart
|
||||
@ -76,7 +75,7 @@ const wchar_t * chart_chart::name = L"chart";
|
||||
|
||||
void chart_chart::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_chart_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_chart::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -98,7 +97,7 @@ const wchar_t * chart_title::name = L"title";
|
||||
|
||||
void chart_title::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_title_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_title::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -118,7 +117,7 @@ const wchar_t * chart_subtitle::name = L"subtitle";
|
||||
|
||||
void chart_subtitle::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_title_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_subtitle::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -158,7 +157,7 @@ const wchar_t * chart_legend::name = L"legend";
|
||||
|
||||
void chart_legend::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_legend_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_legend::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -195,7 +194,7 @@ const wchar_t * chart_plot_area::name = L"plot-area";
|
||||
|
||||
void chart_plot_area::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_plot_area_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_plot_area::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -218,7 +217,7 @@ const wchar_t * chart_wall::name = L"wall";
|
||||
|
||||
void chart_wall::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_wall_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_wall::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -257,7 +256,7 @@ const wchar_t * chart_axis::name = L"axis";
|
||||
|
||||
void chart_axis::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_axis_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_axis::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -280,7 +279,7 @@ const wchar_t * chart_grid::name = L"grid";
|
||||
|
||||
void chart_grid::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_grid_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_grid::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -307,12 +306,11 @@ void chart_categories::add_child_element( xml::sax * Reader, const std::wstring
|
||||
|
||||
void chart_series_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"chart:values-cell-range-address", chart_values_cell_range_address_);
|
||||
CP_APPLY_ATTR(L"chart:label-cell-address", chart_label_cell_address_);
|
||||
CP_APPLY_ATTR(L"chart:class", chart_class_);
|
||||
CP_APPLY_ATTR(L"chart:attached-axis", chart_attached_axis_);
|
||||
|
||||
common_attlist_.add_attributes(Attributes);
|
||||
CP_APPLY_ATTR(L"chart:values-cell-range-address", chart_values_cell_range_address_);
|
||||
CP_APPLY_ATTR(L"chart:label-cell-", chart_label_cell_address_);
|
||||
CP_APPLY_ATTR(L"chart:class", chart_class_);
|
||||
CP_APPLY_ATTR(L"chart:attached-axis", chart_attached_axis_);
|
||||
common_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
// chart:categories
|
||||
@ -322,7 +320,7 @@ const wchar_t * chart_series::name = L"series";
|
||||
|
||||
void chart_series::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_series_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_series::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -360,7 +358,7 @@ const wchar_t * chart_data_point::name = L"data-point";
|
||||
|
||||
void chart_data_point::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
chart_data_point_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chart_data_point::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
|
||||
@ -82,12 +82,12 @@ class chart_chart_attlist
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
odf_types::common_draw_size_attlist common_draw_size_attlist_;
|
||||
common_chart_attlist common_attlist_;
|
||||
std::wstring chart_class_;
|
||||
_CP_OPT(std::wstring) chart_column_mapping_;
|
||||
_CP_OPT(std::wstring) chart_row_mapping_;
|
||||
_CP_OPT(std::wstring) loext_data_pilot_source_;
|
||||
};
|
||||
|
||||
// chart:chart
|
||||
@ -105,8 +105,8 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_chart_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
chart_chart_attlist chart_chart_attlist_;
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(chart_chart);
|
||||
@ -139,7 +139,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_title_attlist attlist_;
|
||||
chart_title_attlist chart_title_attlist_;
|
||||
office_element_ptr text_p_;
|
||||
};
|
||||
|
||||
@ -160,8 +160,8 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_title_attlist attlist_;
|
||||
office_element_ptr text_p_;
|
||||
chart_title_attlist chart_title_attlist_;
|
||||
office_element_ptr text_p_;
|
||||
|
||||
};
|
||||
|
||||
@ -183,7 +183,7 @@ private:
|
||||
|
||||
public:
|
||||
common_chart_attlist common_attlist_;
|
||||
office_element_ptr text_p_;
|
||||
office_element_ptr text_p_;
|
||||
|
||||
};
|
||||
|
||||
@ -195,11 +195,11 @@ public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) chart_legend_position_;
|
||||
_CP_OPT(std::wstring) chart_legend_align_;
|
||||
_CP_OPT(std::wstring) chart_legend_position_;
|
||||
_CP_OPT(std::wstring) chart_legend_align_;
|
||||
odf_types::common_draw_position_attlist common_draw_position_attlist_;
|
||||
_CP_OPT(std::wstring) style_legend_expansion_;
|
||||
_CP_OPT(double) style_legend_expansion_aspect_ratio_;
|
||||
_CP_OPT(std::wstring) style_legend_expansion_;
|
||||
_CP_OPT(double) style_legend_expansion_aspect_ratio_;
|
||||
common_chart_attlist common_attlist_;
|
||||
|
||||
};
|
||||
@ -219,7 +219,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_legend_attlist attlist_;
|
||||
chart_legend_attlist chart_legend_attlist_;
|
||||
|
||||
};
|
||||
|
||||
@ -234,7 +234,7 @@ public:
|
||||
public:
|
||||
odf_types::common_draw_position_attlist common_draw_position_attlist_;
|
||||
odf_types::common_draw_size_attlist common_draw_size_attlist_;
|
||||
common_chart_attlist common_attlist_;
|
||||
common_chart_attlist common_attlist_;
|
||||
|
||||
_CP_OPT(std::wstring) table_cell_range_address_;
|
||||
_CP_OPT(std::wstring) chart_data_source_has_labels_;
|
||||
@ -257,8 +257,9 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_plot_area_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
chart_plot_area_attlist chart_plot_area_attlist_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(chart_plot_area);
|
||||
@ -269,7 +270,7 @@ public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(odf_types::length) svg_width_;
|
||||
_CP_OPT(odf_types::length) svg_width_;
|
||||
common_chart_attlist common_attlist_;
|
||||
|
||||
};
|
||||
@ -288,7 +289,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_wall_attlist attlist_;
|
||||
chart_wall_attlist chart_wall_attlist_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(chart_wall);
|
||||
@ -309,7 +310,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
common_chart_attlist common_attlist_;
|
||||
common_chart_attlist common_attlist_;
|
||||
|
||||
};
|
||||
|
||||
@ -321,8 +322,8 @@ public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) chart_dimension_;
|
||||
_CP_OPT(std::wstring) chart_name_;
|
||||
_CP_OPT(std::wstring) chart_dimension_;
|
||||
_CP_OPT(std::wstring) chart_name_;
|
||||
common_chart_attlist common_attlist_;
|
||||
};
|
||||
|
||||
@ -341,8 +342,9 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_axis_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
chart_axis_attlist chart_axis_attlist_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
@ -374,7 +376,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_grid_attlist attlist_;
|
||||
chart_grid_attlist chart_grid_attlist_;
|
||||
|
||||
};
|
||||
|
||||
@ -430,8 +432,9 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_series_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
chart_series_attlist chart_series_attlist_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
@ -483,7 +486,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
chart_data_point_attlist attlist_;
|
||||
chart_data_point_attlist chart_data_point_attlist_;
|
||||
|
||||
};
|
||||
|
||||
@ -547,8 +550,8 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
common_chart_attlist common_attlist_;
|
||||
_CP_OPT(bool) display_r_square_;
|
||||
common_chart_attlist common_attlist_;
|
||||
_CP_OPT(bool) display_r_square_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
// office_document_base
|
||||
class office_document_base : public office_element
|
||||
{
|
||||
public:
|
||||
@ -66,8 +67,6 @@ public:
|
||||
|
||||
// office-document-attrs
|
||||
// office-document-common-attrs
|
||||
office_element_ptr office_body_; // office-body
|
||||
|
||||
office_element_ptr office_meta_; // office-meta
|
||||
office_element_ptr office_settings_; // office-settings
|
||||
office_element_ptr office_scripts_;
|
||||
@ -76,9 +75,14 @@ public:
|
||||
office_element_ptr office_styles_; // office-styles
|
||||
office_element_ptr office_automatic_styles_; // office-automatic-styles
|
||||
office_element_ptr office_master_styles_; // office-master-styles
|
||||
office_element_ptr_array manifests_; // manifests
|
||||
office_element_ptr_array manifests_; // manifests
|
||||
|
||||
|
||||
public:
|
||||
office_element_ptr office_body_; // office-body
|
||||
|
||||
friend class odf_document;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -190,7 +190,6 @@ enum ElementType
|
||||
|
||||
typeStyleFontFace,
|
||||
|
||||
typeSvgDesc,
|
||||
typeSvgFontFaceUri,
|
||||
typeSvgFontFaceFormat,
|
||||
typeSvgFontFaceName,
|
||||
@ -235,9 +234,7 @@ enum ElementType
|
||||
typeTableDatabaseSourceQuery,
|
||||
typeTableDatabaseSourceSql,
|
||||
typeTableSourceCellRange,
|
||||
typeTableSourceCellRanges,
|
||||
typeTableSourceService,
|
||||
typeTableDataPilotGrandTotal,
|
||||
typeTableDataPilotSubtotals,
|
||||
typeTableDataPilotSubtotal,
|
||||
typeTableDataPilotGroupMember,
|
||||
|
||||
@ -88,13 +88,13 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (database_ranges_)
|
||||
database_ranges_->xlsx_convert(Context);
|
||||
|
||||
if (data_pilot_tables_)
|
||||
data_pilot_tables_->xlsx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
if (data_pilot_tables_)
|
||||
data_pilot_tables_->xlsx_convert(Context);
|
||||
|
||||
Context.end_office_spreadsheet();
|
||||
}
|
||||
|
||||
@ -318,30 +318,8 @@ void text_format_properties_content::drawing_serialize(std::wostream & strm, std
|
||||
CP_XML_NODE(node)//a:rPr & a:defRPr
|
||||
{
|
||||
//attr
|
||||
if (fo_language_ || style_language_asian_ || style_language_complex_)
|
||||
{
|
||||
std::wstring w_val;
|
||||
if (fo_language_)
|
||||
{
|
||||
w_val = *fo_language_;
|
||||
if (fo_country_) w_val += L"-" + *fo_country_;
|
||||
}
|
||||
else if (style_language_asian_)
|
||||
{
|
||||
w_val = *style_language_asian_;
|
||||
if (style_country_asian_) w_val += L"-" + *style_country_asian_;
|
||||
}
|
||||
else if (style_language_complex_)
|
||||
{
|
||||
w_val = *style_language_complex_;
|
||||
if (style_country_complex_)w_val += L"-" + *style_country_complex_;
|
||||
}
|
||||
|
||||
if (w_val.empty() == false)
|
||||
{
|
||||
CP_XML_ATTR(L"lang", w_val);
|
||||
}
|
||||
}
|
||||
const int W = process_font_weight(fo_font_weight_);
|
||||
if (W > 0) CP_XML_ATTR(L"b", true);
|
||||
|
||||
const int fontStyle = process_font_style(fo_font_style_);
|
||||
if (fontStyle > 0) CP_XML_ATTR(L"i", true);
|
||||
@ -376,9 +354,6 @@ void text_format_properties_content::drawing_serialize(std::wostream & strm, std
|
||||
CP_XML_ATTR(L"cap", "small");
|
||||
}
|
||||
}
|
||||
const int W = process_font_weight(fo_font_weight_);
|
||||
if (W > 0) CP_XML_ATTR(L"b", true);
|
||||
|
||||
// underline
|
||||
line_width under = style_text_underline_width_.get_value_or(line_width::Auto);
|
||||
bool underlineBold = under.get_type() == line_width::Bold ||
|
||||
@ -458,6 +433,18 @@ void text_format_properties_content::drawing_serialize(std::wostream & strm, std
|
||||
CP_XML_ATTR(L"spc",(int)(20.0 * fo_letter_spacing_->get_length().get_value_unit(length::pt)));
|
||||
}
|
||||
|
||||
if (fo_language_ || style_language_asian_ || style_language_complex_)
|
||||
{
|
||||
std::wstring w_val;
|
||||
if (fo_language_) w_val = *fo_language_;
|
||||
else if (fo_country_) w_val = *fo_country_;
|
||||
else if (style_country_asian_) w_val = *style_country_asian_;
|
||||
else if (style_language_asian_) w_val = *style_language_asian_;
|
||||
else if (style_language_complex_) w_val = *style_language_complex_;
|
||||
else if (style_country_complex_) w_val = *style_country_complex_;
|
||||
|
||||
CP_XML_ATTR(L"lang", w_val);
|
||||
}
|
||||
if (style_text_position_)
|
||||
{
|
||||
if (style_text_position_->get_type() == text_position::Percent)
|
||||
|
||||
@ -54,6 +54,7 @@ void table_data_pilot_tables::add_child_element( xml::sax * Reader, const std::w
|
||||
}
|
||||
void table_data_pilot_tables::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
return;
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
@ -68,11 +69,11 @@ void table_data_pilot_table::add_attributes( const xml::attributes_wc_ptr & Attr
|
||||
CP_APPLY_ATTR(L"table:name" , table_name_);
|
||||
CP_APPLY_ATTR(L"table:application-data" , table_application_data_);
|
||||
CP_APPLY_ATTR(L"table:buttons" , table_buttons_);
|
||||
CP_APPLY_ATTR(L"table:drill-down-on-double-click", table_drill_down_ondouble_click_);
|
||||
CP_APPLY_ATTR(L"table:drill-down-ondouble-click", table_drill_down_ondouble_click_);
|
||||
CP_APPLY_ATTR(L"table:grand-total" , table_grand_total_);
|
||||
CP_APPLY_ATTR(L"table:identify-categories" , table_identify_categories_);
|
||||
CP_APPLY_ATTR(L"table:ignore-empty-rows" , table_ignore_empty_rows_);
|
||||
CP_APPLY_ATTR(L"table:show-filter-button" , table_show_filter_button_, true);
|
||||
CP_APPLY_ATTR(L"table:show-filter-button" , table_show_filter_button_);
|
||||
CP_APPLY_ATTR(L"table:target-range-address" , table_target_range_address_);
|
||||
|
||||
}
|
||||
@ -81,8 +82,6 @@ void table_data_pilot_table::add_child_element( xml::sax * Reader, const std::ws
|
||||
{
|
||||
if (L"table" == Ns && L"data-pilot-field" == Name)
|
||||
CP_CREATE_ELEMENT (fields_);
|
||||
else if (L"tableooo" == Ns && L"data-pilot-grand-total" == Name)
|
||||
CP_CREATE_ELEMENT (grand_total_);
|
||||
else
|
||||
CP_CREATE_ELEMENT (source_);
|
||||
|
||||
@ -91,56 +90,39 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
{
|
||||
if (!source_) return;
|
||||
|
||||
formulasconvert::odf2oox_converter formulas_converter;
|
||||
int table_index = -1;
|
||||
|
||||
Context.get_pivots_context().start_table();
|
||||
|
||||
source_->xlsx_convert(Context);
|
||||
|
||||
std::wstring sheet_name;
|
||||
|
||||
if (table_name_) Context.get_pivots_context().set_view_name(*table_name_);
|
||||
if (table_name_) Context.get_pivots_context().set_view_name(*table_name_);
|
||||
if (table_target_range_address_)
|
||||
{
|
||||
formulasconvert::odf2oox_converter formulas_converter;
|
||||
|
||||
std::wstring ref = formulas_converter.convert_named_ref(*table_target_range_address_, false);
|
||||
sheet_name = formulas_converter.get_table_name();
|
||||
std::wstring table_name = formulas_converter.get_table_name();
|
||||
|
||||
table_index = Context.find_sheet_by_name(table_name);
|
||||
|
||||
Context.get_pivots_context().set_view_target_range(ref);
|
||||
Context.get_pivots_context().set_view_target_table_name(sheet_name);
|
||||
//Context.get_pivots_context().set_view_target_table(table_index);
|
||||
}
|
||||
|
||||
if (table_buttons_)
|
||||
{
|
||||
std::vector<std::wstring> headers;
|
||||
formulas_converter.split_distance_by(*table_buttons_, L" ", headers);
|
||||
|
||||
for (size_t i = table_show_filter_button_ ? 1 : 0; i < headers.size(); i++)
|
||||
{
|
||||
std::wstring ref = formulas_converter.convert_named_ref(headers[i], false);
|
||||
Context.get_pivots_context().add_button_header(ref);
|
||||
}
|
||||
}
|
||||
if (table_identify_categories_)
|
||||
Context.get_pivots_context().set_identify_categories(table_identify_categories_->get());
|
||||
|
||||
if (table_drill_down_ondouble_click_)
|
||||
Context.get_pivots_context().set_drill(table_drill_down_ondouble_click_->get());
|
||||
|
||||
for (size_t i = 0; i < fields_.size(); i++)
|
||||
{
|
||||
fields_[i]->xlsx_convert(Context);
|
||||
}
|
||||
|
||||
int index_table_view = Context.get_pivots_context().end_table();
|
||||
int index_view = Context.get_pivots_context().end_table();
|
||||
|
||||
if (index_table_view < 0)
|
||||
return;
|
||||
|
||||
if (0 == sheet_name.find(L"'"))
|
||||
if (index_view > 0)
|
||||
{
|
||||
sheet_name = sheet_name.substr(1, sheet_name.length() - 2);
|
||||
}
|
||||
Context.add_pivot_sheet_source(sheet_name, index_table_view);
|
||||
Context.current_sheet(table_index).sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(index_view),
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
|
||||
L"../pivotTables/pivotTable" + std::to_wstring(index_view) + L".xml"));
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_field::ns = L"table";
|
||||
@ -168,26 +150,18 @@ void table_data_pilot_field::add_child_element( xml::sax * Reader, const std::ws
|
||||
}
|
||||
void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
int field_type = table_orientation_.get_value_or(table_orientation::data).get_type(); //?? default type ????
|
||||
int field_hierarchy = table_used_hierarchy_.get_value_or(-1);
|
||||
|
||||
Context.get_pivots_context().start_field();
|
||||
|
||||
Context.get_pivots_context().set_field_name(table_source_field_name_.get_value_or(L""));
|
||||
|
||||
if (table_is_data_layout_field_)
|
||||
Context.get_pivots_context().set_field_data_layout(table_is_data_layout_field_->get());
|
||||
|
||||
Context.get_pivots_context().set_field_type(table_orientation_.get_value_or(table_orientation::hidden).get_type());
|
||||
|
||||
if (table_function_)
|
||||
{
|
||||
table_function::type type = table_function_->get_type();
|
||||
|
||||
if (type == table_function::String)
|
||||
{
|
||||
formulasconvert::odf2oox_converter formulas_converter;
|
||||
|
||||
std::wstring user_funtion = formulas_converter.convert(table_function_->get_string());
|
||||
Context.get_pivots_context().set_field_user_function(user_funtion);
|
||||
Context.get_pivots_context().set_field_user_function(table_function_->get_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -199,8 +173,6 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
if (groups_) groups_->xlsx_convert(Context);
|
||||
if (level_) level_->xlsx_convert(Context);
|
||||
|
||||
Context.get_pivots_context().set_field_type(field_type, field_hierarchy);
|
||||
|
||||
Context.get_pivots_context().end_field();
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
@ -225,16 +197,13 @@ const wchar_t * table_database_source_table::name = L"database-source-table";
|
||||
|
||||
void table_database_source_table::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:database-name", table_database_name_);
|
||||
CP_APPLY_ATTR(L"table:table-name" , table_table_name_);
|
||||
CP_APPLY_ATTR(L"table:database-name" , table_database_name_);
|
||||
CP_APPLY_ATTR(L"table:database-table-name" , table_database_table_name_);
|
||||
}
|
||||
|
||||
void table_database_source_table::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (table_database_name_)
|
||||
{
|
||||
Context.get_pivots_context().set_source_database(*table_database_name_, table_table_name_.get_value_or(L""));
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_database_source_query::ns = L"table";
|
||||
@ -249,10 +218,7 @@ void table_database_source_query::add_attributes( const xml::attributes_wc_ptr &
|
||||
|
||||
void table_database_source_query::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (table_database_name_)
|
||||
{
|
||||
Context.get_pivots_context().set_source_database_query(*table_database_name_, table_query_name_.get_value_or(L""));
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_database_source_sql::ns = L"table";
|
||||
@ -267,12 +233,7 @@ void table_database_source_sql::add_attributes( const xml::attributes_wc_ptr & A
|
||||
|
||||
void table_database_source_sql::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
//todoooo split data-base-ranges & pivots
|
||||
|
||||
if (table_database_name_)
|
||||
{//table_parse_sql_statement_??
|
||||
Context.get_pivots_context().set_source_database_sql(*table_database_name_, table_sql_statement_.get_value_or(L""));
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_source_cell_range::ns = L"table";
|
||||
@ -300,26 +261,6 @@ void table_source_cell_range::xlsx_convert(oox::xlsx_conversion_context & Contex
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_source_cell_ranges::ns = L"table";
|
||||
const wchar_t * table_source_cell_ranges::name = L"source-cell-ranges";
|
||||
|
||||
void table_source_cell_ranges::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:cell-ranges-address", table_cell_ranges_address_);
|
||||
}
|
||||
void table_source_cell_ranges::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (table_cell_ranges_address_)//??? split by ref
|
||||
{
|
||||
//formulasconvert::odf2oox_converter formulas_converter;
|
||||
//
|
||||
//std::wstring ref = formulas_converter.convert_named_ref(*table_cell_range_address_, false);
|
||||
//std::wstring table_name = formulas_converter.get_table_name();
|
||||
|
||||
//Context.get_pivots_context().set_source_range(table_name, ref);
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_source_service::ns = L"table";
|
||||
const wchar_t * table_source_service::name = L"source-service";
|
||||
|
||||
@ -341,8 +282,7 @@ const wchar_t * table_data_pilot_level::name = L"data-pilot-level";
|
||||
|
||||
void table_data_pilot_level::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:show-empty", table_show_empty_);
|
||||
CP_APPLY_ATTR(L"calcext:repeat-item-labels", calcext_repeat_item_labels_);
|
||||
CP_APPLY_ATTR(L"table:show-empty-address", table_show_empty_);
|
||||
}
|
||||
void table_data_pilot_level::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
@ -359,28 +299,22 @@ void table_data_pilot_level::add_child_element( xml::sax * Reader, const std::ws
|
||||
}
|
||||
void table_data_pilot_level::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (table_show_empty_)
|
||||
Context.get_pivots_context().set_field_show_empty(table_show_empty_->get());
|
||||
table_data_pilot_members* members = dynamic_cast<table_data_pilot_members*>(members_.get());
|
||||
table_data_pilot_subtotals* subtotals = dynamic_cast<table_data_pilot_subtotals*>(subtotals_.get());
|
||||
|
||||
if (calcext_repeat_item_labels_)
|
||||
Context.get_pivots_context().set_repeat_item_labels(calcext_repeat_item_labels_->get());
|
||||
|
||||
if (members_)
|
||||
members_->xlsx_convert(Context);
|
||||
|
||||
if (subtotals_)
|
||||
subtotals_->xlsx_convert(Context);
|
||||
|
||||
|
||||
table_data_pilot_sort_info *sort = dynamic_cast<table_data_pilot_sort_info*>(sort_info_.get());
|
||||
if (sort)
|
||||
for (size_t i = 0; members && i < members->content_.size(); i++)
|
||||
{
|
||||
Context.get_pivots_context().set_field_sort(sort->table_order_.get_value_or(table_order::ascending).get_type());
|
||||
table_data_pilot_member* member = dynamic_cast<table_data_pilot_member*>(members->content_[i].get());
|
||||
if (member)
|
||||
Context.get_pivots_context().add_field_cache(i, member->table_name_.get_value_or(L""));
|
||||
}
|
||||
|
||||
table_data_pilot_layout_info *layout = dynamic_cast<table_data_pilot_layout_info*>(layout_info_.get());
|
||||
if (layout)
|
||||
for (size_t i = 0; subtotals && i < subtotals->content_.size(); i++)
|
||||
{
|
||||
table_data_pilot_subtotal* subtotal = dynamic_cast<table_data_pilot_subtotal*>(subtotals->content_[i].get());
|
||||
if (subtotal)
|
||||
{
|
||||
Context.get_pivots_context().add_field_subtotal(subtotal->table_function_.get_value_or(table_function::Auto).get_type());
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
@ -403,10 +337,7 @@ void table_data_pilot_groups::add_child_element( xml::sax * Reader, const std::w
|
||||
}
|
||||
void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (table_grouped_by_)
|
||||
Context.get_pivots_context().set_field_groups(table_grouped_by_->get_type());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
@ -458,7 +389,7 @@ void table_data_pilot_member::add_attributes( const xml::attributes_wc_ptr & Att
|
||||
|
||||
void table_data_pilot_member::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_pivots_context().add_field_cache(-1, table_name_.get_value_or(L""));
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_group_member::ns = L"table";
|
||||
@ -499,21 +430,7 @@ void table_data_pilot_subtotal::add_attributes( const xml::attributes_wc_ptr & A
|
||||
|
||||
void table_data_pilot_subtotal::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_pivots_context().add_field_subtotal(table_function_.get_value_or(table_function::Auto).get_type());
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_grand_total::ns = L"tableooo";
|
||||
const wchar_t * table_data_pilot_grand_total::name = L"data-pilot-grand-total";
|
||||
|
||||
void table_data_pilot_grand_total::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:display" , table_display_);
|
||||
CP_APPLY_ATTR(L"table:orientation" , table_orientation_);
|
||||
//CP_APPLY_ATTR(L"table:display-name" , table_display_name_);
|
||||
CP_APPLY_ATTR(L"tableooo:display-name" , table_display_name_);
|
||||
}
|
||||
void table_data_pilot_grand_total::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_layout_info::ns = L"table";
|
||||
@ -523,6 +440,10 @@ void table_data_pilot_layout_info::add_attributes( const xml::attributes_wc_ptr
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:add-empty-lines" , table_add_empty_lines_);
|
||||
CP_APPLY_ATTR(L"table:layout-mode" , table_layout_mode_);
|
||||
}
|
||||
void table_data_pilot_layout_info::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_sort_info::ns = L"table";
|
||||
@ -533,6 +454,10 @@ void table_data_pilot_sort_info::add_attributes( const xml::attributes_wc_ptr &
|
||||
CP_APPLY_ATTR(L"table:data-field" , table_data_field_);
|
||||
CP_APPLY_ATTR(L"table:order" , table_order_);
|
||||
CP_APPLY_ATTR(L"table:sort-mode" , table_sort_mode_);
|
||||
}
|
||||
void table_data_pilot_sort_info::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * table_data_pilot_display_info::ns = L"table";
|
||||
@ -544,6 +469,10 @@ void table_data_pilot_display_info::add_attributes( const xml::attributes_wc_ptr
|
||||
CP_APPLY_ATTR(L"table:display-member-mode" , table_display_member_mode_);
|
||||
CP_APPLY_ATTR(L"table:enabled" , table_enabled_);
|
||||
CP_APPLY_ATTR(L"table:member-count" , table_member_count_);
|
||||
}
|
||||
void table_data_pilot_display_info::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,6 @@
|
||||
#include "datatypes/tabletype.h"
|
||||
#include "datatypes/tablefunction.h"
|
||||
#include "datatypes/tableorder.h"
|
||||
#include "datatypes/dategroup.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
@ -97,11 +96,10 @@ public:
|
||||
_CP_OPT(odf_types::grand_total)table_grand_total_;
|
||||
_CP_OPT(odf_types::Bool) table_identify_categories_;
|
||||
_CP_OPT(odf_types::Bool) table_ignore_empty_rows_;
|
||||
bool table_show_filter_button_;
|
||||
_CP_OPT(odf_types::Bool) table_show_filter_button_;
|
||||
|
||||
office_element_ptr source_;
|
||||
office_element_ptr_array fields_;
|
||||
office_element_ptr grand_total_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_table);
|
||||
@ -138,30 +136,6 @@ public:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_field);
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
class table_data_pilot_grand_total : public office_element_impl<table_data_pilot_grand_total>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableDataPilotGrandTotal;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) table_display_name_;
|
||||
_CP_OPT(odf_types::Bool) table_display_;
|
||||
_CP_OPT(odf_types::table_orientation) table_orientation_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_grand_total );
|
||||
//-------------------------------------------------------------------------------------
|
||||
class table_data_pilot_field_reference : public office_element_impl<table_data_pilot_field_reference>
|
||||
{
|
||||
public:
|
||||
@ -204,7 +178,7 @@ private:
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) table_database_name_;
|
||||
_CP_OPT(std::wstring) table_table_name_;
|
||||
_CP_OPT(std::wstring) table_database_table_name_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_database_source_table);
|
||||
@ -279,27 +253,6 @@ public:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_source_cell_range);
|
||||
//-------------------------------------------------------------------------------------
|
||||
class table_source_cell_ranges : public office_element_impl<table_source_cell_ranges>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableSourceCellRanges;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) table_cell_ranges_address_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_source_cell_ranges);
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
class table_source_service : public office_element_impl<table_source_service>
|
||||
{
|
||||
@ -344,7 +297,6 @@ private:
|
||||
|
||||
public:
|
||||
_CP_OPT(odf_types::Bool) table_show_empty_;
|
||||
_CP_OPT(odf_types::Bool) calcext_repeat_item_labels_;
|
||||
|
||||
office_element_ptr members_;
|
||||
office_element_ptr subtotals_;
|
||||
@ -371,13 +323,13 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) table_date_end_;
|
||||
_CP_OPT(std::wstring) table_date_start_;
|
||||
_CP_OPT(std::wstring) table_start; //double 18.2 or auto.
|
||||
_CP_OPT(std::wstring) table_end_; //double 18.2 or auto.
|
||||
_CP_OPT(odf_types::date_group) table_grouped_by_;
|
||||
_CP_OPT(std::wstring) table_source_field_name_;
|
||||
_CP_OPT(double) table_step;
|
||||
_CP_OPT(std::wstring) table_date_end_;
|
||||
_CP_OPT(std::wstring) table_date_start_;
|
||||
_CP_OPT(std::wstring) table_start; //double 18.2 or auto.
|
||||
_CP_OPT(std::wstring) table_end_; //double 18.2 or auto.
|
||||
_CP_OPT(std::wstring) table_grouped_by_; //seconds, minutes, hours, days, months, quarters or years.
|
||||
_CP_OPT(std::wstring) table_source_field_name_;
|
||||
_CP_OPT(double) table_step;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
@ -526,7 +478,7 @@ public:
|
||||
static const ElementType type = typeTableDataLayoutInfo;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
@ -548,7 +500,7 @@ public:
|
||||
static const ElementType type = typeTableDataSortInfo;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
@ -571,7 +523,7 @@ public:
|
||||
static const ElementType type = typeTableDataDisplayInfo;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
@ -449,14 +449,6 @@
|
||||
RelativePath="..\src\odf\datatypes\common_attlists.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\datatypes\dategroup.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\datatypes\dategroup.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\datatypes\direction.cpp"
|
||||
>
|
||||
|
||||
@ -60,7 +60,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
pptFile.put_TempDirectory(tempPath);
|
||||
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath, L"password");
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath, L"");
|
||||
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
|
||||
@ -1922,7 +1922,7 @@
|
||||
17063B5B1AC5708E0056A3F1 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0730;
|
||||
LastUpgradeCheck = 0830;
|
||||
ORGANIZATIONNAME = "Ascensio System SIA";
|
||||
};
|
||||
buildConfigurationList = 17063B5E1AC5708E0056A3F1 /* Build configuration list for PBXProject "PPTXFormatLib" */;
|
||||
@ -2009,8 +2009,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@ -2018,6 +2020,7 @@
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
@ -2051,8 +2054,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@ -2060,6 +2065,7 @@
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
|
||||
@ -73,8 +73,6 @@ int AxcExt::serialize(std::wostream & _stream)
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:auto") { CP_XML_ATTR(L"val", !fAutoCross); }
|
||||
|
||||
if (fAutoMax == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:max")
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Scatter record in BIFF8
|
||||
class Scatter: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Scatter)
|
||||
@ -46,6 +48,7 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeScatter;
|
||||
|
||||
@ -539,7 +539,7 @@ class cropFromLeft : public FixedPoint
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(cropFromLeft)
|
||||
};
|
||||
class cropFromRight : public FixedPoint
|
||||
class cropFromRight : public OfficeArtFOPTE
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(cropFromRight)
|
||||
};
|
||||
|
||||
@ -75,24 +75,6 @@ const bool AI::loadContent(BinProcessor& proc)
|
||||
|
||||
return true;
|
||||
}
|
||||
bool AI::empty()
|
||||
{
|
||||
if (!m_SeriesText && !m_BRAI) return true;
|
||||
|
||||
BRAI* brai = dynamic_cast<BRAI*>(m_BRAI.get());
|
||||
|
||||
if (brai)
|
||||
{
|
||||
std::wstring forumla = brai->formula.getAssembledFormula();
|
||||
return forumla.empty();
|
||||
}
|
||||
SeriesText * text = dynamic_cast<SeriesText *>(m_SeriesText.get());
|
||||
if (text)
|
||||
{
|
||||
return text->stText.value().empty();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int AI::serialize(std::wostream & _stream)
|
||||
{
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of AI union of records
|
||||
class AI: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(AI)
|
||||
@ -48,8 +51,6 @@ public:
|
||||
|
||||
int serialize(std::wostream & _stream);
|
||||
|
||||
bool empty();
|
||||
|
||||
BaseObjectPtr m_SeriesText ;
|
||||
BaseObjectPtr m_BRAI;
|
||||
|
||||
|
||||
@ -216,29 +216,15 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
|
||||
int count_runs = allRuns ? allRuns->rgRuns.size() : 0;
|
||||
|
||||
Text * textProps = dynamic_cast<Text*> (m_TextProperties.get());
|
||||
|
||||
bool rtl = false;
|
||||
if((textProps) && (textProps->iReadingOrder == (unsigned char)2)) rtl = true;
|
||||
|
||||
FRAME *FRAME_ = dynamic_cast<FRAME*> (m_FRAME.get());
|
||||
Pos *Pos_ = dynamic_cast<Pos*> (m_Pos.get());
|
||||
|
||||
if (Pos_)
|
||||
if (FRAME_ && Pos_)
|
||||
{
|
||||
Pos_->m_Frame = FRAME_ ? FRAME_->m_Frame : NULL;
|
||||
}
|
||||
else if (isPosition && textProps)
|
||||
{
|
||||
m_Pos = BaseObjectPtr(new Pos());
|
||||
Pos_ = dynamic_cast<Pos*>(m_Pos.get());
|
||||
|
||||
Pos_->mdTopLt = 2;
|
||||
Pos_->mdBotRt = 2;
|
||||
|
||||
Pos_->x1 = textProps->x;
|
||||
Pos_->y1 = textProps->y;
|
||||
Pos_->x2 = textProps->dx;
|
||||
Pos_->y2 = textProps->dx;
|
||||
Pos_->m_Frame = FRAME_->m_Frame;
|
||||
}
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
|
||||
@ -48,7 +48,6 @@ namespace XLS
|
||||
|
||||
AXES::AXES()
|
||||
{
|
||||
bAxisCategories = false;
|
||||
}
|
||||
|
||||
|
||||
@ -153,8 +152,6 @@ const bool AXES::loadContent(BinProcessor& proc)
|
||||
|
||||
if (iv)
|
||||
{
|
||||
bAxisCategories = true;
|
||||
|
||||
id = iv->id;
|
||||
type = 1;
|
||||
|
||||
@ -237,7 +234,7 @@ int AXES::serialize(std::wostream & _stream, bool secondary)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
for (size_t i = 0 ; i < m_arAxes.size(); i++)
|
||||
@ -249,8 +246,8 @@ int AXES::serialize(std::wostream & _stream, bool secondary)
|
||||
std::wstring node_ax_type = L"c:valAx";
|
||||
if (iv)
|
||||
{
|
||||
if (iv->bDataAxis) node_ax_type = L"c:dateAx";
|
||||
else node_ax_type = L"c:catAx";
|
||||
if (iv->bDataAxis) node_ax_type = L"c:dateAx";
|
||||
else node_ax_type = L"c:catAx";
|
||||
|
||||
iv->m_bSecondary = secondary;
|
||||
}
|
||||
@ -276,7 +273,7 @@ int AXES::serialize(std::wostream & _stream, bool secondary)
|
||||
l_->m_bUsed = true;
|
||||
break;
|
||||
}
|
||||
if (l_->m_iLinkObject == 3 && l_->m_bUsed == false && ((bAxisCategories && iv) || (!bAxisCategories && (dv || ser))))
|
||||
if (l_->m_iLinkObject == 3 && l_->m_bUsed == false && iv)
|
||||
{
|
||||
label = l_;
|
||||
l_->m_bUsed = true;
|
||||
@ -318,21 +315,18 @@ int AXES::serialize(std::wostream & _stream, bool secondary)
|
||||
{
|
||||
if (m_arAxesId[i].second == 3 && m_arAxesId[j].second == 1)continue;
|
||||
|
||||
CP_XML_NODE(L"c:crossAx") {CP_XML_ATTR(L"val", m_arAxesId[j].first);}
|
||||
CP_XML_NODE(L"c:crossAx"){CP_XML_ATTR(L"val", m_arAxesId[j].first);}
|
||||
}
|
||||
}
|
||||
if (dv)
|
||||
CP_XML_NODE(L"c:crossBetween")
|
||||
{
|
||||
CP_XML_NODE(L"c:crossBetween")
|
||||
if ((iv == NULL && iv_CatSerRange) && (iv_CatSerRange->fBetween == false))
|
||||
{
|
||||
if ((iv_CatSerRange) && (iv_CatSerRange->fBetween == false))
|
||||
{
|
||||
CP_XML_ATTR(L"val", L"midCat");
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_ATTR(L"val", L"between");
|
||||
}
|
||||
CP_XML_ATTR(L"val", L"midCat");
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_ATTR(L"val", L"between");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,8 +59,6 @@ public:
|
||||
BaseObjectPtr m_PlotArea_FRAME;
|
||||
BaseObjectPtr m_Wall_FRAME;
|
||||
BaseObjectPtr m_Floor_FRAME;
|
||||
|
||||
bool bAxisCategories;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -136,33 +136,31 @@ int DVAXIS::serialize(std::wostream & _stream)
|
||||
}
|
||||
CP_XML_NODE(L"c:scaling")
|
||||
{
|
||||
if ((value_range) && (value_range->fLog == true))
|
||||
{
|
||||
CP_XML_NODE(L"c:logBase") { CP_XML_ATTR(L"val", 10); }
|
||||
bLogarithScale = true;
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"c:orientation")
|
||||
{
|
||||
if ((value_range) && (value_range->fReversed)) CP_XML_ATTR(L"val", L"maxMin");
|
||||
else CP_XML_ATTR(L"val", L"minMax");
|
||||
}
|
||||
if (value_range)
|
||||
if ((value_range) && (value_range->fAutoMax == false))
|
||||
{
|
||||
if (value_range->fLog == true)
|
||||
CP_XML_NODE(L"c:max")
|
||||
{
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMax));
|
||||
else CP_XML_ATTR(L"val", value_range->numMax);
|
||||
}
|
||||
}
|
||||
if ((value_range) && (value_range->fAutoMin == false))
|
||||
{
|
||||
CP_XML_NODE(L"c:min")
|
||||
{
|
||||
CP_XML_NODE(L"c:logBase") { CP_XML_ATTR(L"val", 10); }
|
||||
bLogarithScale = true;
|
||||
}
|
||||
if (value_range->fAutoMax == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:max")
|
||||
{
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMax));
|
||||
else CP_XML_ATTR(L"val", value_range->numMax);
|
||||
}
|
||||
}
|
||||
if (value_range->fAutoMin == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:min")
|
||||
{
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMin));
|
||||
else CP_XML_ATTR(L"val", value_range->numMin);
|
||||
}
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMin));
|
||||
else CP_XML_ATTR(L"val", value_range->numMin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -189,30 +187,26 @@ int DVAXIS::serialize(std::wostream & _stream)
|
||||
//----------------------------------------------------------------------------------------------
|
||||
m_AXS->serialize(_stream);
|
||||
|
||||
if (value_range)
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
{
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
if ((value_range) && (value_range->fMaxCross == true)) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
}
|
||||
|
||||
if ((value_range) && (value_range->fAutoMajor == false))
|
||||
{
|
||||
CP_XML_NODE(L"c:majorUnit")
|
||||
{
|
||||
if (value_range->fMaxCross == true) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMajor));
|
||||
else CP_XML_ATTR(L"val", value_range->numMajor);
|
||||
}
|
||||
CP_XML_NODE(L"c:auto") { CP_XML_ATTR(L"val", !value_range->fAutoCross); }
|
||||
|
||||
if (value_range->fAutoMajor == false)
|
||||
}
|
||||
if ((value_range) && (value_range->fAutoMinor == false))
|
||||
{
|
||||
CP_XML_NODE(L"c:minorUnit")
|
||||
{
|
||||
CP_XML_NODE(L"c:majorUnit")
|
||||
{
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMajor));
|
||||
else CP_XML_ATTR(L"val", value_range->numMajor);
|
||||
}
|
||||
}
|
||||
if (value_range->fAutoMinor == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:minorUnit")
|
||||
{
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMinor));
|
||||
else CP_XML_ATTR(L"val", value_range->numMinor);
|
||||
}
|
||||
if (bLogarithScale) CP_XML_ATTR(L"val", pow(10, value_range->numMinor));
|
||||
else CP_XML_ATTR(L"val", value_range->numMinor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -153,6 +153,7 @@ int IVAXIS::serialize(std::wostream & _stream)
|
||||
CP_XML_NODE(L"c:orientation"){ CP_XML_ATTR(L"val", L"minMax"); }
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:auto") { CP_XML_ATTR(L"val", 0); }
|
||||
CP_XML_NODE(L"c:delete"){ CP_XML_ATTR(L"val", 0); }
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
@ -180,33 +181,11 @@ int IVAXIS::serialize(std::wostream & _stream)
|
||||
if (m_AxcExt)
|
||||
m_AxcExt->serialize(_stream);
|
||||
|
||||
if (cat_ser_range)
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
{
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
{
|
||||
if (cat_ser_range->fMaxCross == true) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
}
|
||||
}
|
||||
if (m_CatLab)
|
||||
{
|
||||
CatLab *label = dynamic_cast<CatLab*>(m_CatLab.get());
|
||||
|
||||
CP_XML_NODE(L"c:lblAlgn")
|
||||
{
|
||||
switch(label->at)
|
||||
{
|
||||
case 0x0001: CP_XML_ATTR(L"val", L"l"); break;
|
||||
case 0x0003: CP_XML_ATTR(L"val", L"r"); break;
|
||||
case 0x0002:
|
||||
default: CP_XML_ATTR(L"val", L"ctr"); break;
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:lblOffset")
|
||||
{
|
||||
CP_XML_ATTR(L"val", label->wOffset);
|
||||
}
|
||||
}
|
||||
if ((cat_ser_range) && (cat_ser_range->fMaxCross == true)) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
}
|
||||
}
|
||||
|
||||
return axes_type;
|
||||
|
||||
@ -153,6 +153,7 @@ int SERIESAXIS::serialize(std::wostream & _stream)
|
||||
CP_XML_NODE(L"c:orientation"){ CP_XML_ATTR(L"val", L"minMax"); }
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"c:auto") { CP_XML_ATTR(L"val", 0); }
|
||||
CP_XML_NODE(L"c:delete"){ CP_XML_ATTR(L"val", 0); }
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
@ -177,14 +178,11 @@ int SERIESAXIS::serialize(std::wostream & _stream)
|
||||
//-----------------------------------------------------------------------------------
|
||||
m_AXS->serialize(_stream);
|
||||
|
||||
if (cat_ser_range)
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
{
|
||||
CP_XML_NODE(L"c:crosses")
|
||||
{
|
||||
if (cat_ser_range->fMaxCross == true) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
}
|
||||
}
|
||||
if ((cat_ser_range) && (cat_ser_range->fMaxCross == true)) CP_XML_ATTR(L"val", L"max");
|
||||
else CP_XML_ATTR(L"val", L"autoZero");
|
||||
}
|
||||
}
|
||||
|
||||
return axes_type;
|
||||
|
||||
@ -385,8 +385,7 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt)
|
||||
if (series_type == CHART_TYPE_Scatter || series_type == CHART_TYPE_Stock)
|
||||
//points only - todooo сделать дефолтовые точки ala 95 стиль & stork
|
||||
{
|
||||
m_isAutoLine = false;
|
||||
//CP_XML_NODE(L"a:noFill");
|
||||
CP_XML_NODE(L"a:noFill");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -446,20 +445,20 @@ int SS::serialize2(std::wostream & _stream, int series_type)
|
||||
}
|
||||
}
|
||||
|
||||
//if (m_isAutoLine == false && ( series_type == CHART_TYPE_Line ||
|
||||
// series_type == CHART_TYPE_Radar/* ||
|
||||
// series_type == CHART_TYPE_Scatter*/))
|
||||
//{
|
||||
// if (series_format)
|
||||
// {
|
||||
// CP_XML_NODE(L"c:smooth")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", series_format->fSmoothedLine);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// CP_XML_NODE(L"c:smooth") { CP_XML_ATTR(L"val", 0); }
|
||||
//}
|
||||
if (m_isAutoLine == false && ( series_type == CHART_TYPE_Line ||
|
||||
series_type == CHART_TYPE_Radar ||
|
||||
series_type == CHART_TYPE_Scatter))
|
||||
{
|
||||
if (series_format)
|
||||
{
|
||||
CP_XML_NODE(L"c:smooth")
|
||||
{
|
||||
CP_XML_ATTR(L"val", series_format->fSmoothedLine);
|
||||
}
|
||||
}
|
||||
else
|
||||
CP_XML_NODE(L"c:smooth") { CP_XML_ATTR(L"val", 0); }
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -629,10 +629,10 @@ int ChartSheetSubstream::serialize_title (std::wostream & _stream)
|
||||
if (title_label == NULL) return 0;
|
||||
|
||||
AI* title_text = dynamic_cast<AI *>(title_label->m_AI.get());
|
||||
if (title_text == NULL) return 0;
|
||||
|
||||
if (!title_text->m_SeriesText && !title_text->m_BRAI) return 0; // если не выкидывать будет рисоваться placeholder
|
||||
|
||||
if (title_text == NULL) return 0;
|
||||
if (title_text->empty()) return 0;
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"c:title")
|
||||
@ -753,8 +753,6 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
PlotAreaPos->serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
int series_order = 0;
|
||||
|
||||
for (std::unordered_map<int, std::vector<int>>::iterator it = m_mapTypeChart.begin(); it != m_mapTypeChart.end(); it++)
|
||||
{
|
||||
CRT * crt = dynamic_cast<CRT*>(parent0->m_arCRT[it->first].get());
|
||||
@ -801,7 +799,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
|
||||
CP_XML_NODE(L"c:ser")
|
||||
{
|
||||
CP_XML_NODE(L"c:idx") { CP_XML_ATTR (L"val" , series_id); }
|
||||
CP_XML_NODE(L"c:order") { CP_XML_ATTR (L"val" , series_order++); }
|
||||
CP_XML_NODE(L"c:order") { CP_XML_ATTR (L"val" , series_id); }
|
||||
|
||||
series->m_arAI[0]->serialize(CP_XML_STREAM());
|
||||
|
||||
|
||||
@ -1475,22 +1475,22 @@ void XlsConverter::convert_blip(std::vector<ODRAW::OfficeArtFOPTEPtr> & props)
|
||||
case 0x100:
|
||||
{
|
||||
if (fixed_point)
|
||||
xlsx_context->get_drawing_context().set_crop_top(fixed_point->dVal * 10);
|
||||
xlsx_context->get_drawing_context().set_crop_top(fixed_point->dVal);
|
||||
}break;
|
||||
case 0x101:
|
||||
{
|
||||
if (fixed_point)
|
||||
xlsx_context->get_drawing_context().set_crop_bottom(fixed_point->dVal * 10);
|
||||
xlsx_context->get_drawing_context().set_crop_bottom(fixed_point->dVal);
|
||||
}break;
|
||||
case 0x102:
|
||||
{
|
||||
if (fixed_point)
|
||||
xlsx_context->get_drawing_context().set_crop_left(fixed_point->dVal * 10);
|
||||
xlsx_context->get_drawing_context().set_crop_left(fixed_point->dVal);
|
||||
}break;
|
||||
case 0x103:
|
||||
{
|
||||
if (fixed_point)
|
||||
xlsx_context->get_drawing_context().set_crop_right(fixed_point->dVal * 10);
|
||||
xlsx_context->get_drawing_context().set_crop_right(fixed_point->dVal);
|
||||
}break;
|
||||
case 0x104:
|
||||
{
|
||||
|
||||
@ -514,8 +514,8 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state)
|
||||
if (drawing_state->id < 0)
|
||||
drawing_state->id = count_object + 0x20000;
|
||||
|
||||
if ( drawing_state->type == external_items::typeImage ||
|
||||
( drawing_state->type == external_items::typeShape && drawing_state->shape_id == msosptPictureFrame ))
|
||||
if ( drawing_state->type == external_items::typeImage ||
|
||||
drawing_state->shape_id == msosptPictureFrame )
|
||||
{
|
||||
drawing_state->type = external_items::typeImage;
|
||||
|
||||
@ -1687,10 +1687,10 @@ void xlsx_drawing_context::serialize_bitmap_fill(std::wostream & stream, _drawin
|
||||
{
|
||||
if (fill.texture_crop_enabled)
|
||||
{
|
||||
CP_XML_ATTR(L"l", static_cast<long>(fill.texture_crop[0] * 10000));
|
||||
CP_XML_ATTR(L"t", static_cast<long>(fill.texture_crop[1] * 10000));
|
||||
CP_XML_ATTR(L"r", static_cast<long>(fill.texture_crop[2] * 10000));
|
||||
CP_XML_ATTR(L"b", static_cast<long>(fill.texture_crop[3] * 10000));
|
||||
CP_XML_ATTR(L"l", static_cast<size_t>(fill.texture_crop[0]));
|
||||
CP_XML_ATTR(L"t", static_cast<size_t>(fill.texture_crop[1]));
|
||||
CP_XML_ATTR(L"r", static_cast<size_t>(fill.texture_crop[2]));
|
||||
CP_XML_ATTR(L"b", static_cast<size_t>(fill.texture_crop[3]));
|
||||
}
|
||||
}
|
||||
if (fill.texture_mode == textureStretch)
|
||||
|
||||
@ -239,7 +239,7 @@ public:
|
||||
{
|
||||
color.SetRGB(0xff, 0xff, 0xff);
|
||||
angle = opacity = opacity2 = focus = 0; type = fillSolid;
|
||||
memset(texture_crop, 0, 4 * sizeof(double));
|
||||
memset(texture_crop, 0, 4 * sizeof(int));
|
||||
texture_crop_enabled = false;
|
||||
}
|
||||
_color color;
|
||||
@ -252,7 +252,7 @@ public:
|
||||
double angle;
|
||||
|
||||
std::wstring texture_target;
|
||||
double texture_crop[4];
|
||||
int texture_crop[4];
|
||||
bool texture_crop_enabled;
|
||||
_texture_mode texture_mode;
|
||||
|
||||
|
||||
@ -1,143 +1,146 @@
|
||||
// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c
|
||||
// The original code and all modifications are in the public domain.
|
||||
|
||||
#include "pch.h"
|
||||
#include "3way.h"
|
||||
#include "misc.h"
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
|
||||
void ThreeWay_TestInstantiations()
|
||||
{
|
||||
ThreeWay::Encryption x1;
|
||||
ThreeWay::Decryption x2;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const word32 START_E = 0x0b0b; // round constant of first encryption round
|
||||
static const word32 START_D = 0xb1b1; // round constant of first decryption round
|
||||
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
static const word32 RC_MODULUS = 0x11011;
|
||||
#endif
|
||||
|
||||
static inline word32 reverseBits(word32 a)
|
||||
{
|
||||
a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1);
|
||||
a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2);
|
||||
return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4);
|
||||
}
|
||||
|
||||
#define mu(a0, a1, a2) \
|
||||
{ \
|
||||
a1 = reverseBits(a1); \
|
||||
word32 t = reverseBits(a0); \
|
||||
a0 = reverseBits(a2); \
|
||||
a2 = t; \
|
||||
}
|
||||
|
||||
#define pi_gamma_pi(a0, a1, a2) \
|
||||
{ \
|
||||
word32 b0, b2; \
|
||||
b2 = rotlFixed(a2, 1U); \
|
||||
b0 = rotlFixed(a0, 22U); \
|
||||
a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \
|
||||
a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\
|
||||
a1 ^= (b2|(~b0)); \
|
||||
}
|
||||
|
||||
// thanks to Paulo Barreto for this optimized theta()
|
||||
#define theta(a0, a1, a2) \
|
||||
{ \
|
||||
word32 b0, b1, c; \
|
||||
c = a0 ^ a1 ^ a2; \
|
||||
c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \
|
||||
b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \
|
||||
b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \
|
||||
a0 ^= c ^ b0; \
|
||||
a1 ^= c ^ b1; \
|
||||
a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \
|
||||
}
|
||||
|
||||
#define rho(a0, a1, a2) \
|
||||
{ \
|
||||
theta(a0, a1, a2); \
|
||||
pi_gamma_pi(a0, a1, a2); \
|
||||
}
|
||||
|
||||
void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs ¶ms)
|
||||
{
|
||||
AssertValidKeyLength(length);
|
||||
|
||||
m_rounds = GetRoundsAndThrowIfInvalid(params, this);
|
||||
|
||||
for (unsigned int i=0; i<3; i++)
|
||||
m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24);
|
||||
|
||||
if (!IsForwardTransformation())
|
||||
{
|
||||
theta(m_k[0], m_k[1], m_k[2]);
|
||||
mu(m_k[0], m_k[1], m_k[2]);
|
||||
m_k[0] = ByteReverse(m_k[0]);
|
||||
m_k[1] = ByteReverse(m_k[1]);
|
||||
m_k[2] = ByteReverse(m_k[2]);
|
||||
}
|
||||
}
|
||||
|
||||
void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
|
||||
{
|
||||
typedef BlockGetAndPut<word32, BigEndian> Block;
|
||||
|
||||
word32 a0, a1, a2;
|
||||
Block::Get(inBlock)(a0)(a1)(a2);
|
||||
|
||||
word32 rc = START_E;
|
||||
|
||||
for(unsigned i=0; i<m_rounds; i++)
|
||||
{
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
rho(a0, a1, a2);
|
||||
|
||||
rc <<= 1;
|
||||
if (rc&0x10000) rc ^= 0x11011;
|
||||
}
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
theta(a0, a1, a2);
|
||||
|
||||
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
|
||||
}
|
||||
|
||||
void ThreeWay::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
|
||||
{
|
||||
typedef BlockGetAndPut<word32, LittleEndian> Block;
|
||||
|
||||
word32 a0, a1, a2;
|
||||
Block::Get(inBlock)(a0)(a1)(a2);
|
||||
|
||||
word32 rc = START_D;
|
||||
|
||||
mu(a0, a1, a2);
|
||||
for(unsigned i=0; i<m_rounds; i++)
|
||||
{
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
rho(a0, a1, a2);
|
||||
|
||||
rc <<= 1;
|
||||
if (rc&0x10000) rc ^= 0x11011;
|
||||
}
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
theta(a0, a1, a2);
|
||||
mu(a0, a1, a2);
|
||||
|
||||
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
|
||||
}
|
||||
|
||||
NAMESPACE_END
|
||||
// 3way.cpp - modifed by Wei Dai from Joan Daemen's 3way.c
|
||||
// The original code and all modifications are in the public domain.
|
||||
|
||||
#include "pch.h"
|
||||
#include "3way.h"
|
||||
#include "misc.h"
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
#if CRYPTOPP_DEBUG && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
|
||||
void ThreeWay_TestInstantiations()
|
||||
{
|
||||
ThreeWay::Encryption x1;
|
||||
ThreeWay::Decryption x2;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
const word32 START_E = 0x0b0b; // round constant of first encryption round
|
||||
const word32 START_D = 0xb1b1; // round constant of first decryption round
|
||||
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562
|
||||
const word32 RC_MODULUS = 0x11011;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline word32 reverseBits(word32 a)
|
||||
{
|
||||
a = ((a & 0xAAAAAAAA) >> 1) | ((a & 0x55555555) << 1);
|
||||
a = ((a & 0xCCCCCCCC) >> 2) | ((a & 0x33333333) << 2);
|
||||
return ((a & 0xF0F0F0F0) >> 4) | ((a & 0x0F0F0F0F) << 4);
|
||||
}
|
||||
|
||||
#define mu(a0, a1, a2) \
|
||||
{ \
|
||||
a1 = reverseBits(a1); \
|
||||
word32 t = reverseBits(a0); \
|
||||
a0 = reverseBits(a2); \
|
||||
a2 = t; \
|
||||
}
|
||||
|
||||
#define pi_gamma_pi(a0, a1, a2) \
|
||||
{ \
|
||||
word32 b0, b2; \
|
||||
b2 = rotlFixed(a2, 1U); \
|
||||
b0 = rotlFixed(a0, 22U); \
|
||||
a0 = rotlFixed(b0 ^ (a1|(~b2)), 1U); \
|
||||
a2 = rotlFixed(b2 ^ (b0|(~a1)), 22U);\
|
||||
a1 ^= (b2|(~b0)); \
|
||||
}
|
||||
|
||||
// thanks to Paulo Barreto for this optimized theta()
|
||||
#define theta(a0, a1, a2) \
|
||||
{ \
|
||||
word32 b0, b1, c; \
|
||||
c = a0 ^ a1 ^ a2; \
|
||||
c = rotlFixed(c, 16U) ^ rotlFixed(c, 8U); \
|
||||
b0 = (a0 << 24) ^ (a2 >> 8) ^ (a1 << 8) ^ (a0 >> 24); \
|
||||
b1 = (a1 << 24) ^ (a0 >> 8) ^ (a2 << 8) ^ (a1 >> 24); \
|
||||
a0 ^= c ^ b0; \
|
||||
a1 ^= c ^ b1; \
|
||||
a2 ^= c ^ (b0 >> 16) ^ (b1 << 16); \
|
||||
}
|
||||
|
||||
#define rho(a0, a1, a2) \
|
||||
{ \
|
||||
theta(a0, a1, a2); \
|
||||
pi_gamma_pi(a0, a1, a2); \
|
||||
}
|
||||
|
||||
void ThreeWay::Base::UncheckedSetKey(const byte *uk, unsigned int length, const NameValuePairs ¶ms)
|
||||
{
|
||||
AssertValidKeyLength(length);
|
||||
|
||||
m_rounds = GetRoundsAndThrowIfInvalid(params, this);
|
||||
|
||||
for (unsigned int i=0; i<3; i++)
|
||||
m_k[i] = (word32)uk[4*i+3] | ((word32)uk[4*i+2]<<8) | ((word32)uk[4*i+1]<<16) | ((word32)uk[4*i]<<24);
|
||||
|
||||
if (!IsForwardTransformation())
|
||||
{
|
||||
theta(m_k[0], m_k[1], m_k[2]);
|
||||
mu(m_k[0], m_k[1], m_k[2]);
|
||||
m_k[0] = ByteReverse(m_k[0]);
|
||||
m_k[1] = ByteReverse(m_k[1]);
|
||||
m_k[2] = ByteReverse(m_k[2]);
|
||||
}
|
||||
}
|
||||
|
||||
void ThreeWay::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
|
||||
{
|
||||
typedef BlockGetAndPut<word32, BigEndian> Block;
|
||||
|
||||
word32 a0, a1, a2;
|
||||
Block::Get(inBlock)(a0)(a1)(a2);
|
||||
|
||||
word32 rc = START_E;
|
||||
|
||||
for(unsigned i=0; i<m_rounds; i++)
|
||||
{
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
rho(a0, a1, a2);
|
||||
|
||||
rc <<= 1;
|
||||
if (rc&0x10000) rc ^= 0x11011;
|
||||
}
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
theta(a0, a1, a2);
|
||||
|
||||
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
|
||||
}
|
||||
|
||||
void ThreeWay::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
|
||||
{
|
||||
typedef BlockGetAndPut<word32, LittleEndian> Block;
|
||||
|
||||
word32 a0, a1, a2;
|
||||
Block::Get(inBlock)(a0)(a1)(a2);
|
||||
|
||||
word32 rc = START_D;
|
||||
|
||||
mu(a0, a1, a2);
|
||||
for(unsigned i=0; i<m_rounds; i++)
|
||||
{
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
rho(a0, a1, a2);
|
||||
|
||||
rc <<= 1;
|
||||
if (rc&0x10000) rc ^= 0x11011;
|
||||
}
|
||||
a0 ^= m_k[0] ^ (rc<<16);
|
||||
a1 ^= m_k[1];
|
||||
a2 ^= m_k[2] ^ rc;
|
||||
theta(a0, a1, a2);
|
||||
mu(a0, a1, a2);
|
||||
|
||||
Block::Put(xorBlock, outBlock)(a0)(a1)(a2);
|
||||
}
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
@ -1,69 +1,68 @@
|
||||
// 3way.h - written and placed in the public domain by Wei Dai
|
||||
|
||||
//! \file 3way.h
|
||||
//! \brief Classes for the 3-Way block cipher
|
||||
|
||||
#ifndef CRYPTOPP_THREEWAY_H
|
||||
#define CRYPTOPP_THREEWAY_H
|
||||
|
||||
#include "config.h"
|
||||
#include "seckey.h"
|
||||
#include "secblock.h"
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! \class ThreeWay_Info
|
||||
//! \brief The cipher's key, iv, block size and name information.
|
||||
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
|
||||
{
|
||||
static const char *StaticAlgorithmName() {return "3-Way";}
|
||||
};
|
||||
|
||||
// <a href="http://www.weidai.com/scan-mirror/cs.html#3-Way">3-Way</a>
|
||||
|
||||
//! \class ThreeWay
|
||||
//! \brief Provides 3-Way encryption and decryption
|
||||
class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
//! \brief Class specific implementation and overrides used to operate the cipher.
|
||||
//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
|
||||
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
|
||||
{
|
||||
public:
|
||||
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms);
|
||||
|
||||
protected:
|
||||
unsigned int m_rounds;
|
||||
FixedSizeSecBlock<word32, 3> m_k;
|
||||
};
|
||||
|
||||
//! \class Enc
|
||||
//! \brief Class specific methods used to operate the cipher in the forward direction.
|
||||
//! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION.
|
||||
class CRYPTOPP_NO_VTABLE Enc : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
//! \class Dec
|
||||
//! \brief Class specific methods used to operate the cipher in the reverse direction.
|
||||
//! \details Implementations and overrides in \p Dec apply to \p DECRYPTION.
|
||||
class CRYPTOPP_NO_VTABLE Dec : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
public:
|
||||
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
|
||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||
};
|
||||
|
||||
typedef ThreeWay::Encryption ThreeWayEncryption;
|
||||
typedef ThreeWay::Decryption ThreeWayDecryption;
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
#endif
|
||||
// 3way.h - written and placed in the public domain by Wei Dai
|
||||
|
||||
//! \file 3way.h
|
||||
//! \brief Classes for the 3-Way block cipher
|
||||
|
||||
#ifndef CRYPTOPP_THREEWAY_H
|
||||
#define CRYPTOPP_THREEWAY_H
|
||||
|
||||
#include "config.h"
|
||||
#include "seckey.h"
|
||||
#include "secblock.h"
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
|
||||
//! \class ThreeWay_Info
|
||||
//! \brief ThreeWay block cipher information
|
||||
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
|
||||
{
|
||||
CRYPTOPP_CONSTEXPR static const char *StaticAlgorithmName() {return "3-Way";}
|
||||
};
|
||||
|
||||
//! \class ThreeWay
|
||||
//! \brief ThreeWay block cipher
|
||||
//! \sa <a href="http://www.weidai.com/scan-mirror/cs.html#3-Way">3-Way</a>
|
||||
class ThreeWay : public ThreeWay_Info, public BlockCipherDocumentation
|
||||
{
|
||||
//! \class Base
|
||||
//! \brief Class specific implementation and overrides used to operate the cipher.
|
||||
//! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
|
||||
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<ThreeWay_Info>
|
||||
{
|
||||
public:
|
||||
void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms);
|
||||
|
||||
protected:
|
||||
unsigned int m_rounds;
|
||||
FixedSizeSecBlock<word32, 3> m_k;
|
||||
};
|
||||
|
||||
//! \class Enc
|
||||
//! \brief Class specific methods used to operate the cipher in the forward direction.
|
||||
//! \details Implementations and overrides in \p Enc apply to \p ENCRYPTION.
|
||||
class CRYPTOPP_NO_VTABLE Enc : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
//! \class Dec
|
||||
//! \brief Class specific methods used to operate the cipher in the reverse direction.
|
||||
//! \details Implementations and overrides in \p Dec apply to \p DECRYPTION.
|
||||
class CRYPTOPP_NO_VTABLE Dec : public Base
|
||||
{
|
||||
public:
|
||||
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
|
||||
};
|
||||
|
||||
public:
|
||||
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
|
||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||
};
|
||||
|
||||
typedef ThreeWay::Encryption ThreeWayEncryption;
|
||||
typedef ThreeWay::Decryption ThreeWayDecryption;
|
||||
|
||||
NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,393 +1,420 @@
|
||||
3way.cpp
|
||||
3way.h
|
||||
adhoc.cpp.proto
|
||||
adler32.cpp
|
||||
adler32.h
|
||||
aes.h
|
||||
algebra.cpp
|
||||
algebra.h
|
||||
algparam.cpp
|
||||
algparam.h
|
||||
arc4.cpp
|
||||
arc4.h
|
||||
argnames.h
|
||||
asn.cpp
|
||||
asn.h
|
||||
authenc.cpp
|
||||
authenc.h
|
||||
base32.cpp
|
||||
base32.h
|
||||
base64.cpp
|
||||
base64.h
|
||||
basecode.cpp
|
||||
basecode.h
|
||||
bench.cpp
|
||||
bench.h
|
||||
bench2.cpp
|
||||
bfinit.cpp
|
||||
blowfish.cpp
|
||||
blowfish.h
|
||||
blumshub.cpp
|
||||
blumshub.h
|
||||
camellia.cpp
|
||||
camellia.h
|
||||
cast.cpp
|
||||
cast.h
|
||||
casts.cpp
|
||||
cbcmac.cpp
|
||||
cbcmac.h
|
||||
ccm.cpp
|
||||
ccm.h
|
||||
channels.cpp
|
||||
channels.h
|
||||
cmac.cpp
|
||||
cmac.h
|
||||
config.h
|
||||
config.recommend
|
||||
cpu.cpp
|
||||
cpu.h
|
||||
crc.cpp
|
||||
crc.h
|
||||
cryptdll.dsp
|
||||
cryptdll.vcproj
|
||||
cryptest.dsp
|
||||
cryptest.dsw
|
||||
cryptest.sh
|
||||
cryptest.sln
|
||||
cryptest.vcproj
|
||||
cryptest_bds.bdsgroup
|
||||
cryptest_bds.bdsproj
|
||||
cryptest_bds.bpf
|
||||
cryptlib.cpp
|
||||
cryptlib.dsp
|
||||
cryptlib.h
|
||||
cryptlib.vcproj
|
||||
cryptlib_bds.bdsproj
|
||||
cryptlib_bds.cpp
|
||||
cryptopp.rc
|
||||
cryptopp563.diff
|
||||
datatest.cpp
|
||||
default.cpp
|
||||
default.h
|
||||
des.cpp
|
||||
des.h
|
||||
dessp.cpp
|
||||
dh.cpp
|
||||
dh.h
|
||||
dh2.cpp
|
||||
dh2.h
|
||||
dll.cpp
|
||||
dll.h
|
||||
dlltest.cpp
|
||||
dlltest.dsp
|
||||
dlltest.vcproj
|
||||
dmac.h
|
||||
dsa.cpp
|
||||
dsa.h
|
||||
eax.cpp
|
||||
eax.h
|
||||
ec2n.cpp
|
||||
ec2n.h
|
||||
eccrypto.cpp
|
||||
eccrypto.h
|
||||
ecp.cpp
|
||||
ecp.h
|
||||
elgamal.cpp
|
||||
elgamal.h
|
||||
emsa2.cpp
|
||||
emsa2.h
|
||||
eprecomp.cpp
|
||||
eprecomp.h
|
||||
esign.cpp
|
||||
esign.h
|
||||
factory.h
|
||||
files.cpp
|
||||
files.h
|
||||
filters.cpp
|
||||
filters.h
|
||||
fips140.cpp
|
||||
fips140.h
|
||||
fipsalgt.cpp
|
||||
fipstest.cpp
|
||||
fltrimpl.h
|
||||
gcm.cpp
|
||||
gcm.h
|
||||
gf256.cpp
|
||||
gf256.h
|
||||
gf2_32.cpp
|
||||
gf2_32.h
|
||||
gf2n.cpp
|
||||
gf2n.h
|
||||
gfpcrypt.cpp
|
||||
gfpcrypt.h
|
||||
gost.cpp
|
||||
gost.h
|
||||
gzip.cpp
|
||||
gzip.h
|
||||
hex.cpp
|
||||
hex.h
|
||||
hkdf.h
|
||||
hmac.cpp
|
||||
hmac.h
|
||||
hrtimer.cpp
|
||||
hrtimer.h
|
||||
ida.cpp
|
||||
ida.h
|
||||
idea.cpp
|
||||
idea.h
|
||||
integer.cpp
|
||||
integer.h
|
||||
iterhash.cpp
|
||||
iterhash.h
|
||||
lubyrack.h
|
||||
luc.cpp
|
||||
luc.h
|
||||
mars.cpp
|
||||
mars.h
|
||||
marss.cpp
|
||||
md2.cpp
|
||||
md2.h
|
||||
md4.cpp
|
||||
md4.h
|
||||
md5.cpp
|
||||
md5.h
|
||||
mdc.h
|
||||
mersenne.h
|
||||
misc.cpp
|
||||
misc.h
|
||||
modarith.h
|
||||
modes.cpp
|
||||
modes.h
|
||||
modexppc.h
|
||||
mqueue.cpp
|
||||
mqueue.h
|
||||
mqv.cpp
|
||||
mqv.h
|
||||
nbtheory.cpp
|
||||
nbtheory.h
|
||||
network.cpp
|
||||
network.h
|
||||
nr.h
|
||||
oaep.cpp
|
||||
oaep.h
|
||||
oids.h
|
||||
osrng.cpp
|
||||
osrng.h
|
||||
panama.cpp
|
||||
panama.h
|
||||
pch.cpp
|
||||
pch.h
|
||||
pkcspad.cpp
|
||||
pkcspad.h
|
||||
polynomi.cpp
|
||||
polynomi.h
|
||||
pssr.cpp
|
||||
pssr.h
|
||||
pubkey.cpp
|
||||
pubkey.h
|
||||
pwdbased.h
|
||||
queue.cpp
|
||||
queue.h
|
||||
rabin.cpp
|
||||
rabin.h
|
||||
randpool.cpp
|
||||
randpool.h
|
||||
rc2.cpp
|
||||
rc2.h
|
||||
rc5.cpp
|
||||
rc5.h
|
||||
rc6.cpp
|
||||
rc6.h
|
||||
rdrand-masm.cmd
|
||||
rdrand-nasm.sh
|
||||
rdrand.S
|
||||
rdrand.asm
|
||||
rdrand.cpp
|
||||
rdrand.h
|
||||
rdtables.cpp
|
||||
regtest.cpp
|
||||
resource.h
|
||||
rijndael.cpp
|
||||
rijndael.h
|
||||
ripemd.cpp
|
||||
ripemd.h
|
||||
rng.cpp
|
||||
rng.h
|
||||
rsa.cpp
|
||||
rsa.h
|
||||
rw.cpp
|
||||
rw.h
|
||||
safer.cpp
|
||||
safer.h
|
||||
salsa.cpp
|
||||
salsa.h
|
||||
seal.cpp
|
||||
seal.h
|
||||
secblock.h
|
||||
seckey.h
|
||||
seed.cpp
|
||||
seed.h
|
||||
serpent.cpp
|
||||
serpent.h
|
||||
serpentp.h
|
||||
sha.cpp
|
||||
sha.h
|
||||
sha3.cpp
|
||||
sha3.h
|
||||
shacal2.cpp
|
||||
shacal2.h
|
||||
shark.cpp
|
||||
shark.h
|
||||
sharkbox.cpp
|
||||
simple.cpp
|
||||
simple.h
|
||||
skipjack.cpp
|
||||
skipjack.h
|
||||
smartptr.h
|
||||
socketft.cpp
|
||||
socketft.h
|
||||
sosemanuk.cpp
|
||||
sosemanuk.h
|
||||
square.cpp
|
||||
square.h
|
||||
squaretb.cpp
|
||||
stdcpp.h
|
||||
strciphr.cpp
|
||||
strciphr.h
|
||||
tea.cpp
|
||||
tea.h
|
||||
test.cpp
|
||||
tftables.cpp
|
||||
tiger.cpp
|
||||
tiger.h
|
||||
tigertab.cpp
|
||||
trdlocal.cpp
|
||||
trdlocal.h
|
||||
trunhash.h
|
||||
ttmac.cpp
|
||||
ttmac.h
|
||||
twofish.cpp
|
||||
twofish.h
|
||||
validat1.cpp
|
||||
validat2.cpp
|
||||
validat3.cpp
|
||||
validate.h
|
||||
vmac.cpp
|
||||
vmac.h
|
||||
vs2010.zip
|
||||
wait.cpp
|
||||
wait.h
|
||||
wake.cpp
|
||||
wake.h
|
||||
whrlpool.cpp
|
||||
whrlpool.h
|
||||
winpipes.cpp
|
||||
winpipes.h
|
||||
words.h
|
||||
x64dll.asm
|
||||
x64masm.asm
|
||||
xtr.cpp
|
||||
xtr.h
|
||||
xtrcrypt.cpp
|
||||
xtrcrypt.h
|
||||
zdeflate.cpp
|
||||
zdeflate.h
|
||||
zinflate.cpp
|
||||
zinflate.h
|
||||
zlib.cpp
|
||||
zlib.h
|
||||
Doxyfile
|
||||
GNUmakefile
|
||||
GNUmakefile-cross
|
||||
License.txt
|
||||
Readme.txt
|
||||
Install.txt
|
||||
Filelist.txt
|
||||
TestData/3desval.dat
|
||||
TestData/3wayval.dat
|
||||
TestData/camellia.dat
|
||||
TestData/cast128v.dat
|
||||
TestData/cast256v.dat
|
||||
TestData/descert.dat
|
||||
TestData/dh1024.dat
|
||||
TestData/dh2048.dat
|
||||
TestData/dlie1024.dat
|
||||
TestData/dlie2048.dat
|
||||
TestData/dsa1024.dat
|
||||
TestData/dsa1024b.dat
|
||||
TestData/dsa512.dat
|
||||
TestData/elgc1024.dat
|
||||
TestData/esig1023.dat
|
||||
TestData/esig1536.dat
|
||||
TestData/esig2046.dat
|
||||
TestData/gostval.dat
|
||||
TestData/ideaval.dat
|
||||
TestData/luc1024.dat
|
||||
TestData/luc2048.dat
|
||||
TestData/lucc1024.dat
|
||||
TestData/lucc512.dat
|
||||
TestData/lucd1024.dat
|
||||
TestData/lucd512.dat
|
||||
TestData/lucs1024.dat
|
||||
TestData/lucs512.dat
|
||||
TestData/marsval.dat
|
||||
TestData/mqv1024.dat
|
||||
TestData/mqv2048.dat
|
||||
TestData/nr1024.dat
|
||||
TestData/nr2048.dat
|
||||
TestData/rabi1024.dat
|
||||
TestData/rabi2048.dat
|
||||
TestData/rc2val.dat
|
||||
TestData/rc5val.dat
|
||||
TestData/rc6val.dat
|
||||
TestData/rijndael.dat
|
||||
TestData/rsa1024.dat
|
||||
TestData/rsa2048.dat
|
||||
TestData/rsa400pb.dat
|
||||
TestData/rsa400pv.dat
|
||||
TestData/rsa512a.dat
|
||||
TestData/rw1024.dat
|
||||
TestData/rw2048.dat
|
||||
TestData/saferval.dat
|
||||
TestData/serpentv.dat
|
||||
TestData/shacal2v.dat
|
||||
TestData/sharkval.dat
|
||||
TestData/skipjack.dat
|
||||
TestData/squareva.dat
|
||||
TestData/twofishv.dat
|
||||
TestData/usage.dat
|
||||
TestData/xtrdh171.dat
|
||||
TestData/xtrdh342.dat
|
||||
TestVectors/Readme.txt
|
||||
TestVectors/aes.txt
|
||||
TestVectors/all.txt
|
||||
TestVectors/camellia.txt
|
||||
TestVectors/ccm.txt
|
||||
TestVectors/cmac.txt
|
||||
TestVectors/dlies.txt
|
||||
TestVectors/dsa.txt
|
||||
TestVectors/dsa_1363.txt
|
||||
TestVectors/eax.txt
|
||||
TestVectors/esign.txt
|
||||
TestVectors/gcm.txt
|
||||
TestVectors/hkdf.txt
|
||||
TestVectors/hmac.txt
|
||||
TestVectors/mars.txt
|
||||
TestVectors/nr.txt
|
||||
TestVectors/panama.txt
|
||||
TestVectors/rsa_oaep.txt
|
||||
TestVectors/rsa_pkcs1_1_5.txt
|
||||
TestVectors/rsa_pss.txt
|
||||
TestVectors/rw.txt
|
||||
TestVectors/salsa.txt
|
||||
TestVectors/seal.txt
|
||||
TestVectors/seed.txt
|
||||
TestVectors/sha.txt
|
||||
TestVectors/sha3.txt
|
||||
TestVectors/shacal2.txt
|
||||
TestVectors/sosemanuk.txt
|
||||
TestVectors/tea.txt
|
||||
TestVectors/ttmac.txt
|
||||
TestVectors/vmac.txt
|
||||
TestVectors/wake.txt
|
||||
TestVectors/whrlpool.txt
|
||||
3way.cpp
|
||||
3way.h
|
||||
adhoc.cpp.proto
|
||||
adler32.cpp
|
||||
adler32.h
|
||||
aes.h
|
||||
algebra.cpp
|
||||
algebra.h
|
||||
algparam.cpp
|
||||
algparam.h
|
||||
arc4.cpp
|
||||
arc4.h
|
||||
argnames.h
|
||||
asn.cpp
|
||||
asn.h
|
||||
authenc.cpp
|
||||
authenc.h
|
||||
base32.cpp
|
||||
base32.h
|
||||
base64.cpp
|
||||
base64.h
|
||||
basecode.cpp
|
||||
basecode.h
|
||||
bench.h
|
||||
bds10.zip
|
||||
bench1.cpp
|
||||
bench2.cpp
|
||||
bfinit.cpp
|
||||
blake2.cpp
|
||||
blake2.h
|
||||
blowfish.cpp
|
||||
blowfish.h
|
||||
blumshub.cpp
|
||||
blumshub.h
|
||||
camellia.cpp
|
||||
camellia.h
|
||||
cast.cpp
|
||||
cast.h
|
||||
casts.cpp
|
||||
cbcmac.cpp
|
||||
cbcmac.h
|
||||
ccm.cpp
|
||||
ccm.h
|
||||
chacha.cpp
|
||||
chacha.h
|
||||
channels.cpp
|
||||
channels.h
|
||||
cmac.cpp
|
||||
cmac.h
|
||||
config.h
|
||||
config.compat
|
||||
cpu.cpp
|
||||
cpu.h
|
||||
crc.cpp
|
||||
crc.h
|
||||
cryptdll.vcxproj
|
||||
cryptdll.vcxproj.filters
|
||||
cryptest.sh
|
||||
cryptest.sln
|
||||
cryptest.vcxproj
|
||||
cryptest.vcxproj.user
|
||||
cryptest.vcxproj.filters
|
||||
cryptest.nmake
|
||||
cryptlib.cpp
|
||||
cryptlib.h
|
||||
cryptlib.vcxproj
|
||||
cryptlib.vcxproj.filters
|
||||
cryptopp.rc
|
||||
datatest.cpp
|
||||
default.cpp
|
||||
default.h
|
||||
des.cpp
|
||||
des.h
|
||||
dessp.cpp
|
||||
dh.cpp
|
||||
dh.h
|
||||
dh2.cpp
|
||||
dh2.h
|
||||
dll.cpp
|
||||
dll.h
|
||||
dlltest.cpp
|
||||
dlltest.vcxproj
|
||||
dlltest.vcxproj.filters
|
||||
dmac.h
|
||||
dsa.cpp
|
||||
dsa.h
|
||||
eax.cpp
|
||||
eax.h
|
||||
ec2n.cpp
|
||||
ec2n.h
|
||||
eccrypto.cpp
|
||||
eccrypto.h
|
||||
ecp.cpp
|
||||
ecp.h
|
||||
elgamal.cpp
|
||||
elgamal.h
|
||||
emsa2.cpp
|
||||
emsa2.h
|
||||
eprecomp.cpp
|
||||
eprecomp.h
|
||||
esign.cpp
|
||||
esign.h
|
||||
factory.h
|
||||
fhmqv.cpp
|
||||
fhmqv.h
|
||||
files.cpp
|
||||
files.h
|
||||
filters.cpp
|
||||
filters.h
|
||||
fips140.cpp
|
||||
fips140.h
|
||||
fipsalgt.cpp
|
||||
fipstest.cpp
|
||||
fltrimpl.h
|
||||
gcm.cpp
|
||||
gcm.h
|
||||
gf256.cpp
|
||||
gf256.h
|
||||
gf2_32.cpp
|
||||
gf2_32.h
|
||||
gf2n.cpp
|
||||
gf2n.h
|
||||
gfpcrypt.cpp
|
||||
gfpcrypt.h
|
||||
gost.cpp
|
||||
gost.h
|
||||
gzip.cpp
|
||||
gzip.h
|
||||
hex.cpp
|
||||
hex.h
|
||||
hkdf.h
|
||||
hmac.cpp
|
||||
hmac.h
|
||||
hmqv.cpp
|
||||
hmqv.h
|
||||
hrtimer.cpp
|
||||
hrtimer.h
|
||||
ida.cpp
|
||||
ida.h
|
||||
idea.cpp
|
||||
idea.h
|
||||
integer.cpp
|
||||
integer.h
|
||||
iterhash.cpp
|
||||
iterhash.h
|
||||
keccak.cpp
|
||||
keccak.h
|
||||
lubyrack.h
|
||||
luc.cpp
|
||||
luc.h
|
||||
mars.cpp
|
||||
mars.h
|
||||
marss.cpp
|
||||
md2.cpp
|
||||
md2.h
|
||||
md4.cpp
|
||||
md4.h
|
||||
md5.cpp
|
||||
md5.h
|
||||
mdc.h
|
||||
mersenne.h
|
||||
misc.cpp
|
||||
misc.h
|
||||
modarith.h
|
||||
modes.cpp
|
||||
modes.h
|
||||
modexppc.h
|
||||
mqueue.cpp
|
||||
mqueue.h
|
||||
mqv.cpp
|
||||
mqv.h
|
||||
nbtheory.cpp
|
||||
nbtheory.h
|
||||
network.cpp
|
||||
network.h
|
||||
nr.h
|
||||
oaep.cpp
|
||||
oaep.h
|
||||
oids.h
|
||||
osrng.cpp
|
||||
osrng.h
|
||||
ossig.h
|
||||
panama.cpp
|
||||
panama.h
|
||||
pch.cpp
|
||||
pch.h
|
||||
pkcspad.cpp
|
||||
pkcspad.h
|
||||
polynomi.cpp
|
||||
polynomi.h
|
||||
pssr.cpp
|
||||
pssr.h
|
||||
pubkey.cpp
|
||||
pubkey.h
|
||||
pwdbased.h
|
||||
queue.cpp
|
||||
queue.h
|
||||
rabin.cpp
|
||||
rabin.h
|
||||
randpool.cpp
|
||||
randpool.h
|
||||
rc2.cpp
|
||||
rc2.h
|
||||
rc5.cpp
|
||||
rc5.h
|
||||
rc6.cpp
|
||||
rc6.h
|
||||
rdrand-masm.cmd
|
||||
rdrand-nasm.sh
|
||||
rdrand.S
|
||||
rdrand.asm
|
||||
rdrand.cpp
|
||||
rdrand.h
|
||||
rdtables.cpp
|
||||
regtest.cpp
|
||||
resource.h
|
||||
rijndael.cpp
|
||||
rijndael.h
|
||||
ripemd.cpp
|
||||
ripemd.h
|
||||
rng.cpp
|
||||
rng.h
|
||||
rsa.cpp
|
||||
rsa.h
|
||||
rw.cpp
|
||||
rw.h
|
||||
safer.cpp
|
||||
safer.h
|
||||
salsa.cpp
|
||||
salsa.h
|
||||
seal.cpp
|
||||
seal.h
|
||||
secblock.h
|
||||
seckey.h
|
||||
seed.cpp
|
||||
seed.h
|
||||
serpent.cpp
|
||||
serpent.h
|
||||
serpentp.h
|
||||
sha.cpp
|
||||
sha.h
|
||||
sha3.cpp
|
||||
sha3.h
|
||||
shacal2.cpp
|
||||
shacal2.h
|
||||
shark.cpp
|
||||
shark.h
|
||||
sharkbox.cpp
|
||||
simple.cpp
|
||||
simple.h
|
||||
skipjack.cpp
|
||||
skipjack.h
|
||||
smartptr.h
|
||||
socketft.cpp
|
||||
socketft.h
|
||||
sosemanuk.cpp
|
||||
sosemanuk.h
|
||||
square.cpp
|
||||
square.h
|
||||
squaretb.cpp
|
||||
stdcpp.h
|
||||
strciphr.cpp
|
||||
strciphr.h
|
||||
tea.cpp
|
||||
tea.h
|
||||
test.cpp
|
||||
trap.h
|
||||
tftables.cpp
|
||||
tiger.cpp
|
||||
tiger.h
|
||||
tigertab.cpp
|
||||
trdlocal.cpp
|
||||
trdlocal.h
|
||||
trunhash.h
|
||||
ttmac.cpp
|
||||
ttmac.h
|
||||
twofish.cpp
|
||||
twofish.h
|
||||
validat1.cpp
|
||||
validat2.cpp
|
||||
validat3.cpp
|
||||
validate.h
|
||||
vmac.cpp
|
||||
vmac.h
|
||||
vc60.zip
|
||||
vs2005.zip
|
||||
wait.cpp
|
||||
wait.h
|
||||
wake.cpp
|
||||
wake.h
|
||||
whrlpool.cpp
|
||||
whrlpool.h
|
||||
winpipes.cpp
|
||||
winpipes.h
|
||||
words.h
|
||||
x64dll.asm
|
||||
x64masm.asm
|
||||
xtr.cpp
|
||||
xtr.h
|
||||
xtrcrypt.cpp
|
||||
xtrcrypt.h
|
||||
zdeflate.cpp
|
||||
zdeflate.h
|
||||
zinflate.cpp
|
||||
zinflate.h
|
||||
zlib.cpp
|
||||
zlib.h
|
||||
Doxyfile
|
||||
GNUmakefile
|
||||
GNUmakefile-cross
|
||||
License.txt
|
||||
Readme.txt
|
||||
Install.txt
|
||||
Filelist.txt
|
||||
TestData/3desval.dat
|
||||
TestData/3wayval.dat
|
||||
TestData/camellia.dat
|
||||
TestData/cast128v.dat
|
||||
TestData/cast256v.dat
|
||||
TestData/descert.dat
|
||||
TestData/dh1024.dat
|
||||
TestData/dh2048.dat
|
||||
TestData/dlie1024.dat
|
||||
TestData/dlie2048.dat
|
||||
TestData/dsa1024.dat
|
||||
TestData/dsa1024b.dat
|
||||
TestData/dsa512.dat
|
||||
TestData/elgc1024.dat
|
||||
TestData/esig1023.dat
|
||||
TestData/esig1536.dat
|
||||
TestData/esig2046.dat
|
||||
TestData/fhmqv160.dat
|
||||
TestData/fhmqv256.dat
|
||||
TestData/fhmqv384.dat
|
||||
TestData/fhmqv512.dat
|
||||
TestData/gostval.dat
|
||||
TestData/hmqv160.dat
|
||||
TestData/hmqv256.dat
|
||||
TestData/hmqv384.dat
|
||||
TestData/hmqv512.dat
|
||||
TestData/ideaval.dat
|
||||
TestData/luc1024.dat
|
||||
TestData/luc2048.dat
|
||||
TestData/lucc1024.dat
|
||||
TestData/lucc512.dat
|
||||
TestData/lucd1024.dat
|
||||
TestData/lucd512.dat
|
||||
TestData/lucs1024.dat
|
||||
TestData/lucs512.dat
|
||||
TestData/marsval.dat
|
||||
TestData/mqv1024.dat
|
||||
TestData/mqv2048.dat
|
||||
TestData/nr1024.dat
|
||||
TestData/nr2048.dat
|
||||
TestData/rabi1024.dat
|
||||
TestData/rabi2048.dat
|
||||
TestData/rc2val.dat
|
||||
TestData/rc5val.dat
|
||||
TestData/rc6val.dat
|
||||
TestData/rijndael.dat
|
||||
TestData/rsa1024.dat
|
||||
TestData/rsa2048.dat
|
||||
TestData/rsa400pb.dat
|
||||
TestData/rsa400pv.dat
|
||||
TestData/rsa512a.dat
|
||||
TestData/rw1024.dat
|
||||
TestData/rw2048.dat
|
||||
TestData/saferval.dat
|
||||
TestData/serpentv.dat
|
||||
TestData/shacal2v.dat
|
||||
TestData/sharkval.dat
|
||||
TestData/skipjack.dat
|
||||
TestData/squareva.dat
|
||||
TestData/twofishv.dat
|
||||
TestData/usage.dat
|
||||
TestData/xtrdh171.dat
|
||||
TestData/xtrdh342.dat
|
||||
TestVectors/Readme.txt
|
||||
TestVectors/aes.txt
|
||||
TestVectors/all.txt
|
||||
TestVectors/blake2.txt
|
||||
TestVectors/blake2b.txt
|
||||
TestVectors/blake2s.txt
|
||||
TestVectors/camellia.txt
|
||||
TestVectors/ccm.txt
|
||||
TestVectors/chacha.txt
|
||||
TestVectors/cmac.txt
|
||||
TestVectors/dlies.txt
|
||||
TestVectors/dsa.txt
|
||||
TestVectors/dsa_1363.txt
|
||||
TestVectors/eax.txt
|
||||
TestVectors/esign.txt
|
||||
TestVectors/gcm.txt
|
||||
TestVectors/hkdf.txt
|
||||
TestVectors/hmac.txt
|
||||
TestVectors/keccak.txt
|
||||
TestVectors/mars.txt
|
||||
TestVectors/nr.txt
|
||||
TestVectors/panama.txt
|
||||
TestVectors/rsa_oaep.txt
|
||||
TestVectors/rsa_pkcs1_1_5.txt
|
||||
TestVectors/rsa_pss.txt
|
||||
TestVectors/dsa_rfc6979.txt
|
||||
TestVectors/rw.txt
|
||||
TestVectors/salsa.txt
|
||||
TestVectors/seal.txt
|
||||
TestVectors/seed.txt
|
||||
TestVectors/sha.txt
|
||||
TestVectors/sha3_fips_202.txt
|
||||
TestVectors/sha3_224_fips_202.txt
|
||||
TestVectors/sha3_256_fips_202.txt
|
||||
TestVectors/sha3_384_fips_202.txt
|
||||
TestVectors/sha3_512_fips_202.txt
|
||||
TestVectors/shacal2.txt
|
||||
TestVectors/sosemanuk.txt
|
||||
TestVectors/tea.txt
|
||||
TestVectors/ttmac.txt
|
||||
TestVectors/vmac.txt
|
||||
TestVectors/wake.txt
|
||||
TestVectors/whrlpool.txt
|
||||
|
||||
661
Common/3dParty/cryptopp/GNUmakefile
Normal file → Executable file
661
Common/3dParty/cryptopp/GNUmakefile
Normal file → Executable file
@ -1,104 +1,162 @@
|
||||
# Base CXXFLAGS used if the user did not specify them
|
||||
CXXFLAGS ?= -DNDEBUG -g2 -O2
|
||||
|
||||
# -fPIC is supported, please report failures with steps to reproduce
|
||||
# If PIC is required but results in a crash, then use -DCRYPTOPP_DISABLE_ASM
|
||||
# CXXFLAGS += -fPIC
|
||||
|
||||
# Add the following options reduce code size, but breaks link
|
||||
# or makes link very slow on some systems
|
||||
# CXXFLAGS += -ffunction-sections -fdata-sections
|
||||
# On OS X, you need to use "LDFLAGS += -Wl,-dead_strip"
|
||||
# LDFLAGS += -Wl,--gc-sections
|
||||
###########################################################
|
||||
##### System Attributes and Programs #####
|
||||
###########################################################
|
||||
|
||||
AR ?= ar
|
||||
ARFLAGS ?= -cr # ar needs the dash on OpenBSD
|
||||
ARFLAGS ?= -cr # ar needs the dash on OpenBSD
|
||||
RANLIB ?= ranlib
|
||||
|
||||
CP ?= cp
|
||||
MV ?= mv
|
||||
EGREP ?= egrep
|
||||
CHMOD ?= chmod
|
||||
MKDIR ?= mkdir
|
||||
EGREP ?= egrep
|
||||
|
||||
LN ?= ln -sf
|
||||
LDCONF ?= /sbin/ldconfig -n
|
||||
UNAME := $(shell uname)
|
||||
IS_X86 := $(shell uname -m | $(EGREP) -i -c "i.86|x86|i86|amd64")
|
||||
IS_X86_64 := $(shell uname -m | $(EGREP) -i -c "(_64|d64)")
|
||||
IS_AARCH64 := $(shell uname -m | $(EGREP) -i -c "aarch64")
|
||||
|
||||
IS_X86 := $(shell uname -m | $(EGREP) -v "x86_64" | $(EGREP) -i -c "i.86|x86|i86")
|
||||
IS_X32 ?= 0
|
||||
IS_X64 := $(shell uname -m | $(EGREP) -i -c "(_64|d64)")
|
||||
IS_PPC := $(shell uname -m | $(EGREP) -i -c "ppc|power")
|
||||
IS_ARM32 := $(shell uname -m | $(EGREP) -i -c "arm")
|
||||
IS_ARM64 := $(shell uname -m | $(EGREP) -i -c "aarch64")
|
||||
|
||||
IS_SUN := $(shell uname | $(EGREP) -i -c "SunOS")
|
||||
IS_LINUX := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Linux")
|
||||
IS_MINGW := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "MinGW")
|
||||
IS_CYGWIN := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Cygwin")
|
||||
IS_DARWIN := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "Darwin")
|
||||
IS_NETBSD := $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -i -c "NetBSD")
|
||||
|
||||
SUN_COMPILER := $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: Sun")
|
||||
GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "(gcc|g\+\+)")
|
||||
SUN_COMPILER := $(shell $(CXX) -V 2>&1 | $(EGREP) -i -c "CC: (Sun|Studio)")
|
||||
GCC_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -v "clang" | $(EGREP) -i -c "(gcc|g\+\+)")
|
||||
CLANG_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
|
||||
INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)")
|
||||
INTEL_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "\(icc\)")
|
||||
MACPORTS_COMPILER := $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "macports")
|
||||
|
||||
# Sun Studio 12.0 provides SunCC 0x0510; and Sun Studio 12.3 provides SunCC 0x0512
|
||||
SUNCC_510_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[0-9]|5\.[2-9]|6\.)")
|
||||
SUNCC_511_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[1-9]|5\.[2-9]|6\.)")
|
||||
SUNCC_512_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[2-9]|5\.[2-9]|6\.)")
|
||||
SUNCC_513_OR_LATER := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: (Sun|Studio) .* (5\.1[3-9]|5\.[2-9]|6\.)")
|
||||
|
||||
HAS_SOLIB_VERSION := $(IS_LINUX)
|
||||
|
||||
# Fixup SunOS
|
||||
ifeq ($(IS_SUN),1)
|
||||
IS_X86 := $(shell isainfo -k 2>/dev/null | grep -i -c "i386")
|
||||
IS_X64 := $(shell isainfo -k 2>/dev/null | grep -i -c "amd64")
|
||||
endif
|
||||
|
||||
###########################################################
|
||||
##### General Variables #####
|
||||
###########################################################
|
||||
|
||||
# Base CXXFLAGS used if the user did not specify them
|
||||
ifeq ($(SUN_COMPILER),1)
|
||||
ifeq ($(SUNCC_512_OR_LATER),1)
|
||||
CXXFLAGS ?= -DNDEBUG -g3 -xO2
|
||||
else
|
||||
CXXFLAGS ?= -DNDEBUG -g -xO2
|
||||
endif
|
||||
else
|
||||
CXXFLAGS ?= -DNDEBUG -g2 -O2
|
||||
endif
|
||||
|
||||
# Default prefix for make install
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX = /usr
|
||||
PREFIX = /usr/local
|
||||
endif
|
||||
|
||||
ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
ifeq ($(DATADIR),)
|
||||
DATADIR := $(PREFIX)/share
|
||||
endif
|
||||
ifeq ($(LIBDIR),)
|
||||
LIBDIR := $(PREFIX)/lib
|
||||
endif
|
||||
ifeq ($(BINDIR),)
|
||||
BINDIR := $(PREFIX)/bin
|
||||
endif
|
||||
ifeq ($(INCLUDEDIR),)
|
||||
INCLUDEDIR := $(PREFIX)/include
|
||||
endif
|
||||
|
||||
# Fix CXX on Cygwin 1.1.4
|
||||
ifeq ($(CXX),gcc)
|
||||
CXX := g++
|
||||
endif
|
||||
|
||||
# We honor ARFLAGS, but the "v" often option used by default causes a noisy make
|
||||
# We honor ARFLAGS, but the "v" option used by default causes a noisy make
|
||||
ifeq ($(ARFLAGS),rv)
|
||||
ARFLAGS = r
|
||||
endif
|
||||
|
||||
ifeq ($(IS_X86),1)
|
||||
###########################################################
|
||||
##### X86/X32/X64 Options #####
|
||||
###########################################################
|
||||
|
||||
IS_GCC_29 := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c gcc-9[0-9][0-9])
|
||||
GCC42_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[2-9]|[5-9]\.)")
|
||||
GCC46_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[6-9]|[5-9]\.)")
|
||||
GCC48_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[8-9]|[5-9]\.)")
|
||||
GCC49_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.9|[5-9]\.)")
|
||||
ifneq ($(IS_X86)$(IS_X32)$(IS_X64),000)
|
||||
|
||||
# Fixup. Clang integrated assembler will be used (-Wa,-q)
|
||||
ifneq ($(MACPORTS_COMPILER),1)
|
||||
IS_GAS := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler")
|
||||
endif
|
||||
|
||||
ifneq ($(GCC_COMPILER),0)
|
||||
IS_GCC_29 := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c gcc-9[0-9][0-9])
|
||||
GCC42_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[2-9]|[5-9]\.)")
|
||||
GCC46_OR_LATER := $(shell $(CXX) -v 2>&1 | $(EGREP) -i -c "gcc version (4\.[6-9]|[5-9]\.)")
|
||||
endif
|
||||
|
||||
ifneq ($(IS_GAS),0)
|
||||
GAS210_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
|
||||
GAS217_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
|
||||
GAS219_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
|
||||
endif
|
||||
|
||||
ICC111_OR_LATER := $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])")
|
||||
GAS210_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])")
|
||||
GAS217_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])")
|
||||
GAS219_OR_LATER := $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")
|
||||
|
||||
# Add -fPIC for x86_64, but not X32, Cygwin or MinGW
|
||||
ifneq ($(IS_X86_64),0)
|
||||
IS_X32 := $(shell $(CXX) -dM -E - < /dev/null 2>&1 | $(EGREP) -c "ILP32")
|
||||
ifeq ($(IS_X32)$(IS_CYGWIN)$(IS_MINGW),000)
|
||||
# Add -fPIC for targets *except* X86, X32, Cygwin or MinGW
|
||||
ifeq ($(IS_X86)$(IS_X32)$(IS_CYGWIN)$(IS_MINGW)$(SUN_COMPILER),00000)
|
||||
ifeq ($(findstring -fPIC,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fPIC
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Guard use of -march=native
|
||||
ifeq ($(GCC_COMPILER),0)
|
||||
ifeq ($(GCC42_OR_LATER)$(IS_NETBSD),10)
|
||||
CXXFLAGS += -march=native
|
||||
else ifneq ($(GCC42_OR_LATER),0)
|
||||
else ifneq ($(CLANG_COMPILER)$(INTEL_COMPILER),00)
|
||||
CXXFLAGS += -march=native
|
||||
else
|
||||
# GCC 3.3 and "unknown option -march="
|
||||
# GCC 4.1 compiler crash with -march=native.
|
||||
ifneq ($(IS_X86_64),0)
|
||||
# Ubuntu GCC 4.1 compiler crash with -march=native
|
||||
# NetBSD GCC 4.8 compiler and "bad value (native) for -march= switch"
|
||||
# Sun compiler is handled below
|
||||
ifeq ($(SUN_COMPILER)$(IS_X64),01)
|
||||
CXXFLAGS += -m64
|
||||
else
|
||||
else ifeq ($(SUN_COMPILER)$(IS_X86),01)
|
||||
CXXFLAGS += -m32
|
||||
endif # X86/X32/X64
|
||||
endif
|
||||
|
||||
# Aligned access required at -O3 for GCC due to vectorization (circa 08/2008). Expect other compilers to do the same.
|
||||
# Aligned access required for -O3 and above due to vectorization
|
||||
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
||||
ifeq ($(findstring -O3,$(CXXFLAGS)),-O3)
|
||||
ifneq ($(UNALIGNED_ACCESS),0)
|
||||
ifeq ($(GCC46_OR_LATER),1)
|
||||
ifeq ($(findstring -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS,$(CXXFLAGS)),)
|
||||
ifeq ($(findstring -O3,$(CXXFLAGS)),-O3)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -O3
|
||||
ifeq ($(findstring -O5,$(CXXFLAGS)),-O5)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -O5
|
||||
ifeq ($(findstring -Ofast,$(CXXFLAGS)),-Ofast)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -Ofast
|
||||
endif # CRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # GCC 4.6
|
||||
endif # UNALIGNED_ACCESS
|
||||
endif # Vectorization
|
||||
|
||||
ifneq ($(INTEL_COMPILER),0)
|
||||
CXXFLAGS += -wd68 -wd186 -wd279 -wd327 -wd161 -wd3180
|
||||
@ -109,34 +167,100 @@ CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(GCC_COMPILER)$(GAS210_OR_LATER),10) # .intel_syntax wasn't supported until GNU assembler 2.10
|
||||
# .intel_syntax wasn't supported until GNU assembler 2.10
|
||||
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS210_OR_LATER),100)
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
|
||||
else
|
||||
ifeq ($(GCC_COMPILER)$(GAS217_OR_LATER),10)
|
||||
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS217_OR_LATER),100)
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
|
||||
else
|
||||
ifeq ($(GCC_COMPILER)$(GAS219_OR_LATER),10)
|
||||
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER)$(GAS219_OR_LATER),100)
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(IS_SUN),0)
|
||||
CXXFLAGS += -Wa,--divide # allow use of "/" operator
|
||||
# Tell MacPorts GCC to use Clang integrated assembler
|
||||
# http://github.com/weidai11/cryptopp/issues/190
|
||||
ifeq ($(GCC_COMPILER)$(MACPORTS_COMPILER),11)
|
||||
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-Wa,-q)
|
||||
CXXFLAGS += -Wa,-q
|
||||
endif
|
||||
ifneq ($(findstring -Wa,-q,$(CXXFLAGS)),-DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER)
|
||||
CXXFLAGS += -DCRYPTOPP_CLANG_INTEGRATED_ASSEMBLER=1
|
||||
endif
|
||||
endif
|
||||
|
||||
endif # IS_X86
|
||||
# GCC on Solaris needs -m64. Otherwise, i386 is default
|
||||
# http://github.com/weidai11/cryptopp/issues/230
|
||||
ifeq ($(IS_SUN)$(GCC_COMPILER)$(IS_X64),111)
|
||||
CXXFLAGS += -m64
|
||||
endif
|
||||
|
||||
# Allow use of "/" operator for GNU Assembler.
|
||||
# http://sourceware.org/bugzilla/show_bug.cgi?id=4572
|
||||
ifeq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS)),)
|
||||
ifeq ($(IS_SUN)$(GCC_COMPILER),11)
|
||||
CXXFLAGS += -Wa,--divide
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist
|
||||
CXXFLAGS += -mbnu210
|
||||
else ifneq ($(findstring -save-temps,$(CXXFLAGS)),-save-temps)
|
||||
ifeq ($(SUN_COMPILER),0)
|
||||
CXXFLAGS += -pipe
|
||||
endif
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
###########################################################
|
||||
##### Not X86/X32/X64 #####
|
||||
###########################################################
|
||||
|
||||
# Add PIC
|
||||
ifeq ($(findstring -fPIC,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fPIC
|
||||
endif
|
||||
|
||||
# Add -pipe for everything except ARM (allow ARM-64 because they seems to have > 1 GB of memory)
|
||||
ifeq ($(IS_ARM32),0)
|
||||
ifeq ($(findstring -save-temps,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -pipe
|
||||
endif
|
||||
endif
|
||||
|
||||
# Aligned access required for -O3 and above due to vectorization
|
||||
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
||||
ifneq ($(UNALIGNED_ACCESS),0)
|
||||
ifeq ($(findstring -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS,$(CXXFLAGS)),)
|
||||
ifeq ($(findstring -O3,$(CXXFLAGS)),-O3)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -O3
|
||||
ifeq ($(findstring -O5,$(CXXFLAGS)),-O5)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -O5
|
||||
ifeq ($(findstring -Ofast,$(CXXFLAGS)),-Ofast)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # -Ofast
|
||||
endif # CRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # UNALIGNED_ACCESS
|
||||
|
||||
endif # IS_X86
|
||||
|
||||
###########################################################
|
||||
##### Common #####
|
||||
###########################################################
|
||||
|
||||
ifneq ($(IS_MINGW),0)
|
||||
LDLIBS += -lws2_32
|
||||
endif
|
||||
|
||||
ifneq ($(IS_SUN),0)
|
||||
LDLIBS += -lnsl -lsocket
|
||||
endif
|
||||
|
||||
ifeq ($(IS_LINUX),1)
|
||||
LDFLAGS += -pthread
|
||||
ifeq ($(findstring -fopenmp,$(CXXFLAGS)),-fopenmp)
|
||||
@ -144,18 +268,8 @@ ifeq ($(findstring -lgomp,$(LDLIBS)),)
|
||||
LDLIBS += -lgomp
|
||||
endif # LDLIBS
|
||||
endif # OpenMP
|
||||
ifneq ($(IS_X86_64),0)
|
||||
M32OR64 = -m64
|
||||
endif
|
||||
endif # IS_LINUX
|
||||
|
||||
# And add it for ARM64, too
|
||||
ifneq ($(IS_AARCH64),0)
|
||||
ifeq ($(findstring -fPIC,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fPIC
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
AR = libtool
|
||||
ARFLAGS = -static -o
|
||||
@ -167,23 +281,35 @@ LDFLAGS += -flat_namespace -undefined suppress -m
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(IS_SUN),0)
|
||||
LDLIBS += -lnsl -lsocket
|
||||
M32OR64 = -m$(shell isainfo -b)
|
||||
endif
|
||||
|
||||
# Add -errtags=yes to get the name for a warning suppression
|
||||
ifneq ($(SUN_COMPILER),0) # override flags for CC Sun C++ compiler
|
||||
CXXFLAGS ?= -DNDEBUG -O -g0 -native -template=no%extdef $(M32OR64)
|
||||
LDFLAGS =
|
||||
AR = $(CXX)
|
||||
ARFLAGS = -xar -o
|
||||
RANLIB = true
|
||||
IS_64 := $(shell isainfo -b 2>/dev/null | grep -i -c "64")
|
||||
ifeq ($(IS_64),1)
|
||||
CXXFLAGS += -m64
|
||||
else ifeq ($(IS_64),0)
|
||||
CXXFLAGS += -m32
|
||||
endif
|
||||
ifneq ($(SUNCC_513_OR_LATER),0)
|
||||
CXXFLAGS += -native
|
||||
endif
|
||||
# Add for non-i386
|
||||
ifneq ($(IS_X86),1)
|
||||
CXXFLAGS += -KPIC
|
||||
endif
|
||||
# Add to all Solaris
|
||||
CXXFLAGS += -template=no%extdef
|
||||
SUN_CC10_BUGGY := $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun .* 5\.10 .* (2009|2010/0[1-4])")
|
||||
ifneq ($(SUN_CC10_BUGGY),0)
|
||||
# -DCRYPTOPP_INCLUDE_VECTOR_CC is needed for Sun Studio 12u1 Sun C++ 5.10 SunOS_i386 128229-02 2009/09/21 and was fixed in May 2010
|
||||
# remove it if you get "already had a body defined" errors in vector.cc
|
||||
CXXFLAGS += -DCRYPTOPP_INCLUDE_VECTOR_CC
|
||||
endif
|
||||
#ifneq ($SUNCC_512_OR_LATER),0)
|
||||
#CXXFLAGS += -xarch=aes -D__AES__=1 -xarch=no%sse4_1 -xarch=no%sse4_2
|
||||
#endif
|
||||
AR = $(CXX)
|
||||
ARFLAGS = -xar -o
|
||||
RANLIB = true
|
||||
endif
|
||||
|
||||
# Undefined Behavior Sanitizer (UBsan) testing. There's no sense in
|
||||
@ -197,71 +323,72 @@ CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # CXXFLAGS
|
||||
endif # UBsan
|
||||
|
||||
# Address Sanitizer (Asan) testing
|
||||
# Address Sanitizer (Asan) testing. Issue 'make asan'.
|
||||
ifeq ($(findstring asan,$(MAKECMDGOALS)),asan)
|
||||
ifeq ($(findstring -fsanitize=address,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fsanitize=address
|
||||
endif # CXXFLAGS
|
||||
ifeq ($(findstring -fno-omit-frame-pointer,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fno-omit-frame-pointer
|
||||
endif # CXXFLAGS
|
||||
endif # Asan
|
||||
|
||||
# LD gold linker testing
|
||||
# LD gold linker testing. Triggered by 'LD=ld.gold'.
|
||||
ifeq ($(findstring ld.gold,$(LD)),ld.gold)
|
||||
ifeq ($(findstring -Wl,-fuse-ld=gold,$(CXXFLAGS)),)
|
||||
ifeq ($(findstring -fuse-ld=gold,$(CXXFLAGS)),)
|
||||
ELF_FORMAT := $(shell file `which ld.gold` 2>&1 | cut -d":" -f 2 | $(EGREP) -i -c "elf")
|
||||
ifneq ($(ELF_FORMAT),0)
|
||||
GOLD_OPTION = -Wl,-fuse-ld=gold
|
||||
LDFLAGS += -fuse-ld=gold
|
||||
endif # ELF/ELF64
|
||||
endif # CXXFLAGS
|
||||
endif # Gold
|
||||
|
||||
# Aligned access testing
|
||||
# Aligned access testing. Issue 'make aligned'.
|
||||
ifneq ($(filter align aligned,$(MAKECMDGOALS)),)
|
||||
ifeq ($(findstring -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS
|
||||
endif # # CXXFLAGS
|
||||
endif # CXXFLAGS
|
||||
endif # Aligned access
|
||||
|
||||
# Debug testing on GNU systems
|
||||
# GCC code coverage. Issue 'make coverage'.
|
||||
ifneq ($(filter coverage,$(MAKECMDGOALS)),)
|
||||
ifeq ($(findstring -coverage,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -coverage
|
||||
endif # -coverage
|
||||
endif # GCC code coverage
|
||||
|
||||
# Debug testing on GNU systems. Triggered by -DDEBUG.
|
||||
# Newlib test due to http://sourceware.org/bugzilla/show_bug.cgi?id=20268
|
||||
ifneq ($(filter -DDEBUG -DDEBUG=1,$(CXXFLAGS)),)
|
||||
USING_GLIBCXX := $(shell $(CXX) -x c++ $(CXXFLAGS) -E adhoc.cpp.proto 2>&1 | $(EGREP) -i -c "__GLIBCXX__")
|
||||
ifneq ($(USING_GLIBCXX),0)
|
||||
HAS_NEWLIB := $(shell $(CXX) -x c++ $(CXXFLAGS) -E adhoc.cpp.proto 2>&1 | $(EGREP) -i -c "__NEWLIB__")
|
||||
ifeq ($(HAS_NEWLIB),0)
|
||||
ifeq ($(findstring -D_GLIBCXX_DEBUG,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -D_GLIBCXX_DEBUG
|
||||
endif # CXXFLAGS
|
||||
ifeq ($(findstring -D_GLIBCXX_CONCEPT_CHECKS,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -D_GLIBCXX_CONCEPT_CHECKS
|
||||
endif # CXXFLAGS
|
||||
endif # NAS_NEWLIB
|
||||
endif # USING_GLIBCXX
|
||||
endif # GNU Debug build
|
||||
|
||||
# List cryptlib.cpp first and cpu.o second in an attempt to tame C++ static initialization problems. The issue
|
||||
# spills into POD data types, so cpu.cpp is the second candidate for explicit initialization order.
|
||||
SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
||||
|
||||
# No need for CPU or RDRAND on non-X86 systems. X32 is represented with X64.
|
||||
ifeq ($(IS_X86)$(IS_X86_64),00)
|
||||
SRCS := $(filter-out cpu.cpp rdrand.cpp, $(SRCS))
|
||||
endif
|
||||
|
||||
ifneq ($(IS_MINGW),0)
|
||||
SRCS += winpipes.cpp
|
||||
endif
|
||||
|
||||
# List of objects with crytlib.o and cpu.o at the first and second index position
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
|
||||
# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
|
||||
TESTOBJS := bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
|
||||
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
|
||||
|
||||
# List cryptlib.cpp first in an attempt to tame C++ static initialization problems
|
||||
DLLSRCS := cryptlib.cpp algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
|
||||
DLLOBJS := $(DLLSRCS:.cpp=.export.o)
|
||||
|
||||
# Import lib testing
|
||||
LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o)
|
||||
TESTIMPORTOBJS := $(TESTOBJS:.o=.import.o)
|
||||
DLLTESTOBJS := dlltest.dllonly.o
|
||||
# Dead code stripping. Issue 'make lean'.
|
||||
ifeq ($(findstring lean,$(MAKECMDGOALS)),lean)
|
||||
ifeq ($(findstring -ffunction-sections,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -ffunction-sections
|
||||
endif # CXXFLAGS
|
||||
ifeq ($(findstring -fdata-sections,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fdata-sections
|
||||
endif # CXXFLAGS
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
ifeq ($(findstring -Wl,-dead_strip,$(LDFLAGS)),)
|
||||
LDFLAGS += -Wl,-dead_strip
|
||||
endif # CXXFLAGS
|
||||
else # BSD, Linux and Unix
|
||||
ifeq ($(findstring -Wl,--gc-sections,$(LDFLAGS)),)
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
endif # LDFLAGS
|
||||
endif # MAKECMDGOALS
|
||||
endif # Dead code stripping
|
||||
|
||||
# For Shared Objects, Diff, Dist/Zip rules
|
||||
LIB_VER := $(shell $(EGREP) "define CRYPTOPP_VERSION" config.h | cut -d" " -f 3)
|
||||
@ -273,6 +400,56 @@ ifeq ($(strip $(LIB_PATCH)),)
|
||||
LIB_PATCH := 0
|
||||
endif
|
||||
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
# Full version suffix for shared library
|
||||
SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
|
||||
# Different patchlevels are compatible, minor versions are not
|
||||
SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR)
|
||||
SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif # HAS_SOLIB_VERSION
|
||||
|
||||
###########################################################
|
||||
##### Source and object files #####
|
||||
###########################################################
|
||||
|
||||
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
|
||||
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
||||
|
||||
# Need CPU for X86/X64/X32 and ARM
|
||||
ifeq ($(IS_X86)$(IS_X64)$(IS_ARM32)$(IS_ARM64),0000)
|
||||
SRCS := $(filter-out cpu.cpp, $(SRCS))
|
||||
endif
|
||||
# Need RDRAND for X86/X64/X32
|
||||
ifeq ($(IS_X86)$(IS_X64),00)
|
||||
SRCS := $(filter-out rdrand.cpp, $(SRCS))
|
||||
endif
|
||||
|
||||
ifneq ($(IS_MINGW),0)
|
||||
SRCS += winpipes.cpp
|
||||
endif
|
||||
|
||||
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
|
||||
# List test.cpp first to tame C++ static initialization problems.
|
||||
TESTSRCS := test.cpp bench1.cpp bench2.cpp validat1.cpp validat2.cpp validat3.cpp adhoc.cpp datatest.cpp regtest.cpp fipsalgt.cpp dlltest.cpp
|
||||
TESTOBJS := $(TESTSRCS:.cpp=.o)
|
||||
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
|
||||
|
||||
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
|
||||
DLLSRCS := cryptlib.cpp cpu.cpp integer.cpp shacal2.cpp md5.cpp shark.cpp zinflate.cpp gf2n.cpp salsa.cpp xtr.cpp oaep.cpp polynomi.cpp rc2.cpp default.cpp wait.cpp wake.cpp twofish.cpp iterhash.cpp adler32.cpp elgamal.cpp marss.cpp blowfish.cpp ecp.cpp filters.cpp strciphr.cpp camellia.cpp ida.cpp zlib.cpp des.cpp crc.cpp algparam.cpp dessp.cpp tea.cpp eax.cpp network.cpp emsa2.cpp pkcspad.cpp squaretb.cpp idea.cpp authenc.cpp hmac.cpp zdeflate.cpp xtrcrypt.cpp queue.cpp mars.cpp rc5.cpp blake2.cpp hrtimer.cpp eprecomp.cpp hex.cpp dsa.cpp sha.cpp fips140.cpp gzip.cpp seal.cpp files.cpp base32.cpp vmac.cpp tigertab.cpp sharkbox.cpp safer.cpp randpool.cpp esign.cpp arc4.cpp osrng.cpp skipjack.cpp seed.cpp sha3.cpp sosemanuk.cpp bfinit.cpp rabin.cpp 3way.cpp rw.cpp rdrand.cpp rsa.cpp rdtables.cpp gost.cpp socketft.cpp tftables.cpp nbtheory.cpp panama.cpp modes.cpp rijndael.cpp casts.cpp chacha.cpp gfpcrypt.cpp poly1305.cpp dll.cpp ec2n.cpp blumshub.cpp algebra.cpp basecode.cpp base64.cpp cbcmac.cpp rc6.cpp dh2.cpp gf256.cpp mqueue.cpp misc.cpp pssr.cpp channels.cpp tiger.cpp cast.cpp rng.cpp square.cpp asn.cpp whrlpool.cpp md4.cpp dh.cpp ccm.cpp md2.cpp mqv.cpp gf2_32.cpp ttmac.cpp luc.cpp trdlocal.cpp pubkey.cpp gcm.cpp ripemd.cpp eccrypto.cpp serpent.cpp cmac.cpp
|
||||
DLLOBJS := $(DLLSRCS:.cpp=.export.o)
|
||||
|
||||
# Import lib testing
|
||||
LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o)
|
||||
TESTIMPORTOBJS := $(TESTOBJS:.o=.import.o)
|
||||
DLLTESTOBJS := dlltest.dllonly.o
|
||||
|
||||
###########################################################
|
||||
##### Targets and Recipes #####
|
||||
###########################################################
|
||||
|
||||
.PHONY: all
|
||||
all: cryptest.exe
|
||||
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
@ -280,49 +457,82 @@ static: libcryptopp.a
|
||||
shared dynamic dylib: libcryptopp.dylib
|
||||
else
|
||||
static: libcryptopp.a
|
||||
shared dynamic: libcryptopp.so
|
||||
shared dynamic: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
endif
|
||||
|
||||
.PHONY: deps
|
||||
deps GNUmakefile.deps:
|
||||
$(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps
|
||||
|
||||
# CXXFLAGS are tuned earlier.
|
||||
.PHONY: asan ubsan align aligned
|
||||
asan ubsan align aligned: libcryptopp.a cryptest.exe
|
||||
|
||||
# CXXFLAGS are tuned earlier. Applications must use linker flags
|
||||
# -Wl,--gc-sections (Linux and Unix) or -Wl,-dead_strip (OS X)
|
||||
.PHONY: lean
|
||||
lean: static dynamic cryptest.exe
|
||||
|
||||
# May want to export CXXFLAGS="-g3 -O1"
|
||||
.PHONY: coverage
|
||||
coverage: libcryptopp.a cryptest.exe
|
||||
lcov --base-directory . --directory . --zerocounters -q
|
||||
./cryptest.exe v
|
||||
./cryptest.exe tv all
|
||||
lcov --base-directory . --directory . -c -o cryptest.info
|
||||
lcov --remove cryptest.info "*test.*" "bench*.cpp" "validat*.*" "/usr/*" -o cryptest.info
|
||||
rm -rf ./TestCoverage/
|
||||
genhtml -o ./TestCoverage/ -t "cryptest.exe test coverage" --num-spaces 4 cryptest.info
|
||||
|
||||
.PHONY: test check
|
||||
test check: cryptest.exe
|
||||
./cryptest.exe v
|
||||
|
||||
# Used to generate list of source files for Autotools, CMakeList, Android.mk, etc
|
||||
.PHONY: sources
|
||||
sources:
|
||||
$(info Library sources: $(filter-out fipstest.cpp $(TESTSRCS),$(SRCS)))
|
||||
$(info )
|
||||
$(info Test sources: $(TESTSRCS))
|
||||
|
||||
# Directory we want (can't specify on Doygen command line)
|
||||
DOCUMENT_DIRECTORY := ref$(LIB_VER)
|
||||
# Directory Doxygen uses (specified in Doygen config file)
|
||||
ifeq ($(wildcard Doxyfile),Doxyfile)
|
||||
DOXYGEN_DIRECTORY := $(strip $(shell $(EGREP) "OUTPUT_DIRECTORY" Doxyfile | grep -v "\#" | cut -d "=" -f 2))
|
||||
endif
|
||||
# Default directory (missing in config file)
|
||||
# Default directory (in case its missing in the config file)
|
||||
ifeq ($(strip $(DOXYGEN_DIRECTORY)),)
|
||||
DOXYGEN_DIRECTORY := html-docs
|
||||
endif
|
||||
|
||||
# Builds the documentation. Directory name is ref563, ref570, etc.
|
||||
.PHONY: docs html
|
||||
docs html:
|
||||
-$(RM) -r $(DOXYGEN_DIRECTORY)/ $(DOCUMENT_DIRECTORY)/ html-docs/
|
||||
doxygen Doxyfile -d CRYPTOPP_DOXYGEN_PROCESSING
|
||||
mv $(DOXYGEN_DIRECTORY)/ $(DOCUMENT_DIRECTORY)/
|
||||
$(MV) $(DOXYGEN_DIRECTORY)/ $(DOCUMENT_DIRECTORY)/
|
||||
-$(RM) CryptoPPRef.zip
|
||||
zip -9 CryptoPPRef.zip -x ".*" -x "*/.*" -r $(DOCUMENT_DIRECTORY)/
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-$(RM) libcryptopp.a libcryptopp.so libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a
|
||||
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS) *.stackdump core-*
|
||||
-$(RM) cryptest.exe dlltest.exe cryptest.import.exe ct rdrand-???.o
|
||||
-$(RM) libcryptopp.a libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(RM) libcryptopp.so libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif
|
||||
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
|
||||
-$(RM) cryptest.exe dlltest.exe cryptest.import.exe cryptest.info ct rdrand-???.o
|
||||
-$(RM) *.gcno *.gcda *.stackdump core-*
|
||||
-$(RM) /tmp/adhoc.exe
|
||||
ifneq ($(wildcard /tmp/cryptopp_test/),)
|
||||
-$(RM) -r /tmp/cryptopp_test/
|
||||
endif
|
||||
ifneq ($(wildcard *.exe.dSYM),)
|
||||
-$(RM) -r *.exe.dSYM/
|
||||
endif
|
||||
ifneq ($(wildcard $(DOCUMENT_DIRECTORY)/),)
|
||||
-$(RM) -r $(DOCUMENT_DIRECTORY)/
|
||||
ifneq ($(wildcard *.dylib.dSYM),)
|
||||
-$(RM) -r *.dylib.dSYM/
|
||||
endif
|
||||
ifneq ($(wildcard cov-int/),)
|
||||
-$(RM) -r cov-int/
|
||||
@ -330,7 +540,18 @@ endif
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt cryptest-*.txt *.o *.ii *.s
|
||||
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt cryptest-*.txt
|
||||
-$(RM) CMakeCache.txt Makefile CTestTestfile.cmake cmake_install.cmake cryptopp-config-version.cmake
|
||||
-$(RM) cryptopp.tgz *.o *.bc *.ii *.s *~
|
||||
ifneq ($(wildcard CMakeFiles/),)
|
||||
-$(RM) -r CMakeFiles/
|
||||
endif
|
||||
ifneq ($(wildcard $(DOCUMENT_DIRECTORY)/),)
|
||||
-$(RM) -r $(DOCUMENT_DIRECTORY)/
|
||||
endif
|
||||
ifneq ($(wildcard TestCoverage/),)
|
||||
-$(RM) -r TestCoverage/
|
||||
endif
|
||||
ifneq ($(wildcard cryptopp$(LIB_VER)\.*),)
|
||||
-$(RM) cryptopp$(LIB_VER)\.*
|
||||
endif
|
||||
@ -343,47 +564,87 @@ endif
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
$(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
|
||||
-$(CP) *.h $(PREFIX)/include/cryptopp
|
||||
-$(CHMOD) 755 $(PREFIX)/include/cryptopp
|
||||
-$(CHMOD) 644 $(PREFIX)/include/cryptopp/*.h
|
||||
-$(CP) libcryptopp.a $(PREFIX)/lib
|
||||
-$(CHMOD) 644 $(PREFIX)/lib/libcryptopp.a
|
||||
-$(CP) cryptest.exe $(PREFIX)/bin
|
||||
-$(CHMOD) 755 $(PREFIX)/bin/cryptest.exe
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
-$(CP) libcryptopp.dylib $(PREFIX)/lib
|
||||
-$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.dylib
|
||||
else
|
||||
-$(CP) libcryptopp.so $(PREFIX)/lib
|
||||
-$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.so
|
||||
$(MKDIR) -p $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(CHMOD) 0644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
|
||||
ifneq ($(wildcard libcryptopp.a),)
|
||||
$(MKDIR) -p $(DESTDIR)$(LIBDIR)
|
||||
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
|
||||
-$(CHMOD) 0644 $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
||||
endif
|
||||
ifneq ($(wildcard cryptest.exe),)
|
||||
$(MKDIR) -p $(DESTDIR)$(BINDIR)
|
||||
$(CP) cryptest.exe $(DESTDIR)$(BINDIR)
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(BINDIR)/cryptest.exe
|
||||
$(MKDIR) -p $(DESTDIR)$(DATADIR)/cryptopp
|
||||
$(CP) -r TestData $(DESTDIR)$(DATADIR)/cryptopp
|
||||
$(CP) -r TestVectors $(DESTDIR)$(DATADIR)/cryptopp
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(DATADIR)/cryptopp
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(DATADIR)/cryptopp/TestData
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
|
||||
-$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestData/*.dat
|
||||
-$(CHMOD) 0644 $(DESTDIR)$(DATADIR)/cryptopp/TestVectors/*.txt
|
||||
endif
|
||||
ifneq ($(wildcard libcryptopp.dylib),)
|
||||
$(MKDIR) -p $(DESTDIR)$(LIBDIR)
|
||||
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
|
||||
-install_name_tool -id $(DESTDIR)$(LIBDIR)/libcryptopp.dylib $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
||||
endif
|
||||
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
|
||||
$(MKDIR) -p $(DESTDIR)$(LIBDIR)
|
||||
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
|
||||
-$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(LN) -sf libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
||||
$(LDCONF) $(DESTDIR)$(LIBDIR)
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: remove uninstall
|
||||
remove uninstall:
|
||||
-$(RM) -r $(PREFIX)/include/cryptopp
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.a
|
||||
-$(RM) $(PREFIX)/bin/cryptest.exe
|
||||
-$(RM) -r $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
||||
-$(RM) $(DESTDIR)$(BINDIR)/cryptest.exe
|
||||
-$(RM) -r $(DESTDIR)$(DATADIR)/cryptopp
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.dylib
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
||||
else
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.so
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
||||
$(LDCONF) $(DESTDIR)$(LIBDIR)
|
||||
endif
|
||||
endif
|
||||
|
||||
libcryptopp.a: public_service | $(LIBOBJS)
|
||||
libcryptopp.a: $(LIBOBJS)
|
||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||
ifeq ($(IS_SUN),0)
|
||||
$(RANLIB) $@
|
||||
endif
|
||||
|
||||
libcryptopp.so: public_service | $(LIBOBJS)
|
||||
$(CXX) -shared -o $@ $(CXXFLAGS) $(GOLD_OPTION) $(LIBOBJS) $(LDLIBS)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
.PHONY: libcryptopp.so
|
||||
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX) | so_warning
|
||||
endif
|
||||
|
||||
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS)
|
||||
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(CXXFLAGS) $(LDFLAGS) $(LIBOBJS) $(LDLIBS)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
|
||||
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif
|
||||
|
||||
libcryptopp.dylib: $(LIBOBJS)
|
||||
$(CXX) -dynamiclib -o $@ $(CXXFLAGS) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" $(LIBOBJS)
|
||||
$(CXX) -dynamiclib -o $@ $(CXXFLAGS) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
|
||||
|
||||
cryptest.exe: public_service | libcryptopp.a $(TESTOBJS)
|
||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(GOLD_OPTION) $(LDLIBS)
|
||||
cryptest.exe: libcryptopp.a $(TESTOBJS)
|
||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
nolib: $(OBJS) # makes it faster to test changes
|
||||
# Makes it faster to test changes
|
||||
nolib: $(OBJS)
|
||||
$(CXX) -o ct $(CXXFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
dll: cryptest.import.exe dlltest.exe
|
||||
@ -393,7 +654,9 @@ cryptopp.dll: $(DLLOBJS)
|
||||
|
||||
libcryptopp.import.a: $(LIBIMPORTOBJS)
|
||||
$(AR) $(ARFLAGS) $@ $(LIBIMPORTOBJS)
|
||||
ifeq ($(IS_SUN),0)
|
||||
$(RANLIB) $@
|
||||
endif
|
||||
|
||||
cryptest.import.exe: cryptopp.dll libcryptopp.import.a $(TESTIMPORTOBJS)
|
||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTIMPORTOBJS) -L. -lcryptopp.dll -lcryptopp.import $(LDFLAGS) $(LDLIBS)
|
||||
@ -401,36 +664,58 @@ cryptest.import.exe: cryptopp.dll libcryptopp.import.a $(TESTIMPORTOBJS)
|
||||
dlltest.exe: cryptopp.dll $(DLLTESTOBJS)
|
||||
$(CXX) -o $@ $(CXXFLAGS) $(DLLTESTOBJS) -L. -lcryptopp.dll $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
# This recipe requires a previous "svn co -r 541 http://svn.code.sf.net/p/cryptopp/code/trunk/c5"
|
||||
.PHONY: diff
|
||||
diff:
|
||||
-$(RM) cryptopp$(LIB_VER).diff
|
||||
-svn diff -r 541 > cryptopp$(LIB_VER).diff
|
||||
|
||||
# This recipe prepares the distro files
|
||||
TEXT_FILES := *.h *.cpp adhoc.cpp.proto License.txt Readme.txt Install.txt Filelist.txt config.recommend Doxyfile cryptest* cryptlib* dlltest* cryptdll* *.sln *.vcproj *.dsw *.dsp cryptopp.rc TestVectors/*.txt TestData/*.dat
|
||||
EXEC_FILES := GNUmakefile GNUmakefile-cross cryptest.sh rdrand-nasm.sh TestData/ TestVectors/
|
||||
TEXT_FILES := *.h *.cpp adhoc.cpp.proto License.txt Readme.txt Install.txt Filelist.txt CMakeLists.txt config.compat Doxyfile cryptest* cryptlib* dlltest* cryptdll* *.sln *.vcxproj *.filters cryptopp.rc TestVectors/*.txt TestData/*.dat TestScripts/*.sh TestScripts/*.pl TestScripts/*.cmd
|
||||
EXEC_FILES := GNUmakefile GNUmakefile-cross TestData/ TestVectors/ TestScripts/
|
||||
|
||||
ifeq ($(wildcard Filelist.txt),Filelist.txt)
|
||||
DIST_FILES := $(shell cat Filelist.txt)
|
||||
endif
|
||||
|
||||
.PHONY: convert
|
||||
convert:
|
||||
chmod 0700 TestVectors/ TestData/
|
||||
chmod 0600 $(TEXT_FILES) *.zip
|
||||
chmod 0700 $(EXEC_FILES)
|
||||
chmod u+x *.cmd *.sh
|
||||
unix2dos --keepdate --quiet $(TEXT_FILES) *.asm *.cmd
|
||||
dos2unix --keepdate --quiet GNUmakefile GNUmakefile-cross *.S *.sh
|
||||
.PHONY: trim
|
||||
trim:
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
xattr -c *
|
||||
sed -i '' -e's/[[:space:]]*$$//' *.compat *.sh *.h *.cpp *.sln *.vcxproj GNUmakefile GNUmakefile-cross
|
||||
make convert
|
||||
else
|
||||
sed -i -e's/[[:space:]]*$$//' *.compat *.sh *.h *.cpp *.sln *.vcxproj GNUmakefile GNUmakefile-cross
|
||||
make convert
|
||||
endif
|
||||
|
||||
.PHONY: convert
|
||||
convert:
|
||||
-$(CHMOD) 0700 TestVectors/ TestData/ TestScripts/
|
||||
-$(CHMOD) 0600 $(TEXT_FILES) *.asm *.S *.zip *.cmake TestVectors/*.txt TestData/*.dat
|
||||
-$(CHMOD) 0700 $(EXEC_FILES) *.sh *.cmd TestScripts/*.sh TestScripts/*.pl TestScripts/*.cmd
|
||||
-$(CHMOD) 0700 *.cmd *.sh GNUmakefile GNUmakefile-cross TestScripts/*.sh TestScripts/*.pl
|
||||
-unix2dos --keepdate --quiet $(TEXT_FILES) *.asm *.cmd *.cmake TestScripts/*.pl TestScripts/*.cmd
|
||||
-dos2unix --keepdate --quiet GNUmakefile GNUmakefile-cross *.S *.sh TestScripts/*.sh
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
-xattr -c *
|
||||
endif
|
||||
|
||||
# Build the ZIP file with source files. No documentation.
|
||||
.PHONY: zip dist
|
||||
zip dist: | distclean convert diff
|
||||
zip dist: | distclean convert
|
||||
zip -q -9 cryptopp$(LIB_VER).zip $(DIST_FILES)
|
||||
|
||||
# Build the ISO to transfer the ZIP to old distros via CDROM
|
||||
.PHONY: iso
|
||||
iso: | zip
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
$(MKDIR) -p $(PWD)/cryptopp$(LIB_VER)
|
||||
$(CP) cryptopp$(LIB_VER).zip $(PWD)/cryptopp$(LIB_VER)
|
||||
hdiutil makehybrid -iso -joliet -o cryptopp$(LIB_VER).iso $(PWD)/cryptopp$(LIB_VER)
|
||||
-$(RM) -r $(PWD)/cryptopp$(LIB_VER)
|
||||
else ifneq ($(IS_LINUX),0)
|
||||
$(MKDIR) -p $(PWD)/cryptopp$(LIB_VER)
|
||||
$(CP) cryptopp$(LIB_VER).zip $(PWD)/cryptopp$(LIB_VER)
|
||||
genisoimage -q -o cryptopp$(LIB_VER).iso $(PWD)/cryptopp$(LIB_VER)
|
||||
-$(RM) -r $(PWD)/cryptopp$(LIB_VER)
|
||||
endif
|
||||
|
||||
# CRYPTOPP_CPU_SPEED in GHz
|
||||
CRYPTOPP_CPU_SPEED ?= 2.4
|
||||
.PHONY: bench benchmark benchmarks
|
||||
bench benchmark benchmarks: cryptest.exe
|
||||
rm -f benchmarks.html
|
||||
@ -440,9 +725,9 @@ bench benchmark benchmarks: cryptest.exe
|
||||
echo "<TITLE>Speed Comparison of Popular Crypto Algorithms</TITLE>" >> benchmarks.html
|
||||
echo "</HEAD>" >> benchmarks.html
|
||||
echo "<BODY>" >> benchmarks.html
|
||||
echo "<H1><a href=\"http://www.cryptopp.com\">Crypto++</a>" $(LIB_MAJOR).$(LIB_MINOR).$(LIB_REVISION) "Benchmarks</H1>" >> benchmarks.html
|
||||
echo "<H1><a href=\"http://www.cryptopp.com\">Crypto++</a>" $(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH) "Benchmarks</H1>" >> benchmarks.html
|
||||
echo "<P>Here are speed benchmarks for some commonly used cryptographic algorithms.</P>" >> benchmarks.html
|
||||
./cryptest.exe b 3 2.4 >> benchmarks.html
|
||||
./cryptest.exe b 3 $(CRYPTOPP_CPU_SPEED) >> benchmarks.html
|
||||
echo "</BODY>" >> benchmarks.html
|
||||
echo "</HTML>" >> benchmarks.html
|
||||
|
||||
@ -469,6 +754,20 @@ cpu.o:
|
||||
endif
|
||||
endif
|
||||
|
||||
# Only use CRYPTOPP_DATA_DIR if its not set in CXXFLAGS
|
||||
ifeq ($(findstring -DCRYPTOPP_DATA_DIR,$(CXXFLAGS)),)
|
||||
ifneq ($(strip $(CRYPTOPP_DATA_DIR)),)
|
||||
validat%.o : validat%.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
|
||||
bench%.o : bench%.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
|
||||
datatest.o : datatest.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
|
||||
test.o : test.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_DATA_DIR=\"$(CRYPTOPP_DATA_DIR)\" -c $<
|
||||
endif
|
||||
endif
|
||||
|
||||
%.dllonly.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_DLL_ONLY -c $< -o $@
|
||||
|
||||
@ -478,27 +777,17 @@ endif
|
||||
%.export.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@
|
||||
|
||||
%.bc : %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
%.o : %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
# Warn of potential configurations issues. They will go away after 5.6.3.
|
||||
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
||||
NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h)
|
||||
COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h)
|
||||
.PHONY: public_service
|
||||
public_service:
|
||||
ifneq ($(UNALIGNED_ACCESS),0)
|
||||
$(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.)
|
||||
endif
|
||||
ifneq ($(NO_INIT_PRIORITY),0)
|
||||
$(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.)
|
||||
endif
|
||||
ifneq ($(COMPATIBILITY_562),0)
|
||||
$(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.)
|
||||
endif
|
||||
ifneq ($(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),000)
|
||||
$(info WARNING: You should make these changes in config.h, and not CXXFLAGS.)
|
||||
$(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.)
|
||||
$(info WARNING: See http://cryptopp.com/wiki/config.h for more details.)
|
||||
.PHONY: so_warning
|
||||
so_warning:
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
$(info WARNING: Only the symlinks to the shared-object library have been updated.)
|
||||
$(info WARNING: If the library is installed in a system directory you will need)
|
||||
$(info WARNING: to run 'ldconfig' to update the shared-object library cache.)
|
||||
$(info )
|
||||
endif
|
||||
|
||||
252
Common/3dParty/cryptopp/GNUmakefile-cross
Normal file → Executable file
252
Common/3dParty/cryptopp/GNUmakefile-cross
Normal file → Executable file
@ -4,26 +4,50 @@ CXXFLAGS ?= -DNDEBUG -g2 -Os -fPIC -pipe
|
||||
# CXXFLAGS += -ffunction-sections -fdata-sections
|
||||
# LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
ARFLAGS = -cr # ar needs the dash on OpenBSD
|
||||
AR ?= ar
|
||||
ARFLAGS ?= cr
|
||||
RANLIB ?= ranlib
|
||||
CP = cp
|
||||
MKDIR = mkdir
|
||||
EGREP = egrep
|
||||
CHMOD = chmod
|
||||
CP ?= cp
|
||||
MV ?= mv
|
||||
CHMOD ?= chmod
|
||||
MKDIR ?= mkdir
|
||||
EGREP ?= egrep
|
||||
LN ?= ln -sf
|
||||
|
||||
CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang")
|
||||
|
||||
IS_X86=0
|
||||
IS_LINUX=0
|
||||
IS_MINGW=0
|
||||
IS_DARWIN=0
|
||||
UNAME=CrossCompile
|
||||
IS_IOS ?= 0
|
||||
IS_ANDROID ?= 0
|
||||
IS_ARM_EMBEDDED ?= 0
|
||||
|
||||
# Can be used by Android and Embeeded cross-compiles. Disable by default because
|
||||
# Android and embedded users typically don't run this configuration.
|
||||
HAS_SOLIB_VERSION ?= 0
|
||||
|
||||
# Default prefix for make install
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX = /usr/local
|
||||
endif
|
||||
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
ifeq ($(DATADIR),)
|
||||
DATADIR := $(PREFIX)/share
|
||||
endif
|
||||
ifeq ($(LIBDIR),)
|
||||
LIBDIR := $(PREFIX)/lib
|
||||
endif
|
||||
ifeq ($(BINDIR),)
|
||||
BINDIR := $(PREFIX)/bin
|
||||
endif
|
||||
ifeq ($(INCLUDEDIR),)
|
||||
INCLUDEDIR := $(PREFIX)/include
|
||||
endif
|
||||
|
||||
# We honor ARFLAGS, but the "v" option used by default causes a noisy make
|
||||
ifeq ($(ARFLAGS),rv)
|
||||
ARFLAGS = r
|
||||
endif
|
||||
|
||||
# Sadly, we can't actually use GCC_PRAGMA_AWARE because of GCC bug 53431.
|
||||
# Its a shame because GCC has so much to offer by the way of analysis.
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
|
||||
@ -31,120 +55,200 @@ ifneq ($(CLANG_COMPILER),0)
|
||||
CXXFLAGS += -Wall
|
||||
endif
|
||||
|
||||
# iOS cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE.
|
||||
# iOS cross-compile configuration.
|
||||
# See http://www.cryptopp.com/wiki/iOS_(Command_Line).
|
||||
ifeq ($(IS_IOS),1)
|
||||
CXX = clang++
|
||||
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(IOS_FLAGS)
|
||||
CXXFLAGS += -arch $(IOS_ARCH) -isysroot $(IOS_SYSROOT)
|
||||
CXXFLAGS += -stdlib=libc++
|
||||
CXXFLAGS += $(IOS_FLAGS) -arch $(IOS_ARCH)
|
||||
CXXFLAGS += -isysroot $(IOS_SYSROOT) -stdlib=libc++
|
||||
|
||||
AR = libtool
|
||||
ARFLAGS = -static -o
|
||||
RANLIB = ranlib
|
||||
endif
|
||||
|
||||
# Android cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE.
|
||||
# Android cross-compile configuration.
|
||||
# See http://www.cryptopp.com/wiki/Android_(Command_Line).
|
||||
ifeq ($(IS_ANDROID),1)
|
||||
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-android.sh'
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ANDROID_FLAGS)
|
||||
CXXFLAGS += --sysroot=$(ANDROID_SYSROOT) -I$(ANDROID_STL_INC)
|
||||
LDLIBS += $(ANDROID_STL_LIB)
|
||||
CXXFLAGS += $(AOSP_FLAGS) -DANDROID --sysroot=$(AOSP_SYSROOT)
|
||||
CXXFLAGS += -Wa,--noexecstack -I$(AOSP_STL_INC)
|
||||
|
||||
# c++config.h shows up in odd places at times.
|
||||
ifneq ($(AOSP_BITS_INC),)
|
||||
CXXFLAGS += -I$(AOSP_BITS_INC)
|
||||
endif
|
||||
|
||||
LDLIBS += $(AOSP_STL_LIB)
|
||||
endif
|
||||
|
||||
# ARM embedded cross-compile configuration. Works in conjunction with IS_CROSS_COMPILE.
|
||||
# ARM embedded cross-compile configuration.
|
||||
# See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line)
|
||||
# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
|
||||
ifeq ($(IS_ARM_EMBEDDED),1)
|
||||
# CPP, CXX, AR, RANLIB, LD, etc are set in 'setenv-embedded.sh'
|
||||
CXXFLAGS += -DCRYPTOPP_DISABLE_ASM $(ARM_EMBEDDED_FLAGS)
|
||||
CXXFLAGS += --sysroot=$(ARM_EMBEDDED_SYSROOT)
|
||||
CXXFLAGS += $(ARM_EMBEDDED_FLAGS) --sysroot=$(ARM_EMBEDDED_SYSROOT)
|
||||
endif
|
||||
|
||||
# List cryptlib.cpp first in an attempt to tame C++ static initialization problems
|
||||
SRCS := cryptlib.cpp cpu.cpp $(filter-out cryptlib.cpp cpu.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
||||
# Dead code stripping. Issue 'make lean'.
|
||||
ifeq ($(findstring lean,$(MAKECMDGOALS)),lean)
|
||||
ifeq ($(findstring -ffunction-sections,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -ffunction-sections
|
||||
endif # CXXFLAGS
|
||||
ifeq ($(findstring -fdata-sections,$(CXXFLAGS)),)
|
||||
CXXFLAGS += -fdata-sections
|
||||
endif # CXXFLAGS
|
||||
ifeq ($(IS_IOS),1)
|
||||
ifeq ($(findstring -Wl,-dead_strip,$(LDFLAGS)),)
|
||||
LDFLAGS += -Wl,-dead_strip
|
||||
endif # CXXFLAGS
|
||||
else # BSD, Linux and Unix
|
||||
ifeq ($(findstring -Wl,--gc-sections,$(LDFLAGS)),)
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
endif # LDFLAGS
|
||||
endif # MAKECMDGOALS
|
||||
endif # Dead code stripping
|
||||
|
||||
# List of objects with crytlib.o at the first index position
|
||||
# List cryptlib.cpp first and cpu.cpp second in an attempt to tame C++ static initialization problems.
|
||||
# The issue spills into POD data types of cpu.cpp due to the storage class of the bools, so cpu.cpp
|
||||
# is the second candidate for explicit initialization order.
|
||||
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp winpipes.cpp cryptlib_bds.cpp,$(wildcard *.cpp))
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
|
||||
# test.o needs to be after bench.o for cygwin 1.1.4 (possible ld bug?)
|
||||
TESTOBJS := bench.o bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o regtest.o fipsalgt.o dlltest.o
|
||||
TESTSRCS := bench1.cpp bench2.cpp test.cpp validat1.cpp validat2.cpp validat3.cpp adhoc.cpp datatest.cpp regtest.cpp fipsalgt.cpp dlltest.cpp
|
||||
TESTOBJS := $(TESTSRCS:.cpp=.o)
|
||||
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
|
||||
|
||||
# List cryptlib.cpp first in an attempt to tame C++ static initialization problems
|
||||
DLLSRCS := cryptlib.cpp cpu.cpp algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
|
||||
DLLOBJS := $(DLLSRCS:.cpp=.export.o)
|
||||
# For Shared Objects, Diff, Dist/Zip rules
|
||||
LIB_VER := $(shell $(EGREP) "define CRYPTOPP_VERSION" config.h | cut -d" " -f 3)
|
||||
LIB_MAJOR := $(shell echo $(LIB_VER) | cut -c 1)
|
||||
LIB_MINOR := $(shell echo $(LIB_VER) | cut -c 2)
|
||||
LIB_PATCH := $(shell echo $(LIB_VER) | cut -c 3)
|
||||
|
||||
# Import lib testing
|
||||
LIBIMPORTOBJS := $(LIBOBJS:.o=.import.o)
|
||||
TESTIMPORTOBJS := $(TESTOBJS:.o=.import.o)
|
||||
DLLTESTOBJS := dlltest.dllonly.o
|
||||
ifeq ($(strip $(LIB_PATCH)),)
|
||||
LIB_PATCH := 0
|
||||
endif
|
||||
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
# Full version suffix for shared library
|
||||
SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
|
||||
# Different patchlevels are compatible, minor versions are not
|
||||
SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR)
|
||||
SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif # HAS_SOLIB_VERSION
|
||||
|
||||
.PHONY: all
|
||||
all: cryptest.exe
|
||||
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
ifneq ($(IS_IOS),0)
|
||||
static: libcryptopp.a
|
||||
shared dynamic dylib: libcryptopp.dylib
|
||||
else
|
||||
static: libcryptopp.a
|
||||
shared dynamic: libcryptopp.so
|
||||
shared dynamic: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
endif
|
||||
|
||||
test: cryptest.exe
|
||||
./cryptest.exe v
|
||||
|
||||
# CXXFLAGS are tuned earlier. Applications must use linker flags
|
||||
# -Wl,--gc-sections (Linux and Unix) or -Wl,-dead_strip (OS X)
|
||||
.PHONY: lean
|
||||
lean: static dynamic cryptest.exe
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-$(RM) cryptest.exe dlltest.exe libcryptopp.a libcryptopp.so libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe ct
|
||||
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS) $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTIMPORTOBJS) $(DLLTESTOBJS)
|
||||
ifneq ($(wildcard *.dSYM),)
|
||||
-$(RM) -r cryptest.exe.dSYM dlltest.exe.dSYM
|
||||
-$(RM) cryptest.exe libcryptopp.a libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.dylib
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(RM) libcryptopp.so libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif
|
||||
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(LIBOBJS) $(TESTOBJS)
|
||||
ifneq ($(wildcard *.exe.dSYM),)
|
||||
-$(RM) -r *.exe.dSYM/
|
||||
endif
|
||||
ifneq ($(wildcard *.dylib.dSYM),)
|
||||
-$(RM) -r *.dylib.dSYM/
|
||||
endif
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps cryptopp$(LIB_VER).diff cryptopp$(LIB_VER).zip *.o *.ii *.s
|
||||
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps cryptopp.tgz *.o *.ii *.s
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
$(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin
|
||||
-$(CP) *.h $(PREFIX)/include/cryptopp
|
||||
-$(CHMOD) 755 $(PREFIX)/include/cryptopp
|
||||
-$(CHMOD) 644 $(PREFIX)/include/cryptopp/*.h
|
||||
-$(CP) libcryptopp.a $(PREFIX)/lib
|
||||
-$(CHMOD) 644 $(PREFIX)/lib/libcryptopp.a
|
||||
-$(CP) cryptest.exe $(PREFIX)/bin
|
||||
-$(CHMOD) 755 $(PREFIX)/bin/cryptest.exe
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
-$(CP) libcryptopp.dylib $(PREFIX)/lib
|
||||
-$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.dylib
|
||||
else
|
||||
-$(CP) libcryptopp.so $(PREFIX)/lib
|
||||
-$(CHMOD) 755 $(PREFIX)/lib/libcryptopp.so
|
||||
$(MKDIR) -p $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(CHMOD) 755 $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(CHMOD) 644 $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
|
||||
ifneq ($(wildcard cryptest.exe),)
|
||||
$(MKDIR) -p $(DESTDIR)$(BINDIR)
|
||||
$(CP) cryptest.exe $(DESTDIR)$(BINDIR)
|
||||
-$(CHMOD) 755 $(DESTDIR)$(BINDIR)/cryptest.exe
|
||||
endif
|
||||
ifneq ($(wildcard libcryptopp.a),)
|
||||
$(MKDIR) -p $(DESTDIR)$(LIBDIR)
|
||||
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
|
||||
-$(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
||||
endif
|
||||
ifneq ($(wildcard libcryptopp.dylib),)
|
||||
$(MKDIR) -p $(DESTDIR)$(LIBDIR)
|
||||
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
|
||||
-$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
||||
endif
|
||||
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
|
||||
$(CP) libcryptopp.so $(DESTDIR)$(LIBDIR)
|
||||
-$(CHMOD) 755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(LN) -sf libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: remove uninstall
|
||||
remove uninstall:
|
||||
-$(RM) -r $(PREFIX)/include/cryptopp
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.a
|
||||
-$(RM) $(PREFIX)/bin/cryptest.exe
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.dylib
|
||||
-$(RM) -r $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
||||
-$(RM) $(DESTDIR)$(BINDIR)/cryptest.exe
|
||||
ifneq ($(IS_IOS),0)
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
||||
else
|
||||
-$(RM) $(PREFIX)/lib/libcryptopp.so
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
||||
endif
|
||||
endif
|
||||
|
||||
libcryptopp.a: public_service | $(LIBOBJS)
|
||||
libcryptopp.a: $(LIBOBJS)
|
||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libcryptopp.so: public_service | $(LIBOBJS)
|
||||
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBJS) $(LDFLAGS) $(LDLIBS)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
.PHONY: libcryptopp.so
|
||||
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
||||
endif
|
||||
|
||||
cryptest.exe: public_service | libcryptopp.a $(TESTOBJS)
|
||||
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS)
|
||||
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(CXXFLAGS) -Wl,--exclude-libs,ALL $(LIBOBJS) $(LDFLAGS) $(LDLIBS)
|
||||
ifeq ($(HAS_SOLIB_VERSION),1)
|
||||
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
|
||||
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
||||
endif
|
||||
|
||||
libcryptopp.dylib: $(LIBOBJS)
|
||||
$(CXX) -dynamiclib -o $@ $(CXXFLAGS) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
|
||||
|
||||
cryptest.exe: libcryptopp.a $(TESTOBJS)
|
||||
$(CXX) -o $@ $(CXXFLAGS) $(TESTOBJS) ./libcryptopp.a $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
# Used to generate list of source files for Autotools, CMakeList and Android.mk
|
||||
.PHONY: sources
|
||||
sources:
|
||||
$(info Library sources: $(filter-out fipstest.cpp $(TESTSRCS),$(SRCS)))
|
||||
$(info )
|
||||
$(info Test sources: $(TESTSRCS))
|
||||
|
||||
adhoc.cpp: adhoc.cpp.proto
|
||||
ifeq ($(wildcard adhoc.cpp),)
|
||||
cp adhoc.cpp.proto adhoc.cpp
|
||||
@ -162,25 +266,3 @@ endif # Dependencies
|
||||
|
||||
GNUmakefile.deps:
|
||||
$(CXX) $(CXXFLAGS) -MM *.cpp > GNUmakefile.deps
|
||||
|
||||
# Warn of potential configurations issues. This will go away after 5.6.3
|
||||
UNALIGNED_ACCESS := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_NO_UNALIGNED_DATA_ACCESS" config.h)
|
||||
NO_INIT_PRIORITY := $(shell $(EGREP) -c "^[[:space:]]*//[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_INIT_PRIORITY" config.h)
|
||||
COMPATIBILITY_562 := $(shell $(EGREP) -c "^[[:space:]]*\#[[:space:]]*define[[:space:]]*CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562" config.h)
|
||||
.PHONY: public_service
|
||||
public_service:
|
||||
ifneq ($(UNALIGNED_ACCESS),0)
|
||||
$(info WARNING: CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined in config.h.)
|
||||
endif
|
||||
ifneq ($(NO_INIT_PRIORITY),0)
|
||||
$(info WARNING: CRYPTOPP_INIT_PRIORITY is not defined in config.h.)
|
||||
endif
|
||||
ifneq ($(COMPATIBILITY_562),0)
|
||||
$(info WARNING: CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 is defined in config.h.)
|
||||
endif
|
||||
ifneq (x$(UNALIGNED_ACCESS)$(NO_INIT_PRIORITY)$(COMPATIBILITY_562),x000)
|
||||
$(info WARNING: You should make these changes in config.h, and not CXXFLAGS.)
|
||||
$(info WARNING: You can 'mv config.recommend config.h', but it breaks versioning.)
|
||||
$(info WARNING: See http://cryptopp.com/wiki/config.h for more details.)
|
||||
$(info )
|
||||
endif
|
||||
|
||||
@ -1,169 +1,185 @@
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Building the Library
|
||||
* Installing the Library
|
||||
* Makefile Targets
|
||||
* DataDir Patch
|
||||
* Dynamic Analysis
|
||||
* Acceptance Testing
|
||||
* Reporting problems
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. It was written and placed in public domain by Wei Dai. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at https://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt.
|
||||
|
||||
These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. On BSD you will likely have to use `gmake` to build the library. On Linux, OS X, Solaris and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions.
|
||||
|
||||
Crypto++ uses a GNU makefile, which combines configuration and a non-anemic make. You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. Please pay particular attention to CRYPTOPP_NO_UNALIGNED_DATA_ACCESS in config.h.
|
||||
|
||||
Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use Cmake, and does not use Boost.
|
||||
|
||||
|
||||
BUILDING THE LIBRARY
|
||||
--------------------
|
||||
|
||||
In general, all you should have to do is open a terminal, and then:
|
||||
|
||||
make
|
||||
make test
|
||||
sudo make install
|
||||
|
||||
The command above builds the static library and cryptest.exe program. If you want to build the shared object, then issue:
|
||||
|
||||
make static dynamic cryptest.exe
|
||||
|
||||
Or:
|
||||
|
||||
make libcryptopp.a libcryptopp.so cryptest.exe
|
||||
|
||||
|
||||
If you would like to use a different compiler, the set CXX:
|
||||
|
||||
export CXX=/opt/intel/bin/icpc
|
||||
make
|
||||
|
||||
If you want to build using C++11, then:
|
||||
|
||||
make CXXFLAGS="-std=c++11"
|
||||
|
||||
Or:
|
||||
|
||||
CXXFLAGS="-std=c++11"
|
||||
make
|
||||
|
||||
LLVM's libc++ is also supported, so you can:
|
||||
|
||||
CXXFLAGS="-std=c++11 -stdlib=libc++"
|
||||
make
|
||||
|
||||
|
||||
INSTALLING THE LIBRARY
|
||||
----------------------
|
||||
|
||||
To install the library into a user selected directory, perform:
|
||||
|
||||
make install PREFIX=/usr/local
|
||||
|
||||
During install, the makefile copies cryptest.exe into $PREFIX/bin, copies headers into $PREFIX/include/cryptopp, and copies libraries into $PREFIX/lib. If you only built a static or dynamic version of the library, then only one library is copied. The install recipe does not fail if the static library or shared object is not built.
|
||||
|
||||
PREFIX is non-standard, but its retained for historical purposes. The makefile also responds to `prefix=<path>`.
|
||||
|
||||
There are some open issues installing the library because cryptest.exe is not sympathetic to path changes of of its test vectors and test data. See the DataDir patch below to fix it.
|
||||
|
||||
|
||||
MAKEFILE TARGETS
|
||||
----------------
|
||||
|
||||
The following are some of the targets provided by the GNU makefile.
|
||||
|
||||
`make` invokes the default rule, which builds the Crypto++ static library and test harness. They are called `libcryptopp.a` and `cryptest.exe`, respectively. `cryptest.exe` links against `libcryptopp.a`, so the static library is a prerequisite for the target.
|
||||
|
||||
`make libcryptopp.a` and `make static` build the static version of the library.
|
||||
|
||||
`make libcryptopp.so` and `make dynamic` build the dynamic version of the library. On Mac OS X, the recipe builds `libcryptopp.dylib` instead.
|
||||
|
||||
`make cryptest.exe` builds the library test harness.
|
||||
|
||||
`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`.
|
||||
|
||||
`make install` installs the library. By default, the makefile copies into `/usr`. On OpenBSD, `make install` uses `/usr/local` by default because C++ headers should not be placed with the system headers.
|
||||
|
||||
`make clean` cleans most transient and temporary objects.
|
||||
|
||||
`make disclean` cleans most objects that are not part of the original distribution.
|
||||
|
||||
`make dist` and `make zip` build s ZIP file that is suitable for distribution.
|
||||
|
||||
|
||||
DATADIR PATCH
|
||||
-------------
|
||||
|
||||
The library offers a DataDir patch to help with post-installation issues regarding the location of the test vectors and test data. Its a patch provided by the community, so it must be applied manually. To acquire the patch, see http://www.cryptopp.com/wiki/DataDir.
|
||||
|
||||
|
||||
DYNAMIC ANALYSIS
|
||||
----------------
|
||||
|
||||
The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan) and Valgrind. Both Clang 3.2 and above and GCC 4.8 and above provide sanitizers. Please check with your distribution on how to install the compiler with its sanitizer libraries (they are sometimes a separate install item).
|
||||
|
||||
UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time:
|
||||
|
||||
make ubsan
|
||||
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
|
||||
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
|
||||
|
||||
Or:
|
||||
|
||||
make asan
|
||||
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
|
||||
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
|
||||
|
||||
If you experience self test failures or see reports of undefined behavior, then you should ensure CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is defined in config.h. CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined due to historical purposes.
|
||||
|
||||
If you experience failures under Asan, then gather more information with:
|
||||
|
||||
./cryptest.exe v 2>&1 | asan_symbolize
|
||||
|
||||
If you moved Crypto++ such that the paths have changed, then perform:
|
||||
|
||||
./cryptest.exe v 2>&1 | sed "s/<old path>/<new path>/g" | asan_symbolize
|
||||
|
||||
|
||||
ACCEPTANCE TESTING
|
||||
------------------
|
||||
|
||||
Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture.
|
||||
|
||||
The first gate is code review and discussion of proposed patches. Git commits often cross reference a User Group discussions.
|
||||
|
||||
Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves.
|
||||
|
||||
Third, the code must pass cleanly though GCC and Clang's Undefined Behavior sanitizer (UBsan) and Address sanitizer (Asan) with CRYPTOPP_NO_UNALIGNED_DATA_ACCESS defined in config.h. See DYNAMIC ANALYSIS above on how to execute them.
|
||||
|
||||
Fourth, the test harness provides a "validation" option which performs basic system checks (like endianess and word sizes) and exercises algorithms (like AES and SHA). You run the validation suite as shown below. The tail of the output should indicate 0 failed tests.
|
||||
|
||||
./cryptest.exe v
|
||||
...
|
||||
|
||||
All tests passed!
|
||||
Test ended at Sun Jul 26 02:10:57 2015
|
||||
Seed used was: 1437891055
|
||||
|
||||
Fifth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests.
|
||||
|
||||
./cryptest.exe tv all
|
||||
...
|
||||
|
||||
Testing SymmetricCipher algorithm MARS/ECB.
|
||||
.................
|
||||
Tests complete. Total tests = 4094. Failed tests = 0.
|
||||
|
||||
REPORTING PROBLEMS
|
||||
------------------
|
||||
|
||||
Dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at https://groups.google.com/forum/#!forum/cryptopp-users.
|
||||
|
||||
Also see http://www.cryptopp.com/wiki/Bug_Report.
|
||||
CONTENTS OF THIS FILE
|
||||
---------------------
|
||||
|
||||
* Introduction
|
||||
* Building the Library
|
||||
* Alternate Build Systems
|
||||
* Installing the Library
|
||||
* Makefile Targets
|
||||
* Dynamic Analysis
|
||||
* Acceptance Testing
|
||||
* Reporting problems
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
Crypto++ Library is a free C++ class library of cryptographic algorithms and schemes. It was written and placed in public domain by Wei Dai. The library homepage is at http://www.cryptopp.com/. The latest library source code can be found at http://github.com/weidai11/cryptopp. For licensing and copyright information, please see License.txt.
|
||||
|
||||
These are general instructions for the BSDs, Linux, OS X, Solaris and Unix. The library uses a GNU makefile, which combines configuration and a non-anemic make. On BSD and Solaris you will likely have to use `gmake` to build the library. On Linux, OS X and Unix, the system's make should be OK. On Windows, Crypto++ provides Borland and Visual Studio solutions.
|
||||
|
||||
You should look through the GNUmakefile and config.h to ensure settings look reasonable before building. If you need compatibility with Crypto++ 5.6.2, then you can use `config.compat` in place of `config.h`. You are discouraged from using `config.compat` because it re-introduces undefined behavior that was cleared at Crypto++ 5.6.3.
|
||||
|
||||
Wiki pages are available for some platforms with specific build instructions. The wiki can be found at http://cryptopp.com/wiki/. The pages include Android, ARM, iOS and Solaris. Solaris users should visit the wiki for important information on compiling the library with different versions of SunCC and options, and information on improving library performance and features.
|
||||
|
||||
Crypto++ does not depend upon other tools or libraries. It does not use Autotools, does not use CMake, and does not use Boost. If you use an alternate build system, like Autotools or CMake, then see the warning below about CXXFLAGS and lack of -DNDEBUG. CMake is available in Master as a matter of convenience, but its not officially supported.
|
||||
|
||||
|
||||
BUILDING THE LIBRARY
|
||||
--------------------
|
||||
|
||||
In general, all you should have to do is open a terminal, and then:
|
||||
|
||||
make
|
||||
make test
|
||||
sudo make install
|
||||
|
||||
The command above builds the static library and cryptest.exe program. If you want to build the shared object, then issue:
|
||||
|
||||
make static dynamic cryptest.exe
|
||||
|
||||
Or:
|
||||
|
||||
make libcryptopp.a libcryptopp.so cryptest.exe
|
||||
|
||||
|
||||
If you would like to use a different compiler, the set CXX:
|
||||
|
||||
export CXX=/opt/intel/bin/icpc
|
||||
make
|
||||
|
||||
If you want to build using C++11, then:
|
||||
|
||||
make CXXFLAGS="-std=c++11"
|
||||
|
||||
Or:
|
||||
|
||||
CXXFLAGS="-std=c++11"
|
||||
make
|
||||
|
||||
LLVM's libc++ is also supported, so you can:
|
||||
|
||||
CXXFLAGS="-std=c++11 -stdlib=libc++"
|
||||
make
|
||||
|
||||
|
||||
ALTERNATE BUILD SYSTEMS
|
||||
-----------------------
|
||||
|
||||
The Crypto++ library is Make based and uses GNU Make by default. The makefile uses '-DNDEBUG -g2 -O2' CXXFLAGS by default. If you use an alternate build system, like Autotools or CMake, then ensure the build system includes '-DNDEBUG' for production or release builds. The Crypto++ library uses asserts for debugging and diagnostics during development; it does not rely on them to crash a program at runtime.
|
||||
|
||||
If an assert triggers in production software, then unprotected sensitive information could be egressed from the program to the filesystem or the platform's error reporting program, like Apport on Ubuntu or CrashReporter on Apple.
|
||||
|
||||
The makefile orders object files to help remediate problems associated with C++ static initialization order. The library does not use custom linker scripts. If you use an alternate build system, like Autotools or CMake, and collect source files into a list, then ensure these three are at the head of the list: 'cryptlib.cpp cpu.cpp integer.cpp <other sources>'. They should be linked in the same order: 'cryptlib.o cpu.o integer.o <other objects>'.
|
||||
|
||||
If your linker supports initialization attributes, like init_priority, then you can define CRYPTOPP_INIT_PRIORITY to control object initialization order. Set it to a value like 250. User programs can use CRYPTOPP_USER_PRIORITY to avoid conflicts with library values. Initialization attributes are more reliable than object file ordering, but its not ubiquitously supported by linkers.
|
||||
|
||||
The makefile links to the static version of the Crypto++ library to avoid binary planting and other LD_PRELOAD tricks. You should use the static version of the library in your programs to help avoid unwanted redirections.
|
||||
|
||||
INSTALLING THE LIBRARY
|
||||
----------------------
|
||||
|
||||
To install the library into a user selected directory, perform:
|
||||
|
||||
make install PREFIX=/usr/local
|
||||
|
||||
If you are going to run `make install PREFIX=/usr/local`, then you should build with '-DCRYPTOPP_DATA_DIR='\"$PREFIX/share/cryptopp/\"' to ensure cryptest.exe can locate the test data files and test vectors after installation. The trailing slash in the path is needed because simple preprocessor concatenation is used.
|
||||
|
||||
During install, the makefile copies cryptest.exe into $PREFIX/bin, copies headers into $PREFIX/include/cryptopp, and copies libraries into $PREFIX/lib. If you only built a static or dynamic version of the library, then only one library is copied. The install recipe does not fail if the static library or shared object is not built.
|
||||
|
||||
PREFIX is non-standard, but its retained for historical purposes. The makefile also responds to `prefix=<path>`.
|
||||
|
||||
|
||||
MAKEFILE TARGETS
|
||||
----------------
|
||||
|
||||
The following are some of the targets provided by the GNU makefile.
|
||||
|
||||
`make` invokes the default rule, which builds the Crypto++ static library and test harness. They are called `libcryptopp.a` and `cryptest.exe`, respectively. `cryptest.exe` links against `libcryptopp.a`, so the static library is a prerequisite for the target.
|
||||
|
||||
`make libcryptopp.a` and `make static` build the static version of the library.
|
||||
|
||||
`make libcryptopp.so` and `make dynamic` build the dynamic version of the library. On Mac OS X, the recipe builds `libcryptopp.dylib` instead.
|
||||
|
||||
`make cryptest.exe` builds the library test harness.
|
||||
|
||||
`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`.
|
||||
|
||||
`make install` installs the library. By default, the makefile copies into `/usr/local` by default.
|
||||
|
||||
`make clean` cleans most transient and temporary objects.
|
||||
|
||||
`make disclean` cleans most objects that are not part of the original distribution.
|
||||
|
||||
`make dist` and `make zip` builds ZIP file that is suitable for distribution.
|
||||
|
||||
`make iso` builds an ISO on Linux or OS X that is suitable for alternate distribution.
|
||||
|
||||
`make ubsan` and `make asan` builds the library with the respective sanitizer.
|
||||
|
||||
|
||||
DYNAMIC ANALYSIS
|
||||
----------------
|
||||
|
||||
The Crypto++ embraces tools like Undefined Behavior sanitizer (UBsan), Address sanitizer (Asan) and Valgrind. Both Clang 3.2 and above and GCC 4.8 and above provide sanitizers. Please check with your distribution on how to install the compiler with its sanitizer libraries (they are sometimes a separate install item).
|
||||
|
||||
UBsan and Asan are mutually exclusive options, so you can perform only one of these at a time:
|
||||
|
||||
make ubsan
|
||||
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
|
||||
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
|
||||
|
||||
Or:
|
||||
|
||||
make asan
|
||||
./cryptest.exe v 2>&1 | egrep "(error|FAILED)"
|
||||
./cryptest.exe tv all 2>&1 | egrep "(error|FAILED)"
|
||||
|
||||
If you experience self test failures or see reports of undefined behavior, then you should ensure CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is defined in config.h. CRYPTOPP_NO_UNALIGNED_DATA_ACCESS is not defined due to historical purposes.
|
||||
|
||||
If you experience failures under Asan, then gather more information with:
|
||||
|
||||
./cryptest.exe v 2>&1 | asan_symbolize
|
||||
|
||||
If you moved Crypto++ such that the paths have changed, then perform:
|
||||
|
||||
./cryptest.exe v 2>&1 | sed "s/<old path>/<new path>/g" | asan_symbolize
|
||||
|
||||
|
||||
ACCEPTANCE TESTING
|
||||
------------------
|
||||
|
||||
Crypto++ uses five security gates in its engineering process. The library must maintain the quality provided by the review system and integrity of the test suites. You can use the information to decide if the Crypto++ library suits your needs and provides a compatible security posture.
|
||||
|
||||
The first gate is code review and discussion of proposed patches. Git commits often cross reference a User Group discussions.
|
||||
|
||||
Second is the compiler warning system. The code must clean compile under the equivalent of GCC's -Wall -Wextra (modulo -Wno-type-limits -Wno-unknown-pragmas). This is a moving target as compiler analysis improves.
|
||||
|
||||
Third, the code must pass cleanly though GCC and Clang's Undefined Behavior sanitizer (UBsan) and Address sanitizer (Asan) with CRYPTOPP_NO_UNALIGNED_DATA_ACCESS defined in config.h. See DYNAMIC ANALYSIS above on how to execute them.
|
||||
|
||||
Fourth, the test harness provides a "validation" option which performs basic system checks (like endianess and word sizes) and exercises algorithms (like AES and SHA). You run the validation suite as shown below. The tail of the output should indicate 0 failed tests.
|
||||
|
||||
./cryptest.exe v
|
||||
...
|
||||
|
||||
All tests passed!
|
||||
Test ended at Sun Jul 26 02:10:57 2015
|
||||
Seed used was: 1437891055
|
||||
|
||||
Fifth, the test harness provides a "test vector" option which uses many known test vectors, even those published by other people (like Brian Gladman for AES). You run the test vectors as shown below. The tail of the output should indicate 0 failed tests.
|
||||
|
||||
./cryptest.exe tv all
|
||||
...
|
||||
|
||||
Testing SymmetricCipher algorithm MARS/ECB.
|
||||
.................
|
||||
Tests complete. Total tests = 4094. Failed tests = 0.
|
||||
|
||||
The library also offers its test script for those who want to use it. The test script is names cryptest.sh, and it repeatedly builds the library and exectues the tests under various configurations. It takes 2 to 4 hours to run on a semi-modern desktop or server; and days to run on an IoT gadget. Also see http://github.com/weidai11/cryptopp/blob/master/cryptest.sh and http://cryptopp.com/wiki/Cryptest.sh.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
------------------
|
||||
|
||||
Dirty compiles and failures in the validation suite or test vectors should be reported at the Crypto++ User Group. The User Group is located at http://groups.google.com/forum/#!forum/cryptopp-users.
|
||||
|
||||
Also see http://www.cryptopp.com/wiki/Bug_Report.
|
||||
|
||||
@ -1,51 +1,51 @@
|
||||
Compilation Copyright (c) 1995-2013 by Wei Dai. All rights reserved.
|
||||
This copyright applies only to this software distribution package
|
||||
as a compilation, and does not imply a copyright on any particular
|
||||
file in the package.
|
||||
|
||||
All individual files in this compilation are placed in the public domain by
|
||||
Wei Dai and other contributors.
|
||||
|
||||
I would like to thank the following authors for placing their works into
|
||||
the public domain:
|
||||
|
||||
Joan Daemen - 3way.cpp
|
||||
Leonard Janke - cast.cpp, seal.cpp
|
||||
Steve Reid - cast.cpp
|
||||
Phil Karn - des.cpp
|
||||
Andrew M. Kuchling - md2.cpp, md4.cpp
|
||||
Colin Plumb - md5.cpp
|
||||
Seal Woods - rc6.cpp
|
||||
Chris Morgan - rijndael.cpp
|
||||
Paulo Baretto - rijndael.cpp, skipjack.cpp, square.cpp
|
||||
Richard De Moliner - safer.cpp
|
||||
Matthew Skala - twofish.cpp
|
||||
Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp
|
||||
Ronny Van Keer - sha3.cpp
|
||||
|
||||
The Crypto++ Library (as a compilation) is currently licensed under the Boost
|
||||
Software License 1.0 (http://www.boost.org/users/license.html).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
Compilation Copyright (c) 1995-2016 by Wei Dai. All rights reserved.
|
||||
This copyright applies only to this software distribution package
|
||||
as a compilation, and does not imply a copyright on any particular
|
||||
file in the package.
|
||||
|
||||
All individual files in this compilation are placed in the public domain by
|
||||
Wei Dai and other contributors.
|
||||
|
||||
I would like to thank the following authors for placing their works into
|
||||
the public domain:
|
||||
|
||||
Joan Daemen - 3way.cpp
|
||||
Leonard Janke - cast.cpp, seal.cpp
|
||||
Steve Reid - cast.cpp
|
||||
Phil Karn - des.cpp
|
||||
Andrew M. Kuchling - md2.cpp, md4.cpp
|
||||
Colin Plumb - md5.cpp
|
||||
Seal Woods - rc6.cpp
|
||||
Chris Morgan - rijndael.cpp
|
||||
Paulo Baretto - rijndael.cpp, skipjack.cpp, square.cpp
|
||||
Richard De Moliner - safer.cpp
|
||||
Matthew Skala - twofish.cpp
|
||||
Kevin Springle - camellia.cpp, shacal2.cpp, ttmac.cpp, whrlpool.cpp, ripemd.cpp
|
||||
Ronny Van Keer - sha3.cpp
|
||||
|
||||
The Crypto++ Library (as a compilation) is currently licensed under the Boost
|
||||
Software License 1.0 (http://www.boost.org/users/license.html).
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
||||
0123456789abcdeffedcba9876543210 0123456789abcde7 7f1d0a77826b8aff
|
||||
0123456789abcdeffedcba987654321089abcdef01234567 0123456789abcde7 de0b7c06ae5e0ed5
|
||||
0123456789ABCDEF01010101010101011011121314151617 94DBE082549A14EF 9011121314151617
|
||||
@ -1,5 +0,0 @@
|
||||
000000000000000000000000 000000010000000100000001 4059c76e83ae9dc4ad21ecf7
|
||||
000000060000000500000004 000000030000000200000001 d2f05b5ed6144138cab920cd
|
||||
def01234456789abbcdef012 234567899abcdef001234567 0aa55dbb9cdddb6d7cdb76b2
|
||||
d2f05b5ed6144138cab920cd 4059c76e83ae9dc4ad21ecf7 478ea8716b13f17c15b155ed
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
0123456789ABCDEFFEDCBA9876543210 0123456789ABCDEFFEDCBA9876543210 67673138549669730857065648EABE43
|
||||
80000000000000000000000000000000 00000000000000000000000000000000 6C227F749319A3AA7DA235A9BBA05A2C
|
||||
00000000000000000000000000000001 00000000000000000000000000000000 41E0E6DC2DDEC65D8B8120E60977B82D
|
||||
00000000000000000000000000000000 80000000000000000000000000000000 07923A39EB0A817D1C4D87BDB82D1F1C
|
||||
00000000000000000000000000000000 00000000000000000000000000000001 F5574ACC3148DFCB9015200631024DF9
|
||||
00000000000000000000000000000000 00000000000000000000000000000000 3D028025B156327C17F762C1F2CBCA71
|
||||
01010101010101010101010101010101 01010101010101010101010101010101 637084CB1120D6F25DB618893040AA27
|
||||
02020202020202020202020202020202 02020202020202020202020202020202 612834AAC9EF906BAEAA076E1C75179D
|
||||
04040404040404040404040404040404 04040404040404040404040404040404 B24FAF8A579E4EFE986571FB2F68B5B4
|
||||
08080808080808080808080808080808 08080808080808080808080808080808 3E5CAFBB70545AABB1109293A1C44C14
|
||||
10101010101010101010101010101010 10101010101010101010101010101010 E1FA5FD3F40B766BBE3DF469AF41B420
|
||||
20202020202020202020202020202020 20202020202020202020202020202020 7E724027BB2F591C63254D936FCC4B43
|
||||
40404040404040404040404040404040 40404040404040404040404040404040 538ADCBE104A3483B3C2A3D8CE72FBD6
|
||||
80808080808080808080808080808080 80808080808080808080808080808080 AA7627F70F6B54C217C3EF232D362459
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 25DD9EB9DD67FBC6E8431F56F4FBE651
|
||||
0123456789ABCDEFFEDCBA98765432100011223344556677 0123456789ABCDEFFEDCBA9876543210 B4993401B3E996F84EE5CEE7D79B09B9
|
||||
800000000000000000000000000000000000000000000000 00000000000000000000000000000000 1B6220D365C2176C1D41A5826520FCA1
|
||||
000000000000000000000000000000000000000000000001 00000000000000000000000000000000 E37577F71E0E643C4D3F55219ABA1394
|
||||
000000000000000000000000000000000000000000000000 80000000000000000000000000000000 3EB6CC5618EFC98455B5992050D474E7
|
||||
000000000000000000000000000000000000000000000000 00000000000000000000000000000001 BA9AE89FDDCE4B51131E17C4D65CE587
|
||||
000000000000000000000000000000000000000000000000 00000000000000000000000000000000 56E1E129CA5C02C7F9AC6AFDEF86ADC3
|
||||
010101010101010101010101010101010101010101010101 01010101010101010101010101010101 8F764397C10BE84BA876CEEFA4225BFF
|
||||
020202020202020202020202020202020202020202020202 02020202020202020202020202020202 60B00674BFD444D07B5A19851E6151CD
|
||||
040404040404040404040404040404040404040404040404 04040404040404040404040404040404 81B26FF4F6B4377CC555873504B3A38B
|
||||
080808080808080808080808080808080808080808080808 08080808080808080808080808080808 A2AA1C6693DC2B70D75C9B39B9B214D0
|
||||
101010101010101010101010101010101010101010101010 10101010101010101010101010101010 A907BFDAEEF8C81D05855235E8D3BE08
|
||||
202020202020202020202020202020202020202020202020 20202020202020202020202020202020 87F8EA30332036F17CEAC0097CE33BC1
|
||||
404040404040404040404040404040404040404040404040 40404040404040404040404040404040 A2C32EA499E41A248565253BACC11E3B
|
||||
808080808080808080808080808080808080808080808080 80808080808080808080808080808080 F602BA7F515B082983B8F7A27F92408F
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3F8D5676F51CE23DC3BDB627F8B3883E
|
||||
0123456789ABCDEFFEDCBA987654321000112233445566778899AABBCCDDEEFF 0123456789ABCDEFFEDCBA9876543210 9ACC237DFF16D76C20EF7C919E3A7509
|
||||
8000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 2136FABDA091DFB5171B94B8EFBB5D08
|
||||
0000000000000000000000000000000000000000000000000000000000000001 00000000000000000000000000000000 AFCD38B195E0A736304E89B9AE3019D3
|
||||
0000000000000000000000000000000000000000000000000000000000000000 80000000000000000000000000000000 B0C6B88AEA518AB09E847248E91B1B9D
|
||||
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000001 9CDB269B5D293BC5DB9C55B057D9B591
|
||||
0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000 396154111ADEFC500CF6E5C99038BC17
|
||||
0101010101010101010101010101010101010101010101010101010101010101 01010101010101010101010101010101 438D0C2E7E86869B56EBA23B66086A01
|
||||
0202020202020202020202020202020202020202020202020202020202020202 02020202020202020202020202020202 D4F553BFA794F55EF3B7A578629F6DEA
|
||||
0404040404040404040404040404040404040404040404040404040404040404 04040404040404040404040404040404 5E858730ABC9823A93CA4CAB67F0B423
|
||||
0808080808080808080808080808080808080808080808080808080808080808 08080808080808080808080808080808 F9A9C1540AE1B314DBEDF9A49054DC9D
|
||||
1010101010101010101010101010101010101010101010101010101010101010 10101010101010101010101010101010 6693FC130669F194F81E8D175194DDA2
|
||||
2020202020202020202020202020202020202020202020202020202020202020 20202020202020202020202020202020 F3E1FDA6B9C8314799F4654C29F1C690
|
||||
4040404040404040404040404040404040404040404040404040404040404040 40404040404040404040404040404040 4A30476F1141FBF303ED63FCD3CB0536
|
||||
8080808080808080808080808080808080808080808080808080808080808080 80808080808080808080808080808080 0C765AA494E048FC8BB23139F2124CB6
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 4F05F28CA23EEAE205B67B1C95CD5280
|
||||
@ -1,11 +0,0 @@
|
||||
01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A
|
||||
01 23 45 67 89 AB CD EF
|
||||
23 8B 4F E5 84 7E 44 B2
|
||||
|
||||
01 23 45 67 12 34 56 78 23 45
|
||||
01 23 45 67 89 AB CD EF
|
||||
EB 6A 71 1A 2C 02 27 1B
|
||||
|
||||
01 23 45 67 12
|
||||
01 23 45 67 89 AB CD EF
|
||||
7A C8 16 D1 6E 9B 30 2E
|
||||
@ -1,11 +0,0 @@
|
||||
2342bb9efa38542c0af75647f29f615d
|
||||
00000000000000000000000000000000
|
||||
c842a08972b43d20836c91d1b7530f6b
|
||||
|
||||
2342bb9efa38542cbed0ac83940ac298bac77a7717942863
|
||||
00000000000000000000000000000000
|
||||
1b386c0210dcadcbdd0e41aa08a7a7e8
|
||||
|
||||
2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604
|
||||
00000000000000000000000000000000
|
||||
4f6a2038286897b9c9870136553317fa
|
||||
@ -1,171 +0,0 @@
|
||||
0101010101010101 95F8A5E5DD31D900 8000000000000000
|
||||
0101010101010101 DD7F121CA5015619 4000000000000000
|
||||
0101010101010101 2E8653104F3834EA 2000000000000000
|
||||
0101010101010101 4BD388FF6CD81D4F 1000000000000000
|
||||
0101010101010101 20B9E767B2FB1456 0800000000000000
|
||||
0101010101010101 55579380D77138EF 0400000000000000
|
||||
0101010101010101 6CC5DEFAAF04512F 0200000000000000
|
||||
0101010101010101 0D9F279BA5D87260 0100000000000000
|
||||
0101010101010101 D9031B0271BD5A0A 0080000000000000
|
||||
0101010101010101 424250B37C3DD951 0040000000000000
|
||||
0101010101010101 B8061B7ECD9A21E5 0020000000000000
|
||||
0101010101010101 F15D0F286B65BD28 0010000000000000
|
||||
0101010101010101 ADD0CC8D6E5DEBA1 0008000000000000
|
||||
0101010101010101 E6D5F82752AD63D1 0004000000000000
|
||||
0101010101010101 ECBFE3BD3F591A5E 0002000000000000
|
||||
0101010101010101 F356834379D165CD 0001000000000000
|
||||
0101010101010101 2B9F982F20037FA9 0000800000000000
|
||||
0101010101010101 889DE068A16F0BE6 0000400000000000
|
||||
0101010101010101 E19E275D846A1298 0000200000000000
|
||||
0101010101010101 329A8ED523D71AEC 0000100000000000
|
||||
0101010101010101 E7FCE22557D23C97 0000080000000000
|
||||
0101010101010101 12A9F5817FF2D65D 0000040000000000
|
||||
0101010101010101 A484C3AD38DC9C19 0000020000000000
|
||||
0101010101010101 FBE00A8A1EF8AD72 0000010000000000
|
||||
0101010101010101 750D079407521363 0000008000000000
|
||||
0101010101010101 64FEED9C724C2FAF 0000004000000000
|
||||
0101010101010101 F02B263B328E2B60 0000002000000000
|
||||
0101010101010101 9D64555A9A10B852 0000001000000000
|
||||
0101010101010101 D106FF0BED5255D7 0000000800000000
|
||||
0101010101010101 E1652C6B138C64A5 0000000400000000
|
||||
0101010101010101 E428581186EC8F46 0000000200000000
|
||||
0101010101010101 AEB5F5EDE22D1A36 0000000100000000
|
||||
0101010101010101 E943D7568AEC0C5C 0000000080000000
|
||||
0101010101010101 DF98C8276F54B04B 0000000040000000
|
||||
0101010101010101 B160E4680F6C696F 0000000020000000
|
||||
0101010101010101 FA0752B07D9C4AB8 0000000010000000
|
||||
0101010101010101 CA3A2B036DBC8502 0000000008000000
|
||||
0101010101010101 5E0905517BB59BCF 0000000004000000
|
||||
0101010101010101 814EEB3B91D90726 0000000002000000
|
||||
0101010101010101 4D49DB1532919C9F 0000000001000000
|
||||
0101010101010101 25EB5FC3F8CF0621 0000000000800000
|
||||
0101010101010101 AB6A20C0620D1C6F 0000000000400000
|
||||
0101010101010101 79E90DBC98F92CCA 0000000000200000
|
||||
0101010101010101 866ECEDD8072BB0E 0000000000100000
|
||||
0101010101010101 8B54536F2F3E64A8 0000000000080000
|
||||
0101010101010101 EA51D3975595B86B 0000000000040000
|
||||
0101010101010101 CAFFC6AC4542DE31 0000000000020000
|
||||
0101010101010101 8DD45A2DDF90796C 0000000000010000
|
||||
0101010101010101 1029D55E880EC2D0 0000000000008000
|
||||
0101010101010101 5D86CB23639DBEA9 0000000000004000
|
||||
0101010101010101 1D1CA853AE7C0C5F 0000000000002000
|
||||
0101010101010101 CE332329248F3228 0000000000001000
|
||||
0101010101010101 8405D1ABE24FB942 0000000000000800
|
||||
0101010101010101 E643D78090CA4207 0000000000000400
|
||||
0101010101010101 48221B9937748A23 0000000000000200
|
||||
0101010101010101 DD7C0BBD61FAFD54 0000000000000100
|
||||
0101010101010101 2FBC291A570DB5C4 0000000000000080
|
||||
0101010101010101 E07C30D7E4E26E12 0000000000000040
|
||||
0101010101010101 0953E2258E8E90A1 0000000000000020
|
||||
0101010101010101 5B711BC4CEEBF2EE 0000000000000010
|
||||
0101010101010101 CC083F1E6D9E85F6 0000000000000008
|
||||
0101010101010101 D2FD8867D50D2DFE 0000000000000004
|
||||
0101010101010101 06E7EA22CE92708F 0000000000000002
|
||||
0101010101010101 166B40B44ABA4BD6 0000000000000001
|
||||
8001010101010101 0000000000000000 95A8D72813DAA94D
|
||||
4001010101010101 0000000000000000 0EEC1487DD8C26D5
|
||||
2001010101010101 0000000000000000 7AD16FFB79C45926
|
||||
1001010101010101 0000000000000000 D3746294CA6A6CF3
|
||||
0801010101010101 0000000000000000 809F5F873C1FD761
|
||||
0401010101010101 0000000000000000 C02FAFFEC989D1FC
|
||||
0201010101010101 0000000000000000 4615AA1D33E72F10
|
||||
0180010101010101 0000000000000000 2055123350C00858
|
||||
0140010101010101 0000000000000000 DF3B99D6577397C8
|
||||
0120010101010101 0000000000000000 31FE17369B5288C9
|
||||
0110010101010101 0000000000000000 DFDD3CC64DAE1642
|
||||
0108010101010101 0000000000000000 178C83CE2B399D94
|
||||
0104010101010101 0000000000000000 50F636324A9B7F80
|
||||
0102010101010101 0000000000000000 A8468EE3BC18F06D
|
||||
0101800101010101 0000000000000000 A2DC9E92FD3CDE92
|
||||
0101400101010101 0000000000000000 CAC09F797D031287
|
||||
0101200101010101 0000000000000000 90BA680B22AEB525
|
||||
0101100101010101 0000000000000000 CE7A24F350E280B6
|
||||
0101080101010101 0000000000000000 882BFF0AA01A0B87
|
||||
0101040101010101 0000000000000000 25610288924511C2
|
||||
0101020101010101 0000000000000000 C71516C29C75D170
|
||||
0101018001010101 0000000000000000 5199C29A52C9F059
|
||||
0101014001010101 0000000000000000 C22F0A294A71F29F
|
||||
0101012001010101 0000000000000000 EE371483714C02EA
|
||||
0101011001010101 0000000000000000 A81FBD448F9E522F
|
||||
0101010801010101 0000000000000000 4F644C92E192DFED
|
||||
0101010401010101 0000000000000000 1AFA9A66A6DF92AE
|
||||
0101010201010101 0000000000000000 B3C1CC715CB879D8
|
||||
0101010180010101 0000000000000000 19D032E64AB0BD8B
|
||||
0101010140010101 0000000000000000 3CFAA7A7DC8720DC
|
||||
0101010120010101 0000000000000000 B7265F7F447AC6F3
|
||||
0101010110010101 0000000000000000 9DB73B3C0D163F54
|
||||
0101010108010101 0000000000000000 8181B65BABF4A975
|
||||
0101010104010101 0000000000000000 93C9B64042EAA240
|
||||
0101010102010101 0000000000000000 5570530829705592
|
||||
0101010101800101 0000000000000000 8638809E878787A0
|
||||
0101010101400101 0000000000000000 41B9A79AF79AC208
|
||||
0101010101200101 0000000000000000 7A9BE42F2009A892
|
||||
0101010101100101 0000000000000000 29038D56BA6D2745
|
||||
0101010101080101 0000000000000000 5495C6ABF1E5DF51
|
||||
0101010101040101 0000000000000000 AE13DBD561488933
|
||||
0101010101020101 0000000000000000 024D1FFA8904E389
|
||||
0101010101018001 0000000000000000 D1399712F99BF02E
|
||||
0101010101014001 0000000000000000 14C1D7C1CFFEC79E
|
||||
0101010101012001 0000000000000000 1DE5279DAE3BED6F
|
||||
0101010101011001 0000000000000000 E941A33F85501303
|
||||
0101010101010801 0000000000000000 DA99DBBC9A03F379
|
||||
0101010101010401 0000000000000000 B7FC92F91D8E92E9
|
||||
0101010101010201 0000000000000000 AE8E5CAA3CA04E85
|
||||
0101010101010180 0000000000000000 9CC62DF43B6EED74
|
||||
0101010101010140 0000000000000000 D863DBB5C59A91A0
|
||||
0101010101010120 0000000000000000 A1AB2190545B91D7
|
||||
0101010101010110 0000000000000000 0875041E64C570F7
|
||||
0101010101010108 0000000000000000 5A594528BEBEF1CC
|
||||
0101010101010104 0000000000000000 FCDB3291DE21F0C0
|
||||
0101010101010102 0000000000000000 869EFD7F9F265A09
|
||||
1046913489980131 0000000000000000 88D55E54F54C97B4
|
||||
1007103489988020 0000000000000000 0C0CC00C83EA48FD
|
||||
10071034C8980120 0000000000000000 83BC8EF3A6570183
|
||||
1046103489988020 0000000000000000 DF725DCAD94EA2E9
|
||||
1086911519190101 0000000000000000 E652B53B550BE8B0
|
||||
1086911519580101 0000000000000000 AF527120C485CBB0
|
||||
5107B01519580101 0000000000000000 0F04CE393DB926D5
|
||||
1007B01519190101 0000000000000000 C9F00FFC74079067
|
||||
3107915498080101 0000000000000000 7CFD82A593252B4E
|
||||
3107919498080101 0000000000000000 CB49A2F9E91363E3
|
||||
10079115B9080140 0000000000000000 00B588BE70D23F56
|
||||
3107911598090140 0000000000000000 406A9A6AB43399AE
|
||||
1007D01589980101 0000000000000000 6CB773611DCA9ADA
|
||||
9107911589980101 0000000000000000 67FD21C17DBB5D70
|
||||
9107D01589190101 0000000000000000 9592CB4110430787
|
||||
1007D01598980120 0000000000000000 A6B7FF68A318DDD3
|
||||
1007940498190101 0000000000000000 4D102196C914CA16
|
||||
0107910491190401 0000000000000000 2DFA9F4573594965
|
||||
0107910491190101 0000000000000000 B46604816C0E0774
|
||||
0107940491190401 0000000000000000 6E7E6221A4F34E87
|
||||
19079210981A0101 0000000000000000 AA85E74643233199
|
||||
1007911998190801 0000000000000000 2E5A19DB4D1962D6
|
||||
10079119981A0801 0000000000000000 23A866A809D30894
|
||||
1007921098190101 0000000000000000 D812D961F017D320
|
||||
100791159819010B 0000000000000000 055605816E58608F
|
||||
1004801598190101 0000000000000000 ABD88E8B1B7716F1
|
||||
1004801598190102 0000000000000000 537AC95BE69DA1E1
|
||||
1004801598190108 0000000000000000 AED0F6AE3C25CDD8
|
||||
1002911598100104 0000000000000000 B3E35A5EE53E7B8D
|
||||
1002911598190104 0000000000000000 61C79C71921A2EF8
|
||||
1002911598100201 0000000000000000 E2F5728F0995013C
|
||||
1002911698100101 0000000000000000 1AEAC39A61F0A464
|
||||
7CA110454A1A6E57 01A1D6D039776742 690F5B0D9A26939B
|
||||
0131D9619DC1376E 5CD54CA83DEF57DA 7A389D10354BD271
|
||||
07A1133E4A0B2686 0248D43806F67172 868EBB51CAB4599A
|
||||
3849674C2602319E 51454B582DDF440A 7178876E01F19B2A
|
||||
04B915BA43FEB5B6 42FD443059577FA2 AF37FB421F8C4095
|
||||
0113B970FD34F2CE 059B5E0851CF143A 86A560F10EC6D85B
|
||||
0170F175468FB5E6 0756D8E0774761D2 0CD3DA020021DC09
|
||||
43297FAD38E373FE 762514B829BF486A EA676B2CB7DB2B7A
|
||||
07A7137045DA2A16 3BDD119049372802 DFD64A815CAF1A0F
|
||||
04689104C2FD3B2F 26955F6835AF609A 5C513C9C4886C088
|
||||
37D06BB516CB7546 164D5E404F275232 0A2AEEAE3FF4AB77
|
||||
1F08260D1AC2465E 6B056E18759F5CCA EF1BF03E5DFA575A
|
||||
584023641ABA6176 004BD6EF09176062 88BF0DB6D70DEE56
|
||||
025816164629B007 480D39006EE762F2 A1F9915541020B56
|
||||
49793EBC79B3258F 437540C8698F3CFA 6FBF1CAFCFFD0556
|
||||
4FB05E1515AB73A7 072D43A077075292 2F22E49BAB7CA1AC
|
||||
49E95D6D4CA229BF 02FE55778117F12A 5A6B612CC26CCE4A
|
||||
018310DC409B26D6 1D9D5C5018F728C2 5F4C038ED12B2E41
|
||||
1C587F1C13924FEF 305532286D6F295A 63FAC0D034D9F793
|
||||
@ -1 +0,0 @@
|
||||
30818702818100DA9A18547FF03B385CC16508C173A7EF4EB61CB40EF8FEF3B31F145051676166BCDC3FE6B799FC394D08C26385F9413F896E09117E46209D6923602683CEA100924A6EE695281775C619DAA94EA8CB3691B4275B0183F1D39639EBC92995FE645D6C1BC28D409E585549BBD2C5DCDD6C208B04EADD8B7A6D997F72CBAD88390F020102
|
||||
@ -1 +0,0 @@
|
||||
308201080282010100EB60DBD494AAFBCD2EAC6A36DB8E7DD4A2A64512A5BBB15B9BFB581C7C1CAFB647D4612973C3770C2166D75EEA695F67EA8261557591DB78BCF5A886AA5294F3AEE4D25B57C8EE8C7FE8DBF70C132CD7FFCB6F89426F807F552C5DAE2FB1F329E340094E4B30D8EF6265AB4D350E9837B151C86AC524DE4E1FC04746C668BE318275E420D51AEDDFBDF887D435CDEEF6AC81293DB45287132F8236A43AD8F4D6642D7CA6732DA06A1DE008259008C9D74403B68ADAC788CF8AB5BEFFC310DCCCD32901D1F290E5B7A993D2CF6A652AF81B6DA0FD2E70678D1AE086150E41444522F20621195AD2A1F0975652B4AF7DE5261A9FD46B9EA8B443641F3BBA695B9B020103
|
||||
@ -1 +0,0 @@
|
||||
308201370201003082011706072A8648CE3804013082010A02818100D4EC6B7A18416519C76766726B3D2D5F054D107B30E97691B15EB0DCDF452B77F10E12C14450AB107BE349C2DF3A2DBD9D844A24ABA21B328D568E8EC6B959E70BADE5C49879AE4447F643360523469B55AFDC459B45634F657AA79918772F2BA9508ACD43C95C16650A1251B8173EBA1B9B59FE8C57F6240EA49A4FE8855CEF0281806A7635BD0C20B28CE3B3B339359E96AF82A6883D9874BB48D8AF586E6FA295BBF8870960A22855883DF1A4E16F9D16DECEC2251255D10D9946AB4747635CACF385D6F2E24C3CD72223FB219B0291A34DAAD7EE22CDA2B1A7B2BD53CC8C3B9795D4A84566A1E4AE0B32850928DC0B9F5D0DCDACFF462BFB1207524D27F442AE77020102041702150C9C14EEFA749DCE9A2A4B7065768767BA48BBB62F
|
||||
@ -1 +0,0 @@
|
||||
308202410201003082021906072A8648CE3804013082020C0282010100A8E87254E7F56CB5857786364ACC39F2A0F79FFF8ED6C62C64EE45FC1C775CDDBFD9CBCEF8262DBD2CECE4E5AFECA239B9B4B7D3CBA228366500F5B2203CA6C0CB0AB6698F73921B4831BA598DFA8268A07368A64774C77808AB7CB7978F839304B10567F8C9C34F8DBDB66BB928EDE6327773AA6C20A8F4E9C2AE0C66A0516E057BBC87760CF39270726F1863260CD5ADDAF366318E7029851A6F85B2349DF29629319A3662354DBCAD0789D02AC6BD804C06523900166501041963BD7EFFE0069694A54F4542172A29B1F09D26E3F052AE5274A898058BE549650BC2066DDFDB84D582E6503AF42BCB2B674F2A2A77C54678FD622FFCA2D9718BF8B0525AEF028201005474392A73FAB65AC2BBC31B25661CF9507BCFFFC76B6316327722FE0E3BAE6EDFECE5E77C1316DE96767272D7F6511CDCDA5BE9E5D1141B32807AD9101E536065855B34C7B9C90DA418DD2CC6FD41345039B45323BA63BC0455BE5BCBC7C1C9825882B3FC64E1A7C6DEDB35DC9476F3193BB9D53610547A74E15706335028B702BDDE43BB0679C93839378C3193066AD6ED79B318C73814C28D37C2D91A4EF94B1498CD1B311AA6DE5683C4E815635EC02603291C800B3280820CB1DEBF7FF0034B4A52A7A2A10B9514D8F84E9371F82957293A544C02C5F2A4B285E10336EFEDC26AC173281D7A15E595B3A795153BE2A33C7EB117FE516CB8C5FC58292D77020102041F021D031D7EC405D3E11D031B7B66DF9EFFCC5173B9B1639E4EC920731484EE
|
||||
@ -1 +0,0 @@
|
||||
3082014A0201003082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0416021426EBA66E846E755169F84A1DA981D86502405DDF
|
||||
@ -1 +0,0 @@
|
||||
308201B73082012B06072A8648CE3804013082011E02818100F468699A6F6EBCC0120D3B34C8E007F125EC7D81F763B8D0F33869AE3BD6B9F2ECCC7DF34DF84C0307449E9B85D30D57194BCCEB310F48141914DD13A077AAF9B624A6CBE666BBA1D7EBEA95B5BA6F54417FD5D4E4220C601E071D316A24EA814E8B0122DBF47EE8AEEFD319EBB01DD95683F10DBB4FEB023F8262A07EAEB7FD02150082AD4E034DA6EEACDFDAE68C36F2BAD614F9E53B02818071AAF73361A26081529F7D84078ADAFCA48E031DB54AD57FB1A833ADBD8672328AABAA0C756247998D7A5B10DACA359D231332CE8120B483A784FE07D46EEBFF0D7D374A10691F78653E6DC29E27CCB1B174923960DFE5B959B919B2C3816C19251832AFD8E35D810E598F82877ABF7D40A041565168BD7F0E21E3FE2A8D8C1C0381850002818100D30312B7179661DA4691EDE39A71CB961199CD792C50AED6EA7E1A24C53590B6BCD92F26509D3372B2849A17C99C0962FBE4A2606CA37E6DF10244805363450FFAA24A7C274DF0B5D24AE7F31A8319FD2AA6E98AC6E7E3364E7AEDE575A9993609B0DFA387084141EA0B5B2D59B6DE718C0DAB4F86BC59F0DBE8602AED933494
|
||||
@ -1 +0,0 @@
|
||||
3081C60201003081A806072A8648CE38040130819C0241008DF2A494492276AA3D25759BB06869CBEAC0D83AFB8D0CF7CBB8324F0D7882E5D0762FC5B7210EAFC2E9ADAC32AB7AAC49693DFBF83724C2EC0736EE31C80291021500C773218C737EC8EE993B4F2DED30F48EDACE915F0240626D027839EA0A13413163A55B4CB500299D5522956CEFCB3BFF10F399CE2C2E71CB9DE5FA24BABF58E5B79521925C9CC42E9F6F464B088CC572AF53E6D78802041602142070B3223DBA372FDE1C0FFC7B2E3B498B260614
|
||||
@ -1 +0,0 @@
|
||||
3082018E028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BCABCBA4E458812DB601FCD04609D435317181236B9702010202818038FBC56751763146BC107ECC59E9BAD3852EBC38799B41B40EF5745810BCF9DCC6D569B7E61063EA358B0DF2A194910029B72A9CFD11AD240681D3F976EDCB18D79C0530AB2944DC1E314C2B520BE23066C802754C19BF2EC15DE0439E2663383CEA5163DC857B6A5F91079F54FB47C9B33F23A9EB6B3FCBA8581524B3EC5C75028181008B333697371663F8869E3EC80A414E46BBAFE41F6D40E754A01ADA60FE7D12ACD16DE311C4115293114F6B92A54195909276380F04BCD4ED5CD993ED7F516DF7A752B928E5035E0D3A1A979A1CDE8387734338793C02001D59B662D4FC8F2BF0EABB1F553F9F46F57E74BC7F3EC6725F2FC0A6155ADCA43CEE7319E623824852
|
||||
@ -1 +0,0 @@
|
||||
3081E00281807040653BA4FCD5C66E3318B31E82654C5A62957F68D2EE6AE10BD6678D7A14EEF8EBF0C85F28FE22056C12B2A2DD4E9C897EB2FF06D57DB03B872C049ED2806DC3E4D86F2947D134065AC642F233F95FBCB55C533274FA91FFDC0CEB9E71B8795B71A977C7956001FC19E28DE18A80B20E4AE8F775B952CEEA0DEFEAE8E93D7F020120022B1EC74E9FC5EEA090E8DDF4BDB64861C7DC3F8EC7E64286EC2FE39DA55B4763C582DB48146521BDEF0146D5022B1E559EB15755298408E4E4C6F4791BF075C7A8C9B3C7F5B7FA3E8C322BA0A160C09A9DB6BBC4974BE0F877
|
||||
@ -1 +0,0 @@
|
||||
3082014D0281C100E2A6788AB3CC986AEC06C51690143D3677141645D0628165EE924B9AFB7E6EDD52D90145B2F6031522C7A6CEC05E358F42B7837DACEA589F868F8DCA1C0F5FD8E5EDB8BBBAFCFF6D64CFCFBE68F46FBA6EFF45BC9D0CBB4F7F6075F5FFC2049C2F304B51C417764E18D182926E02D4116CE5C5C010E3D0AA6872A49B0D1FF4B37D54689C31F5821D04E9D4DB34D7536EE7F88B8C481B0EC1F93193A0B70567E6FD76E9FAC4F67BB47DACD356D0C8015261E068DDF8C34C0CAFCF3FA775577FEB020120024100FAF0F292EE96D4F449024F86C0A104E0633C722586EC00AD33E0234629825D2081BA337597889CAC55DC6BEBDD8F13FE3AA2133D6371601A37D195DA7BC45EF3024100EBE16F88887A425AA08E271467CC2220DC44012AB24ED4FF3512A96E8CB600C8BBCB771459FF0EE63D4B6786952A83A7143A775073F0A1D69B6D0B5817755673
|
||||
@ -1 +0,0 @@
|
||||
308201B70282010028B1F9CDF87EF6D74F3AC2EA83C17CE376215FB2B3B4817145F1A137FB86B0F7BF0F9BA1BDCF7CC15DF1884DD1B150A983279B90F7A1E4392CB3C16390771DA5668E68621C3898DF66BD254F3787ECFB64B3435E707D5C237A6C09F407D8CD618CC3BBFBAB3DEBA38A0D1A88B2A4E09AE32FF2064EF1896348D5B83047EC2E079D85662EED4A66FBB9C159A617EE3C333BAED66989740F54C3CB336C0EF71130786E70648F2698F4F4192DA06C1578FDB065F8E320EFB63049E4BA664F215924B3E89F69131C5987F357C54593BE173A7AED2D37BE69F90CB574EF83AD49145EB15950FADE9E848DA83BC2CACBEDCAFC4A3B31BFFBBFC4DD03B8E47A218A51410201200256033F9C3F8BDDC021503A687BEC90438F38FF9C0E4C050DD95E46BACA370F478B843611A94BC37B5E838AABFD4ECCCE757BAC967DF8A7DD219B3A71A4DA64D54AB367622B7EB9B4282E898755F02036E91D2A12C81F41025603DB3DE2AE2B52889148C98D68F2B7606B0E5112E60E6A6FF5FD98E5D74143C000B43BEC77082F17C1EF4C82127010B12438D498AAFE8521E21EE6391627D464B54D1BE31F57FFF18C27EC38F08093EA65139A61A2C1
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user