mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-06-25 23:58:31 +08:00
Compare commits
338 Commits
v9.4.0.40
...
fix/rtf-bu
| Author | SHA1 | Date | |
|---|---|---|---|
| da34674edc | |||
| 377d66307e | |||
| e6c9415a26 | |||
| cb3daf1b6a | |||
| 29bb590151 | |||
| 7fe4efbb54 | |||
| f7e17d0080 | |||
| ea7f362d99 | |||
| de49ae5f32 | |||
| b607249544 | |||
| bd62388d81 | |||
| c0cad5429e | |||
| e353ff1b96 | |||
| 5f6075ca33 | |||
| 40bd21caac | |||
| f1ab3e4bf7 | |||
| 55e5f973b0 | |||
| 78ed5b3d74 | |||
| ba0e0f7449 | |||
| ba992cc401 | |||
| fba14fcf7b | |||
| aa43506bf9 | |||
| 544b0c54bc | |||
| a2c24b8dc0 | |||
| 073f100fe0 | |||
| e30a6acc87 | |||
| a016fc2868 | |||
| b77b3dc7e2 | |||
| c0a9c1a1dc | |||
| 4a15aaab0d | |||
| a982ff0ce2 | |||
| 30f21fc3c7 | |||
| b2c2a0ec6c | |||
| 77ef943473 | |||
| 67ae9115c9 | |||
| 5d862891ca | |||
| be921d6be7 | |||
| 6a7aedaeb2 | |||
| 67733c1733 | |||
| 76ee07f61c | |||
| ff32068a97 | |||
| a1ce3b53c2 | |||
| df08ed4614 | |||
| 812c59beaa | |||
| 97900e0c6e | |||
| bee1e30e12 | |||
| 2da2866862 | |||
| ac06652662 | |||
| 075052dd3f | |||
| 4207d697fa | |||
| c5b798b8a9 | |||
| 8a4e115384 | |||
| f4b2184985 | |||
| 175028396e | |||
| 35ba9d7445 | |||
| 67d31207e5 | |||
| 75e095abb9 | |||
| 6a6c85b6bd | |||
| d8133b7cb2 | |||
| 0e40482b9f | |||
| 742dfb54b8 | |||
| 52b21fbaed | |||
| aef42511ad | |||
| 692eb8c878 | |||
| 11c9900a5e | |||
| 7f16ac66f0 | |||
| a94d46ee06 | |||
| 2dd929dc95 | |||
| 1cfce0fe84 | |||
| 1fc363c189 | |||
| 3a0c438b9c | |||
| a5f4e04550 | |||
| 25b30b3a73 | |||
| 8c2c4060a7 | |||
| e0141264a7 | |||
| f2bf914e72 | |||
| 62a25fa847 | |||
| f5a0278d4b | |||
| bc9e8637ef | |||
| 7ac9645010 | |||
| 4250382f87 | |||
| 4eca22efde | |||
| f531e480ff | |||
| 9db2d2f328 | |||
| a868451b5d | |||
| cb217be2a2 | |||
| 6ccf19e036 | |||
| 2582927c72 | |||
| 764a8e4cd9 | |||
| 3fe3382c1e | |||
| b139dec538 | |||
| 0b12c5b521 | |||
| 4c0c47a3cf | |||
| 234f867837 | |||
| 6366306f9c | |||
| 75f97349ca | |||
| 9ef4de7010 | |||
| 6a45740f98 | |||
| dfe6d300d8 | |||
| cce7058d46 | |||
| 71a8a22d2e | |||
| 5bf72dcfb6 | |||
| 7c7ebd5f2a | |||
| 7890f5b87f | |||
| f6decd4754 | |||
| f4a0f3f01a | |||
| 69a066fac9 | |||
| 1a94960abf | |||
| 50816132e9 | |||
| 00bee83d0e | |||
| 37d83faffd | |||
| 8e596451a9 | |||
| 8364bc02a6 | |||
| 5b15d9b77b | |||
| c5a040c807 | |||
| bb9e3a2a7e | |||
| e2c560d5ad | |||
| 815b6623a3 | |||
| 051f1d2c94 | |||
| c2000257aa | |||
| c5b2f3d1f2 | |||
| 72f7aaa6c2 | |||
| 2ed3521355 | |||
| 1c1947459d | |||
| 29b2b2e086 | |||
| 2761614b8d | |||
| 2deb6b8c42 | |||
| 13b19cc13f | |||
| 9720bd18a4 | |||
| a46e0d0a67 | |||
| 59e4d02f01 | |||
| 99b31a46f7 | |||
| 5a0bc5a19d | |||
| 38bbe37f40 | |||
| eb4c5cfc2a | |||
| 6262048e75 | |||
| 7877f542b3 | |||
| f00581fd1d | |||
| bd3dd15a4f | |||
| a796e92fe1 | |||
| 9ddd969b01 | |||
| 828eee5ed5 | |||
| a95d8712d3 | |||
| 3f76fca0f7 | |||
| 1c9ce65ba9 | |||
| 09b1d56a9a | |||
| 3d7381dc68 | |||
| e33e3d6b42 | |||
| c03fd25b6d | |||
| bc59e34153 | |||
| 9679c6e7f8 | |||
| 2ffc0a7844 | |||
| c7c98d3f69 | |||
| d9d7ffef26 | |||
| c7e7fd4aa1 | |||
| 1846056b74 | |||
| 378841d655 | |||
| facd131d7b | |||
| f39716a5da | |||
| d1fada2542 | |||
| 16929b3a54 | |||
| a2f52951b2 | |||
| b0efeafd27 | |||
| f3d34b1363 | |||
| 07e563afe8 | |||
| 75b3665ad5 | |||
| bdbad87830 | |||
| 290e4a0884 | |||
| 0242c5885b | |||
| 8a3a922dba | |||
| b78bcb10dc | |||
| 1c13c80197 | |||
| 653ff24c0e | |||
| a62f97627b | |||
| ddd991601c | |||
| 8d2331b097 | |||
| 57c26eb998 | |||
| 2c35b5f422 | |||
| 61fca43920 | |||
| 2cceef7386 | |||
| ab76f46fd4 | |||
| 2dd2f3bcc6 | |||
| 612c26cf6c | |||
| 2873418d74 | |||
| 77346270a4 | |||
| 5f005b4501 | |||
| 5f39acbe51 | |||
| 6badba384c | |||
| 0830ed031e | |||
| e63d62bb04 | |||
| 90029fb2f3 | |||
| c96df4e62e | |||
| 37f8c52e43 | |||
| d4e1b31e10 | |||
| 1580494bdb | |||
| f4fc487ce3 | |||
| a5bfa94770 | |||
| 85a615cc9a | |||
| 91701ed58d | |||
| be200af7d9 | |||
| 279349323f | |||
| 1dae175272 | |||
| 7c6f9f2ad6 | |||
| efc9bab6ed | |||
| 73b32984e2 | |||
| 19758d579d | |||
| f269db67bb | |||
| 2fd10fc33f | |||
| 685b2bb9e0 | |||
| 55fe2e968f | |||
| d90c3aa3ac | |||
| 47fed9cb63 | |||
| e3e247e835 | |||
| bd245cd62a | |||
| 87c3f9beff | |||
| 9b196ada1f | |||
| 10b2b0d3d0 | |||
| cd58508d0f | |||
| d41aef7ec6 | |||
| bdc22190bd | |||
| 9989510d60 | |||
| 2f1a76fba6 | |||
| 0693bdc115 | |||
| ffb528636f | |||
| abc4619924 | |||
| fe36b3e1e6 | |||
| e72a4f8e8c | |||
| 0b2babbefc | |||
| 32da1a4901 | |||
| 15f423dbb9 | |||
| b5c29e49e2 | |||
| 9a4f929510 | |||
| 206ee9c976 | |||
| 7a8669d7f8 | |||
| ea28ff69a9 | |||
| 88626378a7 | |||
| 261cf72685 | |||
| 219bf06855 | |||
| 23e736051f | |||
| 8870516a8a | |||
| dbe56878b1 | |||
| 1f9ee8628e | |||
| 84aa409b1e | |||
| 6df60b9b4e | |||
| 52096d1b0b | |||
| 8fa5f8944e | |||
| 27dc6403d7 | |||
| ecaef0fbed | |||
| 2addc5a3d8 | |||
| 4e1afe5c55 | |||
| 9ae5855ed0 | |||
| 8d4e216852 | |||
| 866bf08da3 | |||
| 9e1bb2cd22 | |||
| bb97d00ae7 | |||
| 66eaed4f18 | |||
| 4739b9f9dd | |||
| e8f1691348 | |||
| 0b42267c43 | |||
| 6f1bfc3064 | |||
| f57f573ac4 | |||
| 0579b93796 | |||
| 2074785963 | |||
| ed697edba2 | |||
| 686c72a1c8 | |||
| 41124d3301 | |||
| 95d6c6c927 | |||
| 9ae76b07a1 | |||
| 0d7e535114 | |||
| b18715ae81 | |||
| e0af1357e5 | |||
| d4f80ea036 | |||
| 8e90fbac69 | |||
| 322fda0e07 | |||
| b0d70ff38a | |||
| 2a409336a3 | |||
| 4cdc416e0b | |||
| 7046f1d465 | |||
| 61f25af847 | |||
| 9304d10674 | |||
| 278dffc7c7 | |||
| bd7aa2df96 | |||
| 3d4dc3116e | |||
| f2fdcf4efd | |||
| ae7dbf291f | |||
| e83dbf57af | |||
| 3aa729d65b | |||
| 3bb03cb735 | |||
| cb0176ecca | |||
| b75afead99 | |||
| 290a134cdb | |||
| 6d9a2e0d09 | |||
| 32c4964cca | |||
| c2dd7b5108 | |||
| c057c8eb24 | |||
| 11000aa465 | |||
| 6630a882ed | |||
| e20143fa2e | |||
| e40603df61 | |||
| 6d0db29975 | |||
| 3fe2ed032d | |||
| a43af51577 | |||
| cf0f2be204 | |||
| 44e3e77631 | |||
| e4df8df318 | |||
| eca98f612c | |||
| c5f1a08422 | |||
| 7043b36093 | |||
| e429ff685f | |||
| 03334267c9 | |||
| 417c3a55ec | |||
| 90eb06ac20 | |||
| 031c1c91e6 | |||
| 8a8e17562b | |||
| 9f36c04d33 | |||
| 7dffc8245a | |||
| 869774bcc1 | |||
| 27103958fe | |||
| 95c9c95a2e | |||
| 1753007900 | |||
| f43230dcaf | |||
| bb7d2ce8ee | |||
| ed8a47cbb7 | |||
| 3b2721e2da | |||
| 19c66750a8 | |||
| 4b61f6e62a | |||
| 72b57be353 | |||
| ef295fc115 | |||
| a62528e90e | |||
| 644ec4e651 | |||
| 6ca34d9c69 | |||
| 473f6aef1e | |||
| 85027065e6 | |||
| f66c646c2c | |||
| a40e246d7d | |||
| 66d36b64b0 | |||
| 954f3c91bb | |||
| 18d36179bd |
@ -1,3 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "IWork.h"
|
||||
#include "../DesktopEditor/common/File.h"
|
||||
#include "../DesktopEditor/common/Directory.h"
|
||||
@ -53,7 +88,7 @@ bool GetRVNGInputStream(const DATA_TYPE_INPUTFILE& sFile, std::shared_ptr<librev
|
||||
|
||||
IWorkFileType CIWorkFile::GetType(const std::wstring& sFile) const
|
||||
{
|
||||
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
|
||||
//TODO:: since currently we work directly with file only, directory handling is not needed yet
|
||||
if (NSDirectory::PathIsDirectory(sFile))
|
||||
return IWorkFileType::None;
|
||||
|
||||
@ -107,7 +142,7 @@ int Convert(const std::wstring& wsOutputFile, std::shared_ptr<librevenge::RVNGIn
|
||||
|
||||
int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutputFile) const
|
||||
{
|
||||
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
|
||||
//TODO:: since currently we work directly with file only, directory handling is not needed yet
|
||||
if (NSDirectory::PathIsDirectory(sFile))
|
||||
return -1;
|
||||
|
||||
|
||||
@ -1,3 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _IWORKFILE_IWORKFILE_H
|
||||
#define _IWORKFILE_IWORKFILE_H
|
||||
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
QT -= core
|
||||
QT -= gui
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "../IWork.h"
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
CONFIG -= qt
|
||||
QT -= core gui
|
||||
|
||||
|
||||
36
Common/3dParty/boost/patches/mpl_integral_wrapper.patch
Normal file
36
Common/3dParty/boost/patches/mpl_integral_wrapper.patch
Normal file
@ -0,0 +1,36 @@
|
||||
<<<<<<<
|
||||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
|
||||
private:
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
|
||||
public:
|
||||
typedef AUX_WRAPPER_INST(next_value) next;
|
||||
typedef AUX_WRAPPER_INST(prior_value) prior;
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|
||||
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
|
||||
#else
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
|
||||
#endif
|
||||
=======
|
||||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \
|
||||
|| defined(__clang__)
|
||||
private:
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
|
||||
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
|
||||
public:
|
||||
typedef AUX_WRAPPER_INST(next_value) next;
|
||||
typedef AUX_WRAPPER_INST(prior_value) prior;
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|
||||
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
|
||||
#else
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
|
||||
#endif
|
||||
>>>>>>>
|
||||
@ -525,6 +525,7 @@ namespace NSCSS
|
||||
m_mDefaultStyleData[L"ul"] = new CElement(L"ul", {{L"margin-top", L"100tw"},
|
||||
{L"margin-bottom", L"100tw"}});
|
||||
m_mDefaultStyleData[L"textarea"] = new CElement(L"textarea", {{L"border", L"1px solid black"}});
|
||||
m_mDefaultStyleData[L"th"] = new CElement(L"b", {{L"font-weight", L"bold"}});
|
||||
}
|
||||
|
||||
CCssCalculator_Private::CCssCalculator_Private()
|
||||
@ -618,7 +619,7 @@ namespace NSCSS
|
||||
if (!arSelectors[i].m_wsStyle.empty())
|
||||
arSelectors[i].m_pCompiledStyle->AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
|
||||
|
||||
// Скидываем некоторые внешние стили, которые внутри таблицы переопределяются
|
||||
// Reset some external styles that are overridden inside the table
|
||||
if (bInTable && i < arSelectors.size() - 1)
|
||||
{
|
||||
arSelectors[i].m_pCompiledStyle->m_oFont.GetLineHeight().Clear();
|
||||
@ -637,7 +638,7 @@ namespace NSCSS
|
||||
|
||||
void CCssCalculator_Private::SetPageData(NSProperties::CPage &oPage, const std::map<std::wstring, std::wstring> &mData, unsigned int unLevel, bool bHardMode)
|
||||
{
|
||||
//TODO:: пересмотреть данный метод
|
||||
//TODO:: review this method
|
||||
m_oStyleStorage.SetPageData(oPage, mData, unLevel, bHardMode);
|
||||
}
|
||||
|
||||
|
||||
@ -13,12 +13,12 @@ namespace NSCSS
|
||||
class CNode
|
||||
{
|
||||
public:
|
||||
std::wstring m_wsName; // Имя тэга
|
||||
std::wstring m_wsClass; // Класс тэга
|
||||
std::wstring m_wsId; // Id тэга
|
||||
std::wstring m_wsStyle; // Стиль тэга
|
||||
std::map<std::wstring, std::wstring> m_mAttributes; // Остальные аттрибуты тэга
|
||||
//TODO:: возможно использование std::wstring излишне
|
||||
std::wstring m_wsName; // Tag name
|
||||
std::wstring m_wsClass; // Tag class
|
||||
std::wstring m_wsId; // Tag id
|
||||
std::wstring m_wsStyle; // Tag style
|
||||
std::map<std::wstring, std::wstring> m_mAttributes; // Other tag attributes
|
||||
//TODO:: perhaps using std::wstring is excessive
|
||||
|
||||
#ifdef CSS_CALCULATOR_WITH_XHTML
|
||||
CCompiledStyle *m_pCompiledStyle;
|
||||
|
||||
@ -23,7 +23,7 @@ namespace NSCSS
|
||||
case NSCSS::Inch:
|
||||
return dValue / (double)ushDPI;
|
||||
case NSCSS::Peak:
|
||||
return dValue * 6. / (double)ushDPI; // 1 дюйм = 6 пик
|
||||
return dValue * 6. / (double)ushDPI; // 1 inch = 6 peak
|
||||
case NSCSS::Twips:
|
||||
return dValue * 1440. / (double)ushDPI;
|
||||
default:
|
||||
@ -36,17 +36,17 @@ namespace NSCSS
|
||||
switch (enUnitMeasure)
|
||||
{
|
||||
case NSCSS::Point:
|
||||
return dValue * 28.3465 ; // 1 см = (2.54 / 72) пункта
|
||||
return dValue * 28.3465 ; // 1 cm = (2.54 / 72) points
|
||||
case NSCSS::Pixel:
|
||||
return dValue * (double)ushDPI / 2.54;
|
||||
case NSCSS::Millimeter:
|
||||
return dValue * 10.;
|
||||
case NSCSS::Inch:
|
||||
return dValue / 2.54; // 1 дюйм = 2.54 см
|
||||
return dValue / 2.54; // 1 inch = 2.54 cm
|
||||
case NSCSS::Peak:
|
||||
return dValue * 2.36; // 2.36 = 6 / 2.54
|
||||
case NSCSS::Twips:
|
||||
return dValue * 567.; // 1 см = (1440 / 2.54) твипов
|
||||
return dValue * 567.; // 1 cm = (1440 / 2.54) twips
|
||||
default:
|
||||
return dValue;
|
||||
}
|
||||
@ -57,7 +57,7 @@ namespace NSCSS
|
||||
switch (enUnitMeasure)
|
||||
{
|
||||
case NSCSS::Point:
|
||||
return dValue * 2.8346; // 1 мм = (25.4 / 72) пункта
|
||||
return dValue * 2.8346; // 1 mm = (25.4 / 72) points
|
||||
case NSCSS::Pixel:
|
||||
return dValue * (double)ushDPI / 25.4;
|
||||
case NSCSS::Cantimeter:
|
||||
@ -82,7 +82,7 @@ namespace NSCSS
|
||||
case NSCSS::Pixel:
|
||||
return dValue * (double)ushDPI;
|
||||
case NSCSS::Cantimeter:
|
||||
return dValue * 2.54; // 1 дюйм = 2.54 см
|
||||
return dValue * 2.54; // 1 inch = 2.54 cm
|
||||
case NSCSS::Millimeter:
|
||||
return dValue * 25.4;
|
||||
case NSCSS::Peak:
|
||||
@ -105,9 +105,9 @@ namespace NSCSS
|
||||
case NSCSS::Millimeter:
|
||||
return dValue * 0.3528;
|
||||
case NSCSS::Inch:
|
||||
return dValue / 72.; // 1 дюйм = 72 пункта
|
||||
return dValue / 72.; // 1 inch = 72 points
|
||||
case NSCSS::Peak:
|
||||
return dValue * 0.0833; // 0.0833 = 6 / 72 (1 пункт = 1/72 дюйма)
|
||||
return dValue * 0.0833; // 0.0833 = 6 / 72 (1 point = 1/72 inch)
|
||||
case NSCSS::Twips:
|
||||
return dValue * 20.; // 20 = 1440 / 72
|
||||
default:
|
||||
@ -122,7 +122,7 @@ namespace NSCSS
|
||||
case NSCSS::Point:
|
||||
return dValue * 12.; // 12 = 72 / 6
|
||||
case NSCSS::Pixel:
|
||||
return dValue * (double)ushDPI / 6.; // 1 дюйм = 6 пика
|
||||
return dValue * (double)ushDPI / 6.; // 1 inch = 6 peak
|
||||
case NSCSS::Cantimeter:
|
||||
return dValue * 0.423; // 0.423 = 2.54 / 6
|
||||
case NSCSS::Millimeter:
|
||||
@ -143,7 +143,7 @@ namespace NSCSS
|
||||
case NSCSS::Point:
|
||||
return dValue * 0.05; // 0.05 = 72. / 1440.
|
||||
case NSCSS::Pixel:
|
||||
return dValue * (double)ushDPI / 1440.; // 1 дюйм = 1440 твипов
|
||||
return dValue * (double)ushDPI / 1440.; // 1 inch = 1440 twips
|
||||
case NSCSS::Cantimeter:
|
||||
return dValue * 0.001764; // 0.001764 = 2.54 / 1440
|
||||
case NSCSS::Millimeter:
|
||||
|
||||
@ -16,14 +16,14 @@ namespace NS_STATIC_FUNCTIONS
|
||||
std::string GetContentAsUTF8(const std::wstring& sFileName)
|
||||
{
|
||||
std::string sContent;
|
||||
// читаем файл как есть. utf-8 тут просто название.
|
||||
// read file as-is. utf-8 here is just a name.
|
||||
if(!NSFile::CFileBinary::ReadAllTextUtf8A(sFileName, sContent))
|
||||
return sContent;
|
||||
|
||||
std::string sEncoding;
|
||||
if (true)
|
||||
{
|
||||
// определяем кодировку
|
||||
//determining the encoding
|
||||
const std::string::size_type& posCharset = sContent.find("@charset");
|
||||
|
||||
if (std::string::npos != posCharset)
|
||||
|
||||
@ -392,8 +392,8 @@ namespace NSCSS
|
||||
|
||||
std::wstring wsNewValue = wsValue;
|
||||
|
||||
const bool bImportant{CutImportant(wsNewValue)}; //TODO:: иногда мы знаем, что "!important" точно не встретится
|
||||
// возможно стоит добавить ещё метод
|
||||
const bool bImportant{CutImportant(wsNewValue)};
|
||||
|
||||
if (m_bImportant && !bImportant)
|
||||
return false;
|
||||
|
||||
@ -1068,7 +1068,7 @@ namespace NSCSS
|
||||
}
|
||||
case TransformRotate:
|
||||
{
|
||||
//TODO:: добавить реализацию
|
||||
//TODO:: add implementation
|
||||
wsValue = L"rotate(";
|
||||
break;
|
||||
}
|
||||
@ -2547,7 +2547,7 @@ namespace NSCSS
|
||||
|
||||
bool CFont::SetValue(const std::wstring &wsValue, unsigned int unLevel, bool bHardMode)
|
||||
{
|
||||
//TODO:: скорее всего стоит переделать парсинг строки со шрифтом
|
||||
//TODO:: probably should redo font string parsing
|
||||
const std::vector<std::wstring> arValues = NSCSS::NS_STATIC_FUNCTIONS::GetWordsW(wsValue, false, L" ,/");
|
||||
|
||||
unsigned short ushPosition = 0;
|
||||
|
||||
@ -118,6 +118,11 @@ namespace NSCSS
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool LessSignificantThen(const CValueBase& oValue) const
|
||||
{
|
||||
return oValue.m_unLevel >= m_unLevel && (!m_bImportant || oValue.m_bImportant) && !oValue.Empty();
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@ -859,7 +864,7 @@ namespace NSCSS
|
||||
CDigit m_oSize;
|
||||
CDigit m_oLineHeight;
|
||||
CString m_oFamily;
|
||||
//TODO:: возможно стоит перейти в слудующих переменных на enum
|
||||
//TODO:: perhaps should switch to enum for the following variables
|
||||
CString m_oStretch;
|
||||
CString m_oStyle;
|
||||
CString m_oVariant;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#include "CDocumentStyle.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_set>
|
||||
#include <wchar.h>
|
||||
#include <math.h>
|
||||
@ -9,7 +8,7 @@
|
||||
#include <list>
|
||||
|
||||
#define DEFAULT_LINEHEIGHT 240
|
||||
#define LINEHEIGHTSCALE 10 // Значение LineHeight в OOXML должно быть в 10 раз больше чем указано в стиле
|
||||
#define LINEHEIGHTSCALE 10 // LineHeight value in OOXML must be 10 times larger than specified in style
|
||||
|
||||
#define VALUE_TO_INT(value, unit_measure) \
|
||||
(NSCSS::UnitMeasure::None != value.GetUnitMeasure()) ? \
|
||||
@ -454,7 +453,7 @@ namespace NSCSS
|
||||
int nWidth = static_cast<int>(std::round(oBorder.GetWidth().ToDouble(Point) * 8.));
|
||||
|
||||
if (L"double" == wsStyle)
|
||||
nWidth /= 3; // в ooxml double граница формируется из трёх линий
|
||||
nWidth /= 3; // in ooxml double border is formed from three lines
|
||||
|
||||
if (nWidth <= 3)
|
||||
nWidth = 2;
|
||||
@ -497,7 +496,7 @@ namespace NSCSS
|
||||
return bResult;
|
||||
|
||||
if (!oStyle.m_oFont.GetSize().Empty())
|
||||
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Значения шрифта увеличивает на 2
|
||||
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Font value is multiplied by 2
|
||||
|
||||
if (oStyle.m_oText.GetDecoration().m_oLine.Underline())
|
||||
oXmlElement.AddPropertiesInR(RProperties::R_U, (!oStyle.m_oText.GetDecoration().m_oStyle.Empty()) ? oStyle.m_oText.GetDecoration().m_oStyle.ToWString() : L"single");
|
||||
|
||||
@ -371,10 +371,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
std::cout << "-----END-----" << std::endl;
|
||||
|
||||
// Тесты багов
|
||||
// Bug tests
|
||||
/*
|
||||
// Стандарный katana_parser не считывает @page
|
||||
// Также, если заккомитить всё, что было до тестов бага, то всё будет крашиться с ошибкой "-1073741819"
|
||||
// Standard katana_parser doesn't read @page
|
||||
// Also, if you uncomment everything before bug tests, it will crash with error "-1073741819"
|
||||
|
||||
const char* css = "#page{margin:10px; padding:5pt} "
|
||||
"@page{color:white;}";
|
||||
@ -382,7 +382,7 @@ int main(int argc, char *argv[])
|
||||
katana_dump_output(output);
|
||||
katana_destroy_output(output);
|
||||
|
||||
// Из-за того, что стандарный katana_parser не считывает @page, не считывает и CCssCalculator
|
||||
// Because standard katana_parser doesn't read @page, CCssCalculator doesn't read it either
|
||||
|
||||
std::wstring sFilePath = NSFile::GetProcessDirectory() + L"../../../../cssFiles/test.css";
|
||||
NSCSS::CCssCalculator oCSS;
|
||||
|
||||
@ -233,13 +233,13 @@ static void ReadMht(const std::string& sMhtContent, std::map<std::string, std::s
|
||||
|
||||
// std::wstring sExtention = NSFile::GetFileExtention(UTF8_TO_U(sName));
|
||||
// std::transform(sExtention.begin(), sExtention.end(), sExtention.begin(), tolower);
|
||||
// Основной документ
|
||||
// Main document
|
||||
if (NSStringFinder::Equals(sContentType, "multipart/alternative"))
|
||||
oRes.WriteString(mhtTohtml(sContent));
|
||||
else if ((NSStringFinder::Find(sContentType, "text") /*&& (sExtention.empty() || NSStringFinder::EqualOf(sExtention, {L"htm", L"html", L"xhtml", L"css"}))*/)
|
||||
|| (NSStringFinder::Equals(sContentType, "application/octet-stream") && NSStringFinder::Find(sContentLocation, "css")))
|
||||
{
|
||||
// Стили заключаются в тэг <style>
|
||||
// Styles are enclosed in <style> tag
|
||||
const bool bAddTagStyle = NSStringFinder::Equals(sContentType, "text/css") /*|| NSStringFinder::Equals(sExtention, L"css")*/ || NSStringFinder::Find(sContentLocation, "css");
|
||||
|
||||
if (bAddTagStyle)
|
||||
@ -273,7 +273,7 @@ static void ReadMht(const std::string& sMhtContent, std::map<std::string, std::s
|
||||
if(bAddTagStyle)
|
||||
oRes.WriteString("</style>");
|
||||
}
|
||||
// Картинки
|
||||
// Images
|
||||
else if ((NSStringFinder::Find(sContentType, "image") /*|| NSStringFinder::Equals(sExtention, L"gif")*/ || NSStringFinder::Equals(sContentType, "application/octet-stream")) &&
|
||||
NSStringFinder::Equals(sContentEncoding, "base64"))
|
||||
{
|
||||
@ -295,7 +295,7 @@ static std::string mhtTohtml(const std::string& sFileContent)
|
||||
std::map<std::string, std::string> sRes;
|
||||
NSStringUtils::CStringBuilderA oRes;
|
||||
|
||||
// Поиск boundary
|
||||
// Search for boundary
|
||||
NSStringFinder::TFoundedData<char> oData{NSStringFinder::FindProperty(sFileContent, "boundary", {"="}, {"\\r", "\\n", "\""})};
|
||||
|
||||
size_t nFound{oData.m_unEndPosition};
|
||||
@ -318,7 +318,7 @@ static std::string mhtTohtml(const std::string& sFileContent)
|
||||
|
||||
nFound = sFileContent.find(sBoundary, nFound) + nBoundaryLength;
|
||||
|
||||
// Цикл по boundary
|
||||
// Loop through boundary
|
||||
while(nFound != std::string::npos)
|
||||
{
|
||||
nFoundEnd = sFileContent.find(sBoundary, nFound + nBoundaryLength);
|
||||
@ -369,7 +369,7 @@ static std::string mhtTohtml(const std::string& sFileContent)
|
||||
return sFile;
|
||||
}
|
||||
|
||||
// Заменяет сущности &,<,> в text
|
||||
// Replaces entities &,<,> in text
|
||||
static void substitute_xml_entities_into_text(std::string& text)
|
||||
{
|
||||
// replacing & must come first
|
||||
@ -393,7 +393,7 @@ static void remove_control_symbols(std::string& text)
|
||||
}
|
||||
}
|
||||
|
||||
// Заменяет сущности " в text
|
||||
// Replaces entity " in text
|
||||
static void substitute_xml_entities_into_attributes(std::string& text)
|
||||
{
|
||||
remove_control_symbols(text);
|
||||
@ -522,7 +522,7 @@ static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA
|
||||
remove_control_symbols(val);
|
||||
substitute_xml_entities_into_text(val);
|
||||
|
||||
// Избавление от FF
|
||||
// Remove FF
|
||||
size_t found = val.find_first_of("\014");
|
||||
while(found != std::string::npos)
|
||||
{
|
||||
@ -541,7 +541,7 @@ static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA
|
||||
}
|
||||
else if (child->type != GUMBO_NODE_COMMENT)
|
||||
{
|
||||
// Сообщение об ошибке
|
||||
// Error message
|
||||
// Does this actually exist: (child->type == GUMBO_NODE_CDATA)
|
||||
// fprintf(stderr, "unknown element of type: %d\n", child->type);
|
||||
}
|
||||
@ -600,7 +600,7 @@ static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilde
|
||||
std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert)
|
||||
{
|
||||
if (bNeedConvert)
|
||||
{ // Определение кодировки
|
||||
{ // Encoding detection
|
||||
std::string sEncoding = NSStringFinder::FindProperty(sFileContent, "charset", {"="}, {";", "\\n", "\\r", " ", "\"", "'"}).m_sValue;
|
||||
|
||||
if (sEncoding.empty())
|
||||
@ -613,18 +613,18 @@ std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert)
|
||||
}
|
||||
}
|
||||
|
||||
// Избавляемся от лишних символов до <...
|
||||
// Remove extra characters before <...
|
||||
boost::regex oRegex("<[a-zA-Z]");
|
||||
boost::match_results<typename std::string::const_iterator> oResult;
|
||||
|
||||
if (boost::regex_search(sFileContent, oResult, oRegex))
|
||||
sFileContent.erase(0, oResult.position());
|
||||
|
||||
//Избавление от <a ... />
|
||||
//Remove <a ... />
|
||||
while (NSStringFinder::RemoveEmptyTag(sFileContent, "a"));
|
||||
//Избавление от <title ... />
|
||||
//Remove <title ... />
|
||||
while (NSStringFinder::RemoveEmptyTag(sFileContent, "title"));
|
||||
//Избавление от <script ... />
|
||||
//Remove <script ... />
|
||||
while (NSStringFinder::RemoveEmptyTag(sFileContent, "script"));
|
||||
|
||||
// Gumbo
|
||||
@ -635,7 +635,7 @@ std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert)
|
||||
NSStringUtils::CStringBuilderA oBuilder;
|
||||
prettyprint(output->document, oBuilder);
|
||||
|
||||
// Конвертирование из string utf8 в wstring
|
||||
// Convert from string utf8 to wstring
|
||||
return UTF8_TO_U(oBuilder.GetData());
|
||||
}
|
||||
|
||||
@ -651,7 +651,7 @@ std::wstring mhtToXhtml(std::string& sFileContent)
|
||||
NSStringUtils::CStringBuilderA oBuilder;
|
||||
prettyprint(output->document, oBuilder);
|
||||
|
||||
// Конвертирование из string utf8 в wstring
|
||||
// Convert from string utf8 to wstring
|
||||
return UTF8_TO_U(oBuilder.GetData());
|
||||
}
|
||||
}
|
||||
|
||||
3
Common/3dParty/hunspell/.gitignore
vendored
3
Common/3dParty/hunspell/.gitignore
vendored
@ -1,5 +1,2 @@
|
||||
emsdk/
|
||||
hunspell/
|
||||
deploy/
|
||||
o
|
||||
hunspell.data
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
{
|
||||
"name": "spell",
|
||||
"res_folder": "./deploy/spell",
|
||||
"wasm": true,
|
||||
"asm": true,
|
||||
"embed_mem_file": true,
|
||||
"run_before": "before.py",
|
||||
"run_after": "import sys;sys.path.append(\"../../../../build_tools/scripts\");import base;base.configure_common_apps();base.replaceInFile(\"./deploy/spell/spell.js\", \"__ATPOSTRUN__=[];\", \"__ATPOSTRUN__=[function(){self.onEngineInit();}];\");base.replaceInFile(\"./deploy/spell/spell.js\", \"function getBinaryPromise(){\", \"function getBinaryPromise2(){\");base.replaceInFile(\"./deploy/spell/spell_ie.js\", \"__ATPOSTRUN__=[];\", \"__ATPOSTRUN__=[function(){self.onEngineInit();}];\");base.replaceInFile(\"./deploy/spell/spell_ie.js\", \"function getBinaryPromise(){\", \"function getBinaryPromise2(){\");base.copy_file(\"./wasm/js/code.js\", \"./deploy/spell.js\");base.copy_file(\"./wasm/js/index.html\", \"./deploy/index.html\")",
|
||||
"base_js_content": "./wasm/js/spell.js",
|
||||
|
||||
"compiler_flags": [
|
||||
"-O3",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
"-Wno-unused-command-line-argument",
|
||||
"-s ALLOW_MEMORY_GROWTH=1",
|
||||
"-s FILESYSTEM=0",
|
||||
"-s ENVIRONMENT='web,worker'"
|
||||
],
|
||||
"exported_functions": [
|
||||
"_malloc",
|
||||
"_free",
|
||||
"_Spellchecker_Malloc",
|
||||
"_Spellchecker_Free",
|
||||
"_Spellchecker_Create",
|
||||
"_Spellchecker_Destroy",
|
||||
"_Spellchecker_AddDictionary",
|
||||
"_Spellchecker_RemoveDicrionary",
|
||||
"_Spellchecker_Load",
|
||||
"_Spellchecker_Spell",
|
||||
"_Spellchecker_Suggest",
|
||||
"_Spellchecker_RemoveEngine",
|
||||
"_Spellchecker_TotalAllocatedMemory"
|
||||
],
|
||||
"include_path": ["./hunspell/src/hunspell", "./wasm/src"],
|
||||
"define": ["WIN32", "NDEBUG", "HUNSPELL_STATIC", "BUILDING_LIBHUNSPELL", "HUNSPELL_WASM_MODULE"],
|
||||
"compile_files_array": [
|
||||
{
|
||||
"name": "h",
|
||||
"folder": "./hunspell/src/hunspell/",
|
||||
"files": ["affentry.cxx", "affixmgr.cxx", "csutil.cxx", "hashmgr.cxx", "hunspell.cxx", "hunzip.cxx", "phonet.cxx", "replist.cxx", "suggestmgr.cxx"]
|
||||
},
|
||||
{
|
||||
"name": "s",
|
||||
"folder": "./wasm/src/",
|
||||
"files": ["filemgr_wrapper_new.cxx", "base.cpp"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "../../../../Common/3dParty/hunspell/hunspell/src/hunspell/hunspell.h"
|
||||
|
||||
@ -1,125 +0,0 @@
|
||||
function CSpellchecker(settings)
|
||||
{
|
||||
useWasm = false;
|
||||
var webAsmObj = window["WebAssembly"];
|
||||
if (typeof webAsmObj === "object")
|
||||
{
|
||||
if (typeof webAsmObj["Memory"] === "function")
|
||||
{
|
||||
if ((typeof webAsmObj["instantiateStreaming"] === "function") || (typeof webAsmObj["instantiate"] === "function"))
|
||||
useWasm = true;
|
||||
}
|
||||
}
|
||||
|
||||
var enginePath = "./spell/";
|
||||
if (settings && settings.enginePath)
|
||||
{
|
||||
enginePath = settings.enginePath;
|
||||
if (enginePath.substring(enginePath.length - 1) != "/")
|
||||
enginePath += "/";
|
||||
}
|
||||
|
||||
var dictionariesPath = "./../dictionaries";
|
||||
if (settings && settings.dictionariesPath)
|
||||
{
|
||||
dictionariesPath = settings.dictionariesPath;
|
||||
if (dictionariesPath.substring(dictionariesPath.length - 1) == "/")
|
||||
dictionariesPath = dictionariesPath.substr(0, dictionariesPath.length - 1);
|
||||
}
|
||||
|
||||
var isUseSharedWorker = !!window.SharedWorker;
|
||||
if (isUseSharedWorker && (false === settings.useShared))
|
||||
isUseSharedWorker = false;
|
||||
|
||||
var worker_src = useWasm ? "spell.js" : "spell_ie.js";
|
||||
worker_src = enginePath + worker_src;
|
||||
|
||||
var _worker = this;
|
||||
var _port = null;
|
||||
if (isUseSharedWorker)
|
||||
{
|
||||
this.worker = new SharedWorker(worker_src, "onlyoffice-spellchecker");
|
||||
_port = this.worker.port;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.worker = new Worker(worker_src);
|
||||
_port = this.worker;
|
||||
}
|
||||
|
||||
this.languages = {
|
||||
"1068" : "az_Latn_AZ",
|
||||
"1026" : "bg_BG",
|
||||
"1027" : "ca_ES",
|
||||
"2051" : "ca_ES_valencia",
|
||||
"1029" : "cs_CZ",
|
||||
"1030" : "da_DK",
|
||||
"3079" : "de_AT",
|
||||
"2055" : "de_CH",
|
||||
"1031" : "de_DE",
|
||||
"1032" : "el_GR",
|
||||
"3081" : "en_AU",
|
||||
"4105" : "en_CA",
|
||||
"2057" : "en_GB",
|
||||
"1033" : "en_US",
|
||||
"7177" : "en_ZA",
|
||||
"3082" : "es_ES",
|
||||
"1069" : "eu_ES",
|
||||
"1036" : "fr_FR",
|
||||
"1110" : "gl_ES",
|
||||
"1050" : "hr_HR",
|
||||
"1038" : "hu_HU",
|
||||
"1057" : "id_ID",
|
||||
"1040" : "it_IT",
|
||||
"1087" : "kk_KZ",
|
||||
"1042" : "ko_KR",
|
||||
"1134" : "lb_LU",
|
||||
"1063" : "lt_LT",
|
||||
"1062" : "lv_LV",
|
||||
"1104" : "mn_MN",
|
||||
"1044" : "nb_NO",
|
||||
"1043" : "nl_NL",
|
||||
"2068" : "nn_NO",
|
||||
"1045" : "pl_PL",
|
||||
"1046" : "pt_BR",
|
||||
"2070" : "pt_PT",
|
||||
"1048" : "ro_RO",
|
||||
"1049" : "ru_RU",
|
||||
"1051" : "sk_SK",
|
||||
"1060" : "sl_SI",
|
||||
"10266" : "sr_Cyrl_RS",
|
||||
"9242" : "sr_Latn_RS",
|
||||
"1053" : "sv_SE",
|
||||
"1055" : "tr_TR",
|
||||
"1058" : "uk_UA",
|
||||
"1066" : "vi_VN",
|
||||
"2067" : "nl_NL" // nl_BE
|
||||
};
|
||||
|
||||
_port.onmessage = function(message) {
|
||||
_worker.oncommand && _worker.oncommand(message.data);
|
||||
};
|
||||
_port.postMessage({ "type" : "init", "dictionaries_path" : dictionariesPath, "languages" : this.languages });
|
||||
|
||||
this.stop = function()
|
||||
{
|
||||
this.worker.terminate();
|
||||
this.worker = null;
|
||||
};
|
||||
|
||||
this.command = function(message)
|
||||
{
|
||||
_port && _port.postMessage(message);
|
||||
};
|
||||
this.oncommand = function(message) { console.log(message); };
|
||||
|
||||
this.checkDictionary = function(lang) {
|
||||
return (undefined !== this.languages["" + lang]) ? true : false;
|
||||
};
|
||||
this.getLanguages = function() {
|
||||
var ret = [];
|
||||
for (var lang in this.languages)
|
||||
ret.push(lang);
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Demo of spellchecker</title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<script src="./spell.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.spellcheck = new CSpellchecker({
|
||||
enginePath : "./spell",
|
||||
dictionariesPath : "./../dictionaries"
|
||||
});
|
||||
|
||||
window.spellcheck.oncommand = function(message) {
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
window.spellcheck.command({
|
||||
"type" : "spell",
|
||||
"usrLang" : [1033, 1033, 1049],
|
||||
"usrWords" : ["hello", "hellop", "привет"]
|
||||
});
|
||||
|
||||
window.spellcheck.command({
|
||||
"type" : "suggest",
|
||||
"usrLang" : [1033],
|
||||
"usrWords" : ["hellop"]
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,546 +0,0 @@
|
||||
var printErr = undefined;
|
||||
var FS = undefined;
|
||||
var print = undefined;
|
||||
|
||||
var fetch = self.fetch;
|
||||
var getBinaryPromise = null;
|
||||
if (self.AscDesktopEditor && document.currentScript && 0 == document.currentScript.src.indexOf("file:///"))
|
||||
{
|
||||
fetch = undefined; // fetch not support file:/// scheme
|
||||
getBinaryPromise = function() {
|
||||
var wasmPath = "ascdesktop://fonts/" + wasmBinaryFile.substr(8);
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', wasmPath, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
if (xhr.overrideMimeType)
|
||||
xhr.overrideMimeType('text/plain; charset=x-user-defined');
|
||||
else
|
||||
xhr.setRequestHeader('Accept-Charset', 'x-user-defined');
|
||||
|
||||
xhr.onload = function () {
|
||||
if (this.status == 200) {
|
||||
resolve(new Uint8Array(this.response));
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getBinaryPromise = function() {
|
||||
return getBinaryPromise2();
|
||||
}
|
||||
}
|
||||
|
||||
//polyfill
|
||||
|
||||
//module
|
||||
|
||||
self.spellchecker = null;
|
||||
function onMessageEvent(data, port)
|
||||
{
|
||||
if (data.type == "init")
|
||||
{
|
||||
if (self.spellchecker)
|
||||
return;
|
||||
self.spellchecker = new Spellchecker();
|
||||
self.spellchecker.languagesPath = data.dictionaries_path;
|
||||
var languages = data.languages;
|
||||
for (var i in languages)
|
||||
self.spellchecker.addDefaultLanguage(i, languages[i]);
|
||||
self.spellchecker.init();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.spellchecker)
|
||||
return;
|
||||
|
||||
self.spellchecker.messages.push(data);
|
||||
if (port)
|
||||
self.spellchecker.ports.push(port);
|
||||
|
||||
if (1 < self.spellchecker.messages.length)
|
||||
{
|
||||
// значит еще грузим что-то
|
||||
return;
|
||||
}
|
||||
|
||||
self.spellchecker.checkMessage();
|
||||
}
|
||||
|
||||
self.onconnect = function(e)
|
||||
{
|
||||
var port = e.ports[0];
|
||||
port.onmessage = function(e) {
|
||||
onMessageEvent(e.data, port);
|
||||
}
|
||||
};
|
||||
self.onmessage = function(e)
|
||||
{
|
||||
onMessageEvent(e.data);
|
||||
};
|
||||
self.engineInit = false;
|
||||
self.onEngineInit = function()
|
||||
{
|
||||
self.engineInit = true;
|
||||
if (self.spellchecker)
|
||||
{
|
||||
self.spellchecker.init();
|
||||
self.spellchecker.checkMessage();
|
||||
}
|
||||
};
|
||||
|
||||
function Dictionary()
|
||||
{
|
||||
this.dataAff = null;
|
||||
this.dataDic = null;
|
||||
this.status = 0;
|
||||
this.id = 0;
|
||||
this.language = null;
|
||||
|
||||
this.load_file = function(src, params)
|
||||
{
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.sender = this;
|
||||
xhr.params = params;
|
||||
xhr.open('GET', src, true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
if (xhr.overrideMimeType)
|
||||
xhr.overrideMimeType('text/plain; charset=x-user-defined');
|
||||
else
|
||||
xhr.setRequestHeader('Accept-Charset', 'x-user-defined');
|
||||
|
||||
xhr.onload = function()
|
||||
{
|
||||
if (xhr.sender.status >= 2)
|
||||
return;
|
||||
|
||||
if (this.response && this.status == 200)
|
||||
{
|
||||
var uintData = new Uint8Array(this.response);
|
||||
switch (this.params)
|
||||
{
|
||||
case "aff":
|
||||
{
|
||||
this.sender.dataAff = uintData;
|
||||
break;
|
||||
}
|
||||
case "dic":
|
||||
{
|
||||
this.sender.dataDic = uintData;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
xhr.sender.status++;
|
||||
}
|
||||
|
||||
if (xhr.sender.status == 2)
|
||||
{
|
||||
self.spellchecker.onLoadDictionary(this.sender);
|
||||
}
|
||||
};
|
||||
xhr.onerror = function()
|
||||
{
|
||||
xhr.sender.status = 2;
|
||||
self.spellchecker.onLoadDictionary(this.sender);
|
||||
};
|
||||
|
||||
xhr.send(null);
|
||||
};
|
||||
|
||||
this.load = function()
|
||||
{
|
||||
if (!this.language)
|
||||
{
|
||||
this.status = 2;
|
||||
self.spellchecker.onLoadDictionary(this);
|
||||
return;
|
||||
}
|
||||
this.load_file(self.spellchecker.languagesPath + "/" + this.language.aff, "aff");
|
||||
this.load_file(self.spellchecker.languagesPath + "/" + this.language.dic, "dic");
|
||||
};
|
||||
|
||||
this.freeUnusedData = function()
|
||||
{
|
||||
this.dataAff = null;
|
||||
this.dataDic = null;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function Spellchecker()
|
||||
{
|
||||
this.languagesPath = "";
|
||||
this.languages = {};
|
||||
this.readyLanguages = {};
|
||||
this.messages = [];
|
||||
this.ports = [];
|
||||
this.tmpStrings = new ArrayBuffer(1000);
|
||||
this.engine = 0;
|
||||
|
||||
this.maxEngines = 3;
|
||||
this.maxDictionaries = 5;
|
||||
this.languageQueue = [];
|
||||
|
||||
this.maxDictionariesHandler = function()
|
||||
{
|
||||
if (this.languageQueue.length > this.maxDictionaries)
|
||||
{
|
||||
var toDelete = this.languageQueue.length - this.maxDictionaries;
|
||||
for (let i = 0; i < toDelete; i++)
|
||||
{
|
||||
var lk = this.languageQueue[0];
|
||||
this.deleteDictionaty(lk);
|
||||
delete this.readyLanguages[lk];
|
||||
this.languageQueue.shift();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.deleteDictionaty = function(lk)
|
||||
{
|
||||
if (!lk)
|
||||
return;
|
||||
|
||||
var affID = lk + ".aff";
|
||||
var dicID = lk + ".dic"
|
||||
var engineID = affID + dicID;
|
||||
var engineIDptr = this.allocString(engineID);
|
||||
var langAffptr = this.allocString(affID);
|
||||
var langDicptr = this.allocString(dicID);
|
||||
Module._Spellchecker_RemoveDicrionary(this.engine, langAffptr);
|
||||
Module._Spellchecker_RemoveDicrionary(this.engine, langDicptr);
|
||||
Module._Spellchecker_RemoveEngine(this.engine, engineIDptr);
|
||||
this.freeString(engineIDptr);
|
||||
this.freeString(langAffptr);
|
||||
this.freeString(langDicptr);
|
||||
};
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
if (0 == this.engine && self.engineInit)
|
||||
this.engine = this.createEngine();
|
||||
};
|
||||
|
||||
this.addDefaultLanguage = function(id, path)
|
||||
{
|
||||
this.languages["" + id] = {
|
||||
aff : path + "/" + path + ".aff",
|
||||
dic : path + "/" + path + ".dic"
|
||||
};
|
||||
};
|
||||
|
||||
this.onLoadDictionary = function(dictionary)
|
||||
{
|
||||
if (!dictionary.dataAff || !dictionary.dataDic)
|
||||
{
|
||||
this.checkMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
var aff_path = this.allocString(dictionary.id + ".aff");
|
||||
var dic_path = this.allocString(dictionary.id + ".dic");
|
||||
|
||||
var pointerAff = Module._Spellchecker_Malloc(dictionary.dataAff.length);
|
||||
Module.HEAP8.set(dictionary.dataAff, pointerAff);
|
||||
var pointerDic = Module._Spellchecker_Malloc(dictionary.dataDic.length);
|
||||
Module.HEAP8.set(dictionary.dataDic, pointerDic);
|
||||
|
||||
Module._Spellchecker_AddDictionary(this.engine, aff_path, pointerAff, dictionary.dataAff.length);
|
||||
Module._Spellchecker_AddDictionary(this.engine, dic_path, pointerDic, dictionary.dataDic.length);
|
||||
|
||||
this.freeString(aff_path);
|
||||
this.freeString(dic_path);
|
||||
|
||||
dictionary.freeUnusedData();
|
||||
|
||||
this.checkMessage();
|
||||
};
|
||||
|
||||
this.checkMessage = function()
|
||||
{
|
||||
if (0 == this.messages.length || !self.engineInit)
|
||||
return;
|
||||
|
||||
var m = this.messages[0];
|
||||
var isReady = true;
|
||||
for (var indexLang = 0, lenLangs = m.usrLang.length; indexLang < lenLangs; indexLang++)
|
||||
{
|
||||
var lang_key = "" + m.usrLang[indexLang];
|
||||
var readyLang = this.readyLanguages[lang_key];
|
||||
if (!readyLang)
|
||||
{
|
||||
// начнем грузить
|
||||
var langToReady = new Dictionary();
|
||||
langToReady.id = lang_key;
|
||||
langToReady.language = this.languages[lang_key];
|
||||
this.readyLanguages[lang_key] = langToReady;
|
||||
this.languageQueue.push(lang_key); // push lang info into the queue
|
||||
langToReady.load();
|
||||
|
||||
isReady = false;
|
||||
break;
|
||||
}
|
||||
else if (readyLang.status != 2)
|
||||
{
|
||||
// ждем
|
||||
isReady = false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// все готово.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isReady)
|
||||
{
|
||||
// ждем
|
||||
return;
|
||||
}
|
||||
|
||||
switch (m.type)
|
||||
{
|
||||
case "spell":
|
||||
{
|
||||
this.Spell(m);
|
||||
break;
|
||||
}
|
||||
case "suggest":
|
||||
{
|
||||
this.Suggest(m);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.maxDictionariesHandler();
|
||||
this.messages.shift();
|
||||
};
|
||||
|
||||
this.allocString = function(string)
|
||||
{
|
||||
var inputLen = string.length;
|
||||
var testLen = 6 * inputLen + 1;
|
||||
if (testLen > this.tmpStrings.byteLength)
|
||||
this.tmpStrings = new ArrayBuffer(testLen);
|
||||
|
||||
var code = 0;
|
||||
var index = 0;
|
||||
|
||||
var outputIndex = 0;
|
||||
var outputDataTmp = new Uint8Array(this.tmpStrings);
|
||||
var outputData = outputDataTmp;
|
||||
|
||||
while (index < inputLen)
|
||||
{
|
||||
code = string.charCodeAt(index++);
|
||||
if (code >= 0xD800 && code <= 0xDFFF && index < inputLen)
|
||||
{
|
||||
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & string.charCodeAt(index++)));
|
||||
}
|
||||
|
||||
if (code < 0x80)
|
||||
{
|
||||
outputData[outputIndex++] = code;
|
||||
}
|
||||
else if (code < 0x0800)
|
||||
{
|
||||
outputData[outputIndex++] = 0xC0 | (code >> 6);
|
||||
outputData[outputIndex++] = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x10000)
|
||||
{
|
||||
outputData[outputIndex++] = 0xE0 | (code >> 12);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x1FFFFF)
|
||||
{
|
||||
outputData[outputIndex++] = 0xF0 | (code >> 18);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x3FFFFFF)
|
||||
{
|
||||
outputData[outputIndex++] = 0xF8 | (code >> 24);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 18) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x7FFFFFFF)
|
||||
{
|
||||
outputData[outputIndex++] = 0xFC | (code >> 30);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 24) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 18) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
|
||||
outputData[outputIndex++] = 0x80 | (code & 0x3F);
|
||||
}
|
||||
}
|
||||
|
||||
outputData[outputIndex++] = 0;
|
||||
|
||||
var tmpBuffer = new Uint8Array(this.tmpStrings, 0, outputIndex);
|
||||
var pointer = Module._Spellchecker_Malloc(outputIndex);
|
||||
Module.HEAP8.set(tmpBuffer, pointer);
|
||||
return pointer;
|
||||
};
|
||||
this.freeString = function(stringPointer)
|
||||
{
|
||||
Module._Spellchecker_Free(stringPointer);
|
||||
};
|
||||
|
||||
this.readFromUtf8 = function(buffer, start, len)
|
||||
{
|
||||
var result = "";
|
||||
var index = start;
|
||||
var end = start + len;
|
||||
while (index < end)
|
||||
{
|
||||
var u0 = buffer[index++];
|
||||
if (!(u0 & 128))
|
||||
{
|
||||
result += String.fromCharCode(u0);
|
||||
continue;
|
||||
}
|
||||
var u1 = buffer[index++] & 63;
|
||||
if ((u0 & 224) == 192)
|
||||
{
|
||||
result += String.fromCharCode((u0 & 31) << 6 | u1);
|
||||
continue;
|
||||
}
|
||||
var u2 = buffer[index++] & 63;
|
||||
if ((u0 & 240) == 224)
|
||||
{
|
||||
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
||||
}
|
||||
else
|
||||
{
|
||||
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | buffer[index++] & 63;
|
||||
}
|
||||
if (u0 < 65536)
|
||||
{
|
||||
result += String.fromCharCode(u0);
|
||||
}
|
||||
else
|
||||
{
|
||||
var ch = u0 - 65536;
|
||||
result += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
this.readSuggests = function(pointer)
|
||||
{
|
||||
if (0 == pointer)
|
||||
return [];
|
||||
|
||||
var lenArray = new Int32Array(Module["HEAP8"].buffer, pointer, 4);
|
||||
var len = lenArray[0];
|
||||
len -= 4;
|
||||
|
||||
var buffer = new Uint8Array(Module["HEAP8"].buffer, pointer + 4, len);
|
||||
var index = 0;
|
||||
var ret = [];
|
||||
while (index < len)
|
||||
{
|
||||
var lenRec = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
|
||||
index += 4;
|
||||
ret.push(this.readFromUtf8(buffer, index, lenRec));
|
||||
index += lenRec;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
this.createEngine = function()
|
||||
{
|
||||
return Module._Spellchecker_Create(this.maxEngines);
|
||||
};
|
||||
this.destroyEngine = function()
|
||||
{
|
||||
Module._Spellchecker_Destroy();
|
||||
};
|
||||
|
||||
this.Spell = function(data)
|
||||
{
|
||||
var len = Math.min(data.usrLang.length, data.usrWords.length);
|
||||
if (0 == len)
|
||||
return;
|
||||
data.usrCorrect = new Array(len);
|
||||
var curLang = "";
|
||||
for (var i = 0; i < len; i++)
|
||||
{
|
||||
if (curLang != ("" + data.usrLang[i]))
|
||||
{
|
||||
curLang = "" + data.usrLang[i];
|
||||
var aff = this.allocString(curLang + ".aff");
|
||||
var dic = this.allocString(curLang + ".dic");
|
||||
ret = Module._Spellchecker_Load(this.engine, aff, dic);
|
||||
this.freeString(aff);
|
||||
this.freeString(dic);
|
||||
}
|
||||
var word = this.allocString(data.usrWords[i]);
|
||||
data.usrCorrect[i] = (1 == Module._Spellchecker_Spell(this.engine, word)) ? true : false;
|
||||
this.freeString(word);
|
||||
}
|
||||
|
||||
this.sendAnswer(data);
|
||||
};
|
||||
|
||||
this.Suggest = function(data)
|
||||
{
|
||||
var len = Math.min(data.usrLang.length, data.usrWords.length);
|
||||
if (0 == len)
|
||||
return;
|
||||
data.usrSuggest = new Array(len);
|
||||
var curLang = "";
|
||||
for (var i = 0; i < len; i++)
|
||||
{
|
||||
if (curLang != ("" + data.usrLang[i]))
|
||||
{
|
||||
curLang = "" + data.usrLang[i];
|
||||
var aff = this.allocString(curLang + ".aff");
|
||||
var dic = this.allocString(curLang + ".dic");
|
||||
|
||||
ret = Module._Spellchecker_Load(this.engine, aff, dic);
|
||||
|
||||
this.freeString(aff);
|
||||
this.freeString(dic);
|
||||
}
|
||||
var word = this.allocString(data.usrWords[i]);
|
||||
var pointerSuggests = Module._Spellchecker_Suggest(this.engine, word);
|
||||
data.usrSuggest[i] = this.readSuggests(pointerSuggests);
|
||||
this.freeString(word);
|
||||
}
|
||||
|
||||
this.sendAnswer(data);
|
||||
};
|
||||
|
||||
this.sendAnswer = function(data)
|
||||
{
|
||||
if (self.spellchecker.ports.length == 0)
|
||||
{
|
||||
self.postMessage(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
var port = self.spellchecker.ports.shift();
|
||||
port.postMessage(data);
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
self.spellchecker.checkMessage();
|
||||
}, 1);
|
||||
};
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
#include "base.h"
|
||||
#include "engine.h"
|
||||
|
||||
std::map<std::string, CFileMemory*> CSpellchecker::g_dictionaries;
|
||||
|
||||
void* Spellchecker_Malloc(unsigned int size)
|
||||
{
|
||||
return ::malloc(size);
|
||||
}
|
||||
void Spellchecker_Free(void* p)
|
||||
{
|
||||
if (p)
|
||||
::free(p);
|
||||
}
|
||||
|
||||
CSpellchecker* Spellchecker_Create(size_t max_engine_number)
|
||||
{
|
||||
return new CSpellchecker(max_engine_number);
|
||||
}
|
||||
void Spellchecker_Destroy(CSpellchecker* p)
|
||||
{
|
||||
delete p;
|
||||
}
|
||||
|
||||
int Spellchecker_AddDictionary(CSpellchecker* p, const char* id, unsigned char* data, unsigned int size)
|
||||
{
|
||||
if (!p)
|
||||
return 0;
|
||||
return p->AddDictionary(id, data, size);
|
||||
}
|
||||
void Spellchecker_RemoveDicrionary(CSpellchecker* p, const char* id)
|
||||
{
|
||||
if (!p)
|
||||
return;
|
||||
p->RemoveDictionary(id);
|
||||
}
|
||||
|
||||
int Spellchecker_Load(CSpellchecker* p, const char* aff_id, const char* dic_id)
|
||||
{
|
||||
if (!p) return 0;
|
||||
return p->Load(aff_id, dic_id);
|
||||
}
|
||||
int Spellchecker_Spell(CSpellchecker* p, const char* word_utf8)
|
||||
{
|
||||
return p->Spell(word_utf8);
|
||||
}
|
||||
unsigned char* Spellchecker_Suggest(CSpellchecker* p, const char* word_utf8)
|
||||
{;
|
||||
return p->Suggest(word_utf8);
|
||||
}
|
||||
void Spellchecker_RemoveEngine(CSpellchecker* p, const char* sid)
|
||||
{
|
||||
p->RemoveEngine(sid);
|
||||
}
|
||||
|
||||
double Spellchecker_TotalAllocatedMemory()
|
||||
{
|
||||
struct mallinfo a;
|
||||
a = mallinfo(); // Debug
|
||||
return (double)a.uordblks / 1000. / 1000.;
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
#include <memory>
|
||||
#include <malloc.h>
|
||||
class CSpellchecker;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void* Spellchecker_Malloc(unsigned int size);
|
||||
void Spellchecker_Free(void* p);
|
||||
|
||||
CSpellchecker* Spellchecker_Create(size_t max_engine_number);
|
||||
void Spellchecker_Destroy(CSpellchecker*);
|
||||
|
||||
int Spellchecker_AddDictionary(CSpellchecker* p, const char* sid, unsigned char* data, unsigned int size);
|
||||
void Spellchecker_RemoveDicrionary(CSpellchecker* p, const char* sid);
|
||||
|
||||
int Spellchecker_Load(CSpellchecker* p, const char* aff_id, const char* dic_id);
|
||||
int Spellchecker_Spell(CSpellchecker* p, const char* word_utf8);
|
||||
void Spellchecker_RemoveEngine(CSpellchecker* p, const char* sid);
|
||||
unsigned char* Spellchecker_Suggest(CSpellchecker* p, const char* word_utf8);
|
||||
|
||||
double Spellchecker_TotalAllocatedMemory(); //Debug
|
||||
}
|
||||
@ -1,355 +0,0 @@
|
||||
#include "hunspell.h"
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include "base.h"
|
||||
#include <map>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <memory.h>
|
||||
//#define WASM_LOGGING fprintf
|
||||
|
||||
class CFileMemory
|
||||
{
|
||||
public:
|
||||
unsigned char* data;
|
||||
unsigned int len;
|
||||
|
||||
public:
|
||||
CFileMemory(unsigned char* _data = NULL, unsigned int _len = 0)
|
||||
{
|
||||
data = _data;
|
||||
len = _len;
|
||||
}
|
||||
~CFileMemory()
|
||||
{
|
||||
if (data)
|
||||
{
|
||||
Spellchecker_Free(data);
|
||||
data = NULL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class CSuggests
|
||||
{
|
||||
protected:
|
||||
char* m_pData;
|
||||
size_t m_lSize;
|
||||
|
||||
char* m_pDataCur;
|
||||
size_t m_lSizeCur;
|
||||
|
||||
public:
|
||||
CSuggests()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = m_lSize;
|
||||
}
|
||||
CSuggests(const size_t& nLen)
|
||||
{
|
||||
m_lSize = nLen;
|
||||
m_pData = (char*)malloc(m_lSize * sizeof(char));
|
||||
|
||||
m_lSizeCur = 0;
|
||||
m_pDataCur = m_pData;
|
||||
}
|
||||
virtual ~CSuggests()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void AddSize(const size_t& nSize)
|
||||
{
|
||||
if (NULL == m_pData)
|
||||
{
|
||||
m_lSize = 1000;
|
||||
if (nSize > m_lSize)
|
||||
m_lSize = nSize;
|
||||
|
||||
m_pData = (char*)malloc(m_lSize * sizeof(char));
|
||||
|
||||
m_lSizeCur = 0;
|
||||
m_pDataCur = m_pData;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_lSizeCur + nSize) > m_lSize)
|
||||
{
|
||||
while ((m_lSizeCur + nSize) > m_lSize)
|
||||
{
|
||||
m_lSize *= 2;
|
||||
}
|
||||
|
||||
char* pRealloc = (char*)realloc(m_pData, m_lSize * sizeof(char));
|
||||
if (NULL != pRealloc)
|
||||
{
|
||||
// реаллок сработал
|
||||
m_pData = pRealloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
char* pMalloc = (char*)malloc(m_lSize * sizeof(char));
|
||||
memcpy(pMalloc, m_pData, m_lSizeCur * sizeof(char));
|
||||
|
||||
free(m_pData);
|
||||
m_pData = pMalloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void AddInt(const unsigned int& value)
|
||||
{
|
||||
AddSize(4);
|
||||
memcpy(m_pDataCur, &value, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
}
|
||||
void WriteString(const char* value, const unsigned int& len)
|
||||
{
|
||||
AddSize(len + 4);
|
||||
memcpy(m_pDataCur, &len, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
memcpy(m_pDataCur, value, len);
|
||||
m_pDataCur += len;
|
||||
m_lSizeCur += len;
|
||||
}
|
||||
unsigned char* GetBuffer()
|
||||
{
|
||||
return (unsigned char*)m_pData;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
free(m_pData);
|
||||
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
void ClearNoAttack()
|
||||
{
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
unsigned int GetSize()
|
||||
{
|
||||
return (unsigned int)m_lSizeCur;
|
||||
}
|
||||
|
||||
void SkipLen()
|
||||
{
|
||||
AddInt(0);
|
||||
}
|
||||
void WriteLen()
|
||||
{
|
||||
unsigned int len = (unsigned int)m_lSizeCur;
|
||||
memcpy(m_pData, &len, sizeof(unsigned int));
|
||||
}
|
||||
};
|
||||
|
||||
class LimitedEngineMap
|
||||
{
|
||||
public:
|
||||
LimitedEngineMap(size_t _maxEngineNumer)
|
||||
{
|
||||
m_nMaxEngineNumber = _maxEngineNumer;
|
||||
}
|
||||
~LimitedEngineMap()
|
||||
{
|
||||
for (std::pair<const std::string, Hunhandle*> &i : m_mapDictionariesEngines)
|
||||
{
|
||||
Hunspell_destroy(i.second);
|
||||
}
|
||||
m_mapDictionariesEngines.clear();
|
||||
}
|
||||
std::map<std::string, Hunhandle*>::iterator find(const std::string &to_find)
|
||||
{
|
||||
return m_mapDictionariesEngines.find(to_find);
|
||||
}
|
||||
std::map<std::string, Hunhandle*>::iterator end()
|
||||
{
|
||||
return m_mapDictionariesEngines.end();
|
||||
}
|
||||
std::pair<std::map<std::string, Hunhandle*>::iterator,bool> insert(const std::pair<std::string, Hunhandle*> &data)
|
||||
{
|
||||
if (m_qEngineQueue.size() == m_nMaxEngineNumber)
|
||||
{
|
||||
if (m_mapDictionariesEngines.find(m_qEngineQueue.front()) !=
|
||||
m_mapDictionariesEngines.end())
|
||||
{
|
||||
Hunspell_destroy(m_mapDictionariesEngines[m_qEngineQueue.front()]);
|
||||
m_mapDictionariesEngines.erase(m_qEngineQueue.front());
|
||||
m_qEngineQueue.pop();
|
||||
}
|
||||
|
||||
}
|
||||
m_qEngineQueue.push(data.first);
|
||||
return m_mapDictionariesEngines.insert(data);
|
||||
}
|
||||
void RemoveEngine(const char* id)
|
||||
{
|
||||
if (m_mapDictionariesEngines.find(id) == m_mapDictionariesEngines.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::queue<std::string> new_queue;;
|
||||
Hunspell_destroy(m_mapDictionariesEngines[id]);
|
||||
m_mapDictionariesEngines.erase(id);
|
||||
while (!m_qEngineQueue.empty())
|
||||
{
|
||||
if (m_qEngineQueue.front() != id)
|
||||
{
|
||||
new_queue.push(m_qEngineQueue.front());
|
||||
}
|
||||
m_qEngineQueue.pop();
|
||||
}
|
||||
m_qEngineQueue = new_queue;
|
||||
}
|
||||
private:
|
||||
std::map<std::string, Hunhandle*> m_mapDictionariesEngines;
|
||||
std::queue<std::string> m_qEngineQueue;
|
||||
size_t m_nMaxEngineNumber;
|
||||
};
|
||||
|
||||
class CSpellchecker
|
||||
{
|
||||
public:
|
||||
static std::map<std::string, CFileMemory*> g_dictionaries;
|
||||
|
||||
public:
|
||||
LimitedEngineMap m_oDictionariesEngines;
|
||||
std::string m_sCurrentDictionaryId;
|
||||
Hunhandle* m_pCurrentDictionary;
|
||||
CSuggests m_oSuggests;
|
||||
|
||||
public:
|
||||
CSpellchecker(size_t _MaxEngineNumber) :
|
||||
m_oDictionariesEngines(_MaxEngineNumber)
|
||||
{
|
||||
m_sCurrentDictionaryId = "";
|
||||
m_pCurrentDictionary = NULL;
|
||||
}
|
||||
~CSpellchecker()
|
||||
{
|
||||
|
||||
m_pCurrentDictionary = NULL;
|
||||
|
||||
for (std::pair<const std::string, CFileMemory*> &i : g_dictionaries)
|
||||
{
|
||||
delete i.second;
|
||||
}
|
||||
g_dictionaries.clear();
|
||||
}
|
||||
|
||||
public:
|
||||
int AddDictionary(const char*& id, unsigned char* data, unsigned int size)
|
||||
{
|
||||
#ifdef WASM_LOGGING
|
||||
WASM_LOGGING(stderr, "add dictionary: [%s, %d]\n", id, (int)size);
|
||||
#endif
|
||||
|
||||
RemoveDictionary(id);
|
||||
g_dictionaries.insert(std::pair<std::string, CFileMemory*>(std::string(id), new CFileMemory(data, size)));
|
||||
return 1;
|
||||
}
|
||||
void RemoveDictionary(const char*& id)
|
||||
{
|
||||
std::string sid(id);
|
||||
std::map<std::string, CFileMemory*>::iterator iter = g_dictionaries.find(sid);
|
||||
if (iter != g_dictionaries.end())
|
||||
{
|
||||
CFileMemory* file = iter->second;
|
||||
g_dictionaries.erase(iter);
|
||||
delete file;
|
||||
}
|
||||
}
|
||||
static CFileMemory* Get(const char*& id)
|
||||
{
|
||||
std::map<std::string, CFileMemory*>::iterator iter = g_dictionaries.find(std::string(id));
|
||||
if (iter == g_dictionaries.end())
|
||||
return NULL;
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
int Load(const char*& aff_id, const char*& dic_id)
|
||||
{
|
||||
#ifdef WASM_LOGGING
|
||||
WASM_LOGGING(stderr, "load: [%s, %s]\n", aff_id, dic_id);
|
||||
#endif
|
||||
return (NULL != SetLanguage(aff_id, dic_id)) ? 1 : 0;
|
||||
}
|
||||
int Spell(const char*& word)
|
||||
{
|
||||
#ifdef WASM_LOGGING
|
||||
WASM_LOGGING(stderr, "spell: [%s]\n", word);
|
||||
#endif
|
||||
if (!m_pCurrentDictionary)
|
||||
return 0;
|
||||
return Hunspell_spell(m_pCurrentDictionary, word);
|
||||
}
|
||||
unsigned char* Suggest(const char*& word)
|
||||
{
|
||||
#ifdef WASM_LOGGING
|
||||
WASM_LOGGING(stderr, "suggest: [%s]\n", word);
|
||||
#endif
|
||||
if (!m_pCurrentDictionary)
|
||||
return NULL;
|
||||
|
||||
char** pSuggest;
|
||||
int nSuggestCount = Hunspell_suggest(m_pCurrentDictionary, &pSuggest, word);
|
||||
|
||||
m_oSuggests.ClearNoAttack();
|
||||
m_oSuggests.SkipLen();
|
||||
|
||||
for (int i = 0; i < nSuggestCount; ++i)
|
||||
{
|
||||
m_oSuggests.WriteString(pSuggest[i], (unsigned int)strlen(pSuggest[i]));
|
||||
}
|
||||
|
||||
m_oSuggests.WriteLen();
|
||||
|
||||
if (0 < nSuggestCount)
|
||||
Hunspell_free_list(m_pCurrentDictionary, &pSuggest, nSuggestCount);
|
||||
|
||||
return m_oSuggests.GetBuffer();
|
||||
}
|
||||
void RemoveEngine(const char* id)
|
||||
{
|
||||
m_oDictionariesEngines.RemoveEngine(id);
|
||||
if (m_sCurrentDictionaryId == id)
|
||||
{
|
||||
m_sCurrentDictionaryId = "";
|
||||
m_pCurrentDictionary = NULL;
|
||||
}
|
||||
}
|
||||
protected:
|
||||
Hunhandle* SetLanguage(const std::string& aff_id, const std::string& dic_id)
|
||||
{
|
||||
if ((aff_id + dic_id) == m_sCurrentDictionaryId)
|
||||
return m_pCurrentDictionary;
|
||||
|
||||
m_sCurrentDictionaryId = aff_id + dic_id;
|
||||
m_pCurrentDictionary = NULL;
|
||||
|
||||
std::map<std::string, Hunhandle*>::iterator iterEngine = m_oDictionariesEngines.find(m_sCurrentDictionaryId);
|
||||
if (iterEngine != m_oDictionariesEngines.end())
|
||||
{
|
||||
m_pCurrentDictionary = iterEngine->second;
|
||||
return m_pCurrentDictionary;
|
||||
}
|
||||
|
||||
Hunhandle* pDictionary = Hunspell_create(aff_id.c_str(), dic_id.c_str());
|
||||
m_oDictionariesEngines.insert(std::pair<std::string, Hunhandle*>(m_sCurrentDictionaryId, pDictionary));
|
||||
m_pCurrentDictionary = pDictionary;
|
||||
return m_pCurrentDictionary;
|
||||
}
|
||||
};
|
||||
@ -1,58 +0,0 @@
|
||||
#include "license.hunspell"
|
||||
#include "license.myspell"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "filemgr.hxx"
|
||||
#include "csutil.hxx"
|
||||
|
||||
#include "./engine.h"
|
||||
|
||||
int FileMgr::fail(const char * err, const char * par) {
|
||||
fprintf(stderr, err, par);
|
||||
return -1;
|
||||
}
|
||||
|
||||
FileMgr::FileMgr(const char * file, const char * key)
|
||||
: hin(NULL), fin(NULL), linenum(0)
|
||||
{
|
||||
in[0] = '\0';
|
||||
|
||||
CFileMemory* file_memory = CSpellchecker::Get(file);
|
||||
if (!file_memory)
|
||||
{
|
||||
fail(MSG_OPEN, file);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 0;
|
||||
size = file_memory->len;
|
||||
memory = (char*)file_memory->data;
|
||||
}
|
||||
}
|
||||
|
||||
FileMgr::~FileMgr()
|
||||
{
|
||||
if (fin) fclose(fin);
|
||||
if (hin) delete hin;
|
||||
}
|
||||
|
||||
char * FileMgr::getline() {
|
||||
if(index >= size)
|
||||
return NULL;
|
||||
int i = 0,
|
||||
l = BUFSIZE -1;
|
||||
for(;index < size && memory[index] != '\n' && memory[index] != EOF && i <= l; index++, i++)
|
||||
in[i] = memory[index];
|
||||
in[i] = '\0';
|
||||
index++;
|
||||
if(index < size)
|
||||
linenum++;
|
||||
return strdup(in);
|
||||
}
|
||||
|
||||
int FileMgr::getlinenum() {
|
||||
return linenum;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
//#include "license.hunspell"
|
||||
//#include "license.myspell"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "./filemgr.hxx"
|
||||
#include "csutil.hxx"
|
||||
|
||||
#include "./engine.h"
|
||||
|
||||
int FileMgr::fail(const char *err, const char *par)
|
||||
{
|
||||
fprintf(stderr, err, par);
|
||||
return -1;
|
||||
}
|
||||
|
||||
FileMgr::FileMgr(const char *file, const char *key)
|
||||
: hin(NULL), linenum(0), memin(NULL)
|
||||
{
|
||||
in[0] = '\0';
|
||||
|
||||
CFileMemory *file_memory = CSpellchecker::Get(file);
|
||||
if (!file_memory)
|
||||
{
|
||||
fail(MSG_OPEN, file);
|
||||
}
|
||||
else
|
||||
{
|
||||
memin.from_buffer((char *)file_memory->data, file_memory->len);
|
||||
}
|
||||
}
|
||||
|
||||
FileMgr::~FileMgr()
|
||||
{
|
||||
if (hin)
|
||||
delete hin;
|
||||
}
|
||||
|
||||
bool FileMgr::getline(std::string &dest)
|
||||
{
|
||||
bool ret = memin.get_line(dest);
|
||||
if (ret)
|
||||
++linenum;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int FileMgr::getlinenum()
|
||||
{
|
||||
return linenum;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
#include "./base.h"
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
CSpellchecker* spell = Spellchecker_Create(100);
|
||||
|
||||
FILE* fAff = fopen("en_GB.aff", "rb");
|
||||
fseek(fAff, 0, SEEK_END);
|
||||
unsigned int nAffSize = (unsigned int)ftell(fAff);
|
||||
fseek(fAff, 0, SEEK_SET);
|
||||
unsigned char* pAffData = (unsigned char*)Spellchecker_Malloc(nAffSize);
|
||||
size_t nAffSizeRead = fread((void*)pAffData, 1, (size_t)nAffSize, fAff);
|
||||
fclose(fAff);
|
||||
|
||||
FILE* fDic = fopen("en_GB.dic", "rb");
|
||||
fseek(fDic, 0, SEEK_END);
|
||||
unsigned int nDicSize = (unsigned int)ftell(fDic);
|
||||
fseek(fDic, 0, SEEK_SET);
|
||||
unsigned char* pDicData = (unsigned char*)Spellchecker_Malloc(nDicSize);
|
||||
size_t nDicSizeRead = fread((void*)pDicData, 1, (size_t)nDicSize, fDic);
|
||||
fclose(fDic);
|
||||
|
||||
int bIsAdd1 = Spellchecker_AddDictionary(spell, "en_US.aff", pAffData, nAffSize);
|
||||
int bIsAdd2 = Spellchecker_AddDictionary(spell, "en_US.dic", pDicData, nDicSize);
|
||||
while(1) {
|
||||
Spellchecker_Load(spell, "en_US.aff", "en_US.dic");
|
||||
Spellchecker_RemoveEngine(spell, "en_US.affen_US.dic");
|
||||
std::cout << Spellchecker_Debug() << std::endl;
|
||||
}
|
||||
|
||||
// int nCheck1 = Spellchecker_Spell(spell, "hello");
|
||||
// int nCheck2 = Spellchecker_Spell(spell, "hellop");
|
||||
// unsigned char* pSuggestData = Spellchecker_Suggest(spell, "hellop");
|
||||
Spellchecker_Destroy(spell);
|
||||
return 0;
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class string_buffer_stream
|
||||
{
|
||||
private:
|
||||
char* m_buffer;
|
||||
unsigned int m_pos;
|
||||
unsigned int m_size;
|
||||
|
||||
public:
|
||||
string_buffer_stream(char* buf = NULL, unsigned int len = 0)
|
||||
{
|
||||
m_buffer = buf;
|
||||
m_pos = 0;
|
||||
m_size = len;
|
||||
}
|
||||
void from_buffer(char* buf, unsigned int len)
|
||||
{
|
||||
m_buffer = buf;
|
||||
m_pos = 0;
|
||||
m_size = len;
|
||||
}
|
||||
|
||||
// emulate
|
||||
// https://en.cppreference.com/w/cpp/string/basic_string/getline
|
||||
bool get_line(std::string& data)
|
||||
{
|
||||
data.erase();
|
||||
|
||||
if (m_pos >= m_size)
|
||||
return false;
|
||||
|
||||
while (m_pos < m_size)
|
||||
{
|
||||
char c = m_buffer[m_pos++];
|
||||
if (c == '\n')
|
||||
break;
|
||||
if (c == '\r')
|
||||
{
|
||||
if (m_pos < m_size && m_buffer[m_pos] == '\n')
|
||||
++m_pos;
|
||||
break;
|
||||
}
|
||||
data += c;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@ -1,14 +0,0 @@
|
||||
import sys
|
||||
sys.path.append("../../../../../../build_tools/scripts")
|
||||
import base
|
||||
|
||||
base.configure_common_apps()
|
||||
base.replaceInFile("../deploy/engine/hyphen.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[onLoadModule];")
|
||||
base.replaceInFile("../deploy/engine/hyphen_ie.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[onLoadModule];")
|
||||
base.replaceInFile("../deploy/engine/hyphen.js", "__ATPOSTRUN__ = [];", "__ATPOSTRUN__=[onLoadModule];")
|
||||
base.replaceInFile("../deploy/engine/hyphen_ie.js", "__ATPOSTRUN__ = [];", "__ATPOSTRUN__=[onLoadModule];")
|
||||
|
||||
base.replaceInFile("../deploy/engine/hyphen.js", "function getBinaryPromise()", "function getBinaryPromise2()")
|
||||
base.replaceInFile("../deploy/engine/hyphen_ie.js", "function getBinaryPromise()", "function getBinaryPromise2()")
|
||||
|
||||
base.copy_file("../library.js", "../deploy/hyphen.js")
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "hyphen",
|
||||
"res_folder": "../deploy/engine",
|
||||
"wasm": true,
|
||||
"asm": true,
|
||||
"embed_mem_file": true,
|
||||
"run_before": "",
|
||||
"run_after": "after.py",
|
||||
"base_js_content": "../module.js",
|
||||
|
||||
"compiler_flags": [
|
||||
"-O3",
|
||||
"-fno-exceptions",
|
||||
"-fno-rtti",
|
||||
"-Wno-unused-command-line-argument",
|
||||
"-sALLOW_MEMORY_GROWTH"
|
||||
],
|
||||
"exported_functions": [
|
||||
"_malloc",
|
||||
"_free",
|
||||
"_hyphenCreateApplication",
|
||||
"_hyphenDestroyApplication",
|
||||
"_hyphenLoadDictionary",
|
||||
"_hyphenWord"
|
||||
],
|
||||
"include_path": ["../src"],
|
||||
"define": ["GRAPHICS_NO_USE_DYNAMIC_LIBRARY", "HYPHEN_ENGINE_DISABLE_FILESYSTEM"],
|
||||
"compile_files_array": [
|
||||
{
|
||||
"name": "h_e",
|
||||
"folder": "../../../../../DesktopEditor/fontengine",
|
||||
"files": ["TextHyphen.cpp"]
|
||||
},
|
||||
{
|
||||
"name": "h_m",
|
||||
"folder": "../src",
|
||||
"files": ["hyphen.cpp"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
(function(window) {
|
||||
|
||||
window.hyphen = window.hyphen || {};
|
||||
window.hyphen.isReady = false;
|
||||
|
||||
var not_ready = function() {
|
||||
console.log('Module is not ready');
|
||||
}
|
||||
|
||||
window.hyphen.destroyApplication = not_ready;
|
||||
window.hyphen.loadDictionary = not_ready;
|
||||
window.hyphen.hyphenWord = not_ready;
|
||||
|
||||
window.hyphen.onLoadModule = function(exports) {
|
||||
window.hyphen.isReady = true;
|
||||
|
||||
window.hyphen.destroyApplication = exports.destroyApplication;
|
||||
window.hyphen.loadDictionary = exports.loadDictionary;
|
||||
window.hyphen.hyphenWord = exports.hyphenWord;
|
||||
};
|
||||
|
||||
window.hyphen.loadModule = function() {
|
||||
var path = '../deploy/engine/';
|
||||
|
||||
// wasm support check
|
||||
var useWasm = false;
|
||||
const webAsmObj = window['WebAssembly'];
|
||||
if (typeof webAsmObj === 'object') {
|
||||
if (typeof webAsmObj['Memory'] === 'function') {
|
||||
if ((typeof webAsmObj['instantiateStreaming'] === 'function') || (typeof webAsmObj['instantiate'] === 'function')) {
|
||||
useWasm = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
path += (useWasm ? 'hyphen.js' : 'hyphen_ie.js');
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = path;
|
||||
document.head.appendChild(script);
|
||||
|
||||
}
|
||||
})(self);
|
||||
@ -1,81 +0,0 @@
|
||||
(function(window) {
|
||||
|
||||
var isModuleLoaded = false;
|
||||
var application;
|
||||
|
||||
function onLoadModule() {
|
||||
isModuleLoaded = true;
|
||||
application = Module._hyphenCreateApplication();
|
||||
if (window.hyphen) {
|
||||
window.hyphen.onLoadModule && window.hyphen.onLoadModule({
|
||||
destroyApplication: function() {
|
||||
Module._hyphenDestroyApplication(application);
|
||||
},
|
||||
loadDictionary: hyphenLoadDictionary,
|
||||
hyphenWord: hyphenWord
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//desktop_fetch
|
||||
|
||||
//polyfill
|
||||
|
||||
//string_utf8
|
||||
|
||||
//module
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Number} app
|
||||
* @param {Number} lang
|
||||
* @param {arraybuffer} dict
|
||||
* @returns {Boolean} isSuccess
|
||||
*/
|
||||
function hyphenLoadDictionary(lang, dict)
|
||||
{
|
||||
if (!isModuleLoaded)
|
||||
return;
|
||||
|
||||
let dictSize = dict.byteLength;
|
||||
let dictPointer = Module._malloc(dictSize);
|
||||
Module.HEAP8.set(new Uint8ClampedArray(dict), dictPointer);
|
||||
|
||||
let result = Module._hyphenLoadDictionary(application, lang, dictPointer, dictSize);
|
||||
|
||||
Module._free(dictPointer);
|
||||
|
||||
return (result === 0) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Number} lang
|
||||
* @param {String} word
|
||||
* @returns {Array}
|
||||
* Returns hyphen vector of word
|
||||
*/
|
||||
function hyphenWord(lang, word)
|
||||
{
|
||||
if (!isModuleLoaded)
|
||||
return;
|
||||
|
||||
let wordPointer = word.toUtf8Pointer();
|
||||
let wordLen = wordPointer.length;
|
||||
let hyphens = [];
|
||||
|
||||
if (wordPointer)
|
||||
{
|
||||
const ptr = Module._hyphenWord(application, lang, wordPointer.ptr, wordLen);
|
||||
wordPointer.free();
|
||||
|
||||
let vector = new Uint8ClampedArray(Module.HEAP8.buffer, ptr, wordLen + 5);
|
||||
for (let i = 0; vector[i] != 0; i++)
|
||||
{
|
||||
if (1 == (vector[i] & 1))
|
||||
hyphens.push((i + 1));
|
||||
}
|
||||
}
|
||||
return hyphens;
|
||||
}
|
||||
})(self);
|
||||
@ -1,52 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>test</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<form>
|
||||
<textarea id = "textarea"></textarea>
|
||||
<button type = "submit">OK</button>
|
||||
<select name = "combobox" id = "combobox">
|
||||
<option></option>
|
||||
<option value = "bg_BG">bg_BG</option>
|
||||
<option value = "ca_ES">ca_ES</option>
|
||||
<option value = "da_DK">da_DK</option>
|
||||
<option value = "de_AT">de_AT</option>
|
||||
<option value = "de_CH">de_CH</option>
|
||||
<option value = "de_DE">de_DE</option>
|
||||
<option value = "el_GR">el_GR</option>
|
||||
<option value = "en_AU">en_AU</option>
|
||||
<option value = "en_GB">en_GB</option>
|
||||
<option value = "en_US">en_US</option>
|
||||
<option value = "es_ES">es_ES</option>
|
||||
<option value = "fr_FR">fr_FR</option>
|
||||
<option value = "gl_ES">gl_ES</option>
|
||||
<option value = "hr_HR">hr_HR</option>
|
||||
<option value = "hu_HU">hu_HU</option>
|
||||
<option value = "id_ID">id_ID</option>
|
||||
<option value = "it_IT">it_IT</option>
|
||||
<option value = "lv_LV">lv_LV</option>
|
||||
<option value = "mn_MN">mn_MN</option>
|
||||
<option value = "nb_NO">nb_NO</option>
|
||||
<option value = "nl_NL">nl_NL</option>
|
||||
<option value = "nn_NO">nn_NO</option>
|
||||
<option value = "pl_PL">pl_PL</option>
|
||||
<option value = "pt_BR">pt_BR</option>
|
||||
<option value = "pt_PT">pt_PT</option>
|
||||
<option value = "ro_RO">ro_RO</option>
|
||||
<option value = "ru_RU">ru_RU</option>
|
||||
<option value = "sk_SK">sk_SK</option>
|
||||
<option value = "sl_SI">sl_SI</option>
|
||||
<option value = "sr_Cyrl_RS">sr_Cyrl_RS</option>
|
||||
<option value = "sr_Latn_RS">sr_Latn_RS</option>
|
||||
<option value = "sv_SE">sv_SE</option>
|
||||
<option value = "uk_UA">uk_UA</option>
|
||||
</select>
|
||||
</form>
|
||||
<script src = "../deploy/hyphen.js"></script>
|
||||
<script src = "main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,117 +0,0 @@
|
||||
(function (window, undefined) {
|
||||
|
||||
window.hyphen.loadModule();
|
||||
|
||||
var langs = {
|
||||
"az_Latn_AZ" : 1068,
|
||||
"bg_BG" : 1026,
|
||||
"ca_ES" : 1027,
|
||||
"ca_ES_valencia" : 2051,
|
||||
"cs_CZ" : 1029,
|
||||
"da_DK" : 1030,
|
||||
"de_AT" : 3079,
|
||||
"de_CH" : 2055,
|
||||
"de_DE" : 1031,
|
||||
"el_GR" : 1032,
|
||||
"en_AU" : 3081,
|
||||
"en_CA" : 4105,
|
||||
"en_GB" : 2057,
|
||||
"en_US" : 1033,
|
||||
"en_ZA" : 7177,
|
||||
"es_ES" : 3082,
|
||||
"eu_ES" : 1069,
|
||||
"fr_FR" : 1036,
|
||||
"gl_ES" : 1110,
|
||||
"hr_HR" : 1050,
|
||||
"hu_HU" : 1038,
|
||||
"id_ID" : 1057,
|
||||
"it_IT" : 1040,
|
||||
"kk_KZ" : 1087,
|
||||
"ko_KR" : 1042,
|
||||
"lb_LU" : 1134,
|
||||
"lt_LT" : 1063,
|
||||
"lv_LV" : 1062,
|
||||
"mn_MN" : 1104,
|
||||
"nb_NO" : 1044,
|
||||
"nl_NL" : 1043,
|
||||
"nn_NO" : 2068,
|
||||
"oc_FR" : 1154,
|
||||
"pl_PL" : 1045,
|
||||
"pt_BR" : 1046,
|
||||
"pt_PT" : 2070,
|
||||
"ro_RO" : 1048,
|
||||
"ru_RU" : 1049,
|
||||
"sk_SK" : 1051,
|
||||
"sl_SI" : 1060,
|
||||
"sr_Cyrl_RS" : 10266,
|
||||
"sr_Latn_RS" : 9242,
|
||||
"sv_SE" : 1053,
|
||||
"tr_TR" : 1055,
|
||||
"uk_UA" : 1058,
|
||||
"uz_Cyrl_UZ" : 2115,
|
||||
"uz_Latn_UZ" : 1091,
|
||||
"vi_VN" : 1066,
|
||||
"nl_NL" : 2067
|
||||
};
|
||||
|
||||
var textarea = document.getElementById("textarea");
|
||||
var form = document.querySelector("form");
|
||||
var combobox = document.getElementById("combobox");
|
||||
|
||||
combobox.value = "en_US";
|
||||
textarea.value = "expedition";
|
||||
|
||||
form.onsubmit = function(event)
|
||||
{
|
||||
if(combobox.value == "")
|
||||
return;
|
||||
|
||||
var lang = combobox.value;
|
||||
var text = textarea.value.split("\n").join(" ").split(" ");
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
var path = '../../../../../../dictionaries/' + lang + '/' + 'hyph_' + lang + '.dic';
|
||||
|
||||
request.responseType = 'arraybuffer';
|
||||
|
||||
if (request.overrideMimeType) {
|
||||
request.overrideMimeType('text/plain; charset=x-user-defined');
|
||||
} else {
|
||||
request.setRequestHeader('Accept-Charset', 'x-user-defined');
|
||||
}
|
||||
request.open('GET', path, true);
|
||||
request.send(null);
|
||||
|
||||
request.onload = function ()
|
||||
{
|
||||
var dict = request.response;
|
||||
var langInt = langs[lang];
|
||||
window.hyphen.loadDictionary(langInt, dict);
|
||||
|
||||
for (var i = 0; i < text.length; i++)
|
||||
{
|
||||
var hyphens = window.hyphen.hyphenWord(langInt, text[i].toLowerCase());
|
||||
|
||||
let itemUtf8 = text[i].toUtf8(true);
|
||||
let start = 0;
|
||||
let hword = "";
|
||||
|
||||
for (let j = 0, len = hyphens.length; j < len; j++)
|
||||
{
|
||||
hword += "".fromUtf8(itemUtf8, start, hyphens[j] - start);
|
||||
hword += "=";
|
||||
start = hyphens[j];
|
||||
}
|
||||
|
||||
if (start < itemUtf8.length)
|
||||
{
|
||||
hword += "".fromUtf8(itemUtf8, start);
|
||||
hword += "=";
|
||||
}
|
||||
|
||||
console.log(hword);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
})(self);
|
||||
@ -1,10 +0,0 @@
|
||||
button {
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
#textarea{
|
||||
display: block;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "./common_openssl.h"
|
||||
@ -673,8 +676,8 @@ namespace NSOpenSSL
|
||||
#define GCM_IV_LENGTH 12
|
||||
#define GCM_TAG_LENGHT 16
|
||||
|
||||
// для того, чтобы мы могли менять алгоритмы, в зависимости от версии
|
||||
// на шифровке - дописываем хедер. сделано на этом уровне, чтобы лишний раз не выделять/копировать память
|
||||
// so that we can change algorithms depending on the version
|
||||
// on encryption - we append header. done at this level to avoid unnecessary memory allocation/copying
|
||||
std::string g_aes_header = "VER2;";
|
||||
|
||||
unsigned char* PBKDF2_desktop_GCM(const std::string& pass, const std::string& salt)
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef COMMON_OPENSSL_H
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "./../common/common_openssl.h"
|
||||
|
||||
@ -399,7 +399,7 @@ void Header::load( const unsigned char* buffer ) {
|
||||
num_mbat = readU32( buffer + 0x48 ); // [48H,04] number of SECTs in the DIFAT chain
|
||||
|
||||
if (threshold == 0)
|
||||
threshold = 4096; //поле не задано ... файл xls от полльзователя
|
||||
threshold = 4096; //field not set ... xls file from user
|
||||
|
||||
for( unsigned int i = 0; i < 8; i++ )
|
||||
id[i] = buffer[i];
|
||||
|
||||
@ -30,7 +30,7 @@ if False:
|
||||
build_func()
|
||||
else:
|
||||
if not base.is_file("./build.7z"):
|
||||
base.download("http://d2ettrnqo7v976.cloudfront.net/v8/android/build.7z", "./build.7z")
|
||||
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/android/v8.7z", "./build.7z")
|
||||
base.extract("./build.7z", "./")
|
||||
base.copy_dir("./build/v8", "./v8")
|
||||
base.delete_dir("./build/v8")
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
#include "VideoFileErrorDescription.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // for MSVS
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifndef ATLDEFINE_H_DEFINE
|
||||
#define ATLDEFINE_H_DEFINE
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifndef BASE64_H_DEFINE
|
||||
#define BASE64_H_DEFINE
|
||||
@ -287,7 +290,7 @@ static bool Base64Decode(const char* szSrc, int nSrcLen, BYTE *& pbDest, int *pn
|
||||
{
|
||||
unsigned int index= in[i]-43;
|
||||
if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)
|
||||
return false; ///???? было -1
|
||||
return false; ///???? was -1
|
||||
v = (v << 6) + map2[index];
|
||||
if (i & 3) {
|
||||
if (dst - out < out_size) {
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@ -57,9 +60,9 @@ namespace NFileWriter
|
||||
|
||||
NSFile::CFileBinary m_oFile;
|
||||
|
||||
LONG64 m_lBufferSize; // Размер буффера
|
||||
BYTE* m_lpBuffer; // Сам буффер
|
||||
LONG64 m_lWritePointer; // Позиция для записи данных в буффер
|
||||
LONG64 m_lBufferSize; // Buffer size
|
||||
BYTE* m_lpBuffer; // The buffer itself
|
||||
LONG64 m_lWritePointer; // Position for writing data to the buffer
|
||||
|
||||
public :
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // for MSVS
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/include/FileTransporter.h \
|
||||
$$PWD/include/manager.h \
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef APPLICATION_DOWNLOAD_MANAGER_H
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "FileTransporter_private.h"
|
||||
@ -106,7 +109,7 @@ namespace NSNetwork
|
||||
{
|
||||
CURL *curl;
|
||||
int fp;
|
||||
CURLcode res;
|
||||
CURLcode res = CURLE_FAILED_INIT;
|
||||
std::string sUrl = U_TO_UTF8(m_sDownloadFileUrl);
|
||||
std::string sOut;
|
||||
const char *url = sUrl.c_str();
|
||||
@ -121,7 +124,7 @@ namespace NSNetwork
|
||||
// Install the callback function
|
||||
//curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
|
||||
#if defined(__linux__)
|
||||
//в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку
|
||||
//linux has no built-in root certificates, so we disable verification
|
||||
//http://curl.haxx.se/docs/sslcerts.html
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
@ -181,7 +184,7 @@ namespace NSNetwork
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
|
||||
|
||||
#if defined(__linux__)
|
||||
//в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку
|
||||
//linux has no built-in root certificates, so we disable verification
|
||||
//http://curl.haxx.se/docs/sslcerts.html
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "FileTransporter_private.h"
|
||||
@ -175,6 +178,33 @@ namespace NSNetwork
|
||||
NSString* stringURL = StringWToNSString(m_sDownloadFileUrl);
|
||||
NSURL* url = SafeURLFromString(stringURL);
|
||||
|
||||
// NSURLSession does not support file:// URLs reliably on macOS/iOS
|
||||
// NSFileManager to copy the file directly instead.
|
||||
if (url && [[url scheme] isEqualToString:@"file"])
|
||||
{
|
||||
NSString* dstPath = StringWToNSString(m_sDownloadFilePath);
|
||||
NSFileManager* fm = [NSFileManager defaultManager];
|
||||
// copyItemAtURL:toURL: fails if destination exists — remove it first
|
||||
// to match the overwrite semantics of writeToFile:atomically:YES
|
||||
[fm removeItemAtPath:dstPath error:nil];
|
||||
NSError* err = nil;
|
||||
BOOL ok = [fm copyItemAtURL:url
|
||||
toURL:[NSURL fileURLWithPath:dstPath]
|
||||
error:&err];
|
||||
if (!ok)
|
||||
NSLog(@"[DownloadFile] file:// copy failed: %@", err);
|
||||
#if !defined(_IOS)
|
||||
#ifndef _ASC_USE_ARC_
|
||||
if (!GetARCEnabled())
|
||||
{
|
||||
[dstPath release];
|
||||
[stringURL release];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return ok ? 0 : 1;
|
||||
}
|
||||
|
||||
if (!url)
|
||||
{
|
||||
NSLog(@"[DownloadFile] Invalid URL: %@", stringURL);
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@ -115,13 +118,13 @@ namespace NSNetwork
|
||||
virtual int UploadData() = 0;
|
||||
|
||||
public:
|
||||
std::wstring m_sDownloadFilePath; // Путь к сохраненному файлу на диске
|
||||
std::wstring m_sDownloadFileUrl;// Ссылка на скачивание файла
|
||||
std::wstring m_sUploadFilePath; // Путь к файлу для выгрузки на сервер
|
||||
std::wstring m_sUploadUrl; // URL для выгрузки данных
|
||||
std::wstring m_sDownloadFilePath; // Path to saved file on disk
|
||||
std::wstring m_sDownloadFileUrl;// Download file URL
|
||||
std::wstring m_sUploadFilePath; // Path to file for upload to server
|
||||
std::wstring m_sUploadUrl; // URL for data upload
|
||||
|
||||
bool m_bComplete; // Закачался файл или нет
|
||||
bool m_bDelete; // Удалять ли файл в деструкторе
|
||||
bool m_bComplete; // Whether file is downloaded or not
|
||||
bool m_bDelete; // Delete file in destructor?
|
||||
|
||||
typedef enum LoadType
|
||||
{
|
||||
@ -130,12 +133,12 @@ namespace NSNetwork
|
||||
UPLOADDATA
|
||||
} LoadType;
|
||||
|
||||
LoadType m_eLoadType; // Тип загрузки/выгрузки данных/файла
|
||||
LoadType m_eLoadType; // Load/upload type for data/file
|
||||
|
||||
const unsigned char* m_cData; // Данные в сыром виде для выгрузки
|
||||
int m_nSize; // Размер данных
|
||||
const unsigned char* m_cData; // Raw data for upload
|
||||
int m_nSize; // Data size
|
||||
|
||||
std::wstring m_sResponse = L""; // Ответ сервера
|
||||
std::wstring m_sResponse = L""; // Server response
|
||||
|
||||
std::function<void(int)> m_func_onComplete = nullptr;
|
||||
std::function<void(int)> m_func_onProgress = nullptr;
|
||||
@ -143,13 +146,13 @@ namespace NSNetwork
|
||||
|
||||
CSession* m_pSession;
|
||||
|
||||
// std::atomic<bool>* m_bIsExit; // Для остановки и выхода потока
|
||||
// std::atomic<bool>* m_bIsExit; // For stopping and exiting the thread
|
||||
};
|
||||
|
||||
class CFileTransporter_private : public NSThreads::CBaseThread
|
||||
{
|
||||
protected:
|
||||
// создаем в зависимости от платформы
|
||||
// create depending on platform
|
||||
CFileTransporterBase* m_pInternal;
|
||||
|
||||
public:
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "FileTransporter_private.h"
|
||||
@ -45,16 +48,16 @@
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Константа для максимального числа символов в строке
|
||||
// Constant for maximum number of characters in a string
|
||||
#define MAX_SIZE 256
|
||||
// Константа для максимального числа загружаемых байт
|
||||
// Constant for maximum number of downloadable bytes
|
||||
#define DOWNLOAD_FILE_SIZE 32768
|
||||
#define MAX_SINGLE_DOWNLOAD_FILE_SIZE 524288
|
||||
|
||||
|
||||
// Константа для получения размера файла
|
||||
// Constant for getting file size
|
||||
#define CONTENT_RANGE L"bytes 0-0/"
|
||||
// Константа для колличества символов у CONTENT_RANGE
|
||||
// Constant for CONTENT_RANGE character count
|
||||
#define CONTENT_RANGE_SIZE ( 11/*sizeof ( CONTENT_RANGE )*/ - 1 )
|
||||
|
||||
namespace NSNetwork
|
||||
@ -134,10 +137,10 @@ namespace NSNetwork
|
||||
}
|
||||
|
||||
protected:
|
||||
FILE * m_pFile = nullptr; // Хэндл на временный файл
|
||||
FILE * m_pFile = nullptr; // Handle to temporary file
|
||||
unsigned int _DownloadFile(std::wstring sFileUrl)
|
||||
{
|
||||
// Проверяем состояние соединения
|
||||
// Check connection state
|
||||
if ( FALSE == InternetGetConnectedState ( 0, 0 ) )
|
||||
return S_FALSE;
|
||||
|
||||
@ -154,67 +157,67 @@ namespace NSNetwork
|
||||
|
||||
m_sDownloadFilePath = std::wstring( sTempFile );
|
||||
|
||||
// Открываем сессию
|
||||
// Open session
|
||||
HINTERNET hInternetSession = InternetOpenW ( L"Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
|
||||
if ( NULL == hInternetSession )
|
||||
return S_FALSE;
|
||||
|
||||
// Заголовок запроса ( пока содержит 0 байт ( необходимо для проверки ) )
|
||||
// Request header (currently contains 0 bytes, needed for verification)
|
||||
std::wstring sHTTPHdr = L"Range: bytes=0-0";
|
||||
// Открываем ссылку для проверки на ее существование, а также на возможность чтения частями
|
||||
// Open URL to check its existence and ability to read in chunks
|
||||
HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternetSession, sFileUrl.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
|
||||
if ( NULL != hInternetOpenURL )
|
||||
{
|
||||
// Открытие произошло, проверяем ответ
|
||||
// Opened successfully, check response
|
||||
if ( TRUE == QueryStatusCode ( hInternetOpenURL, TRUE ) )
|
||||
{
|
||||
// Запрос прошел удачно, проверяем возможность чтения частями и получаем размер данных
|
||||
// Request succeeded, check ability to read in chunks and get data size
|
||||
LONGLONG nFileSize = IsAccept_Ranges ( hInternetOpenURL );
|
||||
// Закрываем хендл
|
||||
// Close handle
|
||||
InternetCloseHandle ( hInternetOpenURL );
|
||||
if ( -1 == nFileSize )
|
||||
{
|
||||
// Чтение частями недоступно
|
||||
// Закрываем хендл соединения
|
||||
// Reading in chunks is not available
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
// Закрываем файл (сделается на DownloadAll)
|
||||
// Попробуем записать его целиком
|
||||
// Close file (will be done in DownloadAll)
|
||||
// Try to write it entirely
|
||||
return S_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Чтение частями доступно
|
||||
// Reading in chunks is available
|
||||
LONGLONG nStartByte = 0;
|
||||
while ( true )
|
||||
{
|
||||
// Если закачали весь файл - то выходим
|
||||
// If entire file is downloaded - exit
|
||||
if ( nStartByte == nFileSize - 1 )
|
||||
{
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
return S_OK;
|
||||
}
|
||||
LONGLONG nEndByte = nStartByte + DOWNLOAD_FILE_SIZE;
|
||||
// Если файл заканчивается, то загружаем меньшее колличество байт ( на 1 меньше, чем размер, т.к. начинается с 0 )
|
||||
// If file is ending, download fewer bytes (1 less than size, since it starts from 0)
|
||||
if ( nEndByte >= nFileSize )
|
||||
nEndByte = nFileSize - 1;
|
||||
|
||||
// Буффер для закачки
|
||||
// Download buffer
|
||||
BYTE arrBuffer [ DOWNLOAD_FILE_SIZE ] = { 0 };
|
||||
DWORD dwBytesDownload = DownloadFilePath ( hInternetSession, arrBuffer, nStartByte, nEndByte, sFileUrl );
|
||||
|
||||
nStartByte = nEndByte;
|
||||
if ( -1 == dwBytesDownload )
|
||||
{
|
||||
// Ничего не прочиталось - это плохо!!!!
|
||||
// Закрываем хендл соединения
|
||||
// Nothing was read - this is bad!!!!
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
// Закрываем файл (сделается на DownloadAll)
|
||||
// Попробуем записать его целиком
|
||||
// Close file (will be done in DownloadAll)
|
||||
// Try to write it entirely
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
// Пишем в файл
|
||||
// Write to file
|
||||
::fwrite( (BYTE*)arrBuffer, 1, dwBytesDownload, m_pFile );
|
||||
::fflush( m_pFile );
|
||||
|
||||
@ -224,62 +227,62 @@ namespace NSNetwork
|
||||
}
|
||||
else
|
||||
{
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
// Закрываем файл (сделается на DownloadAll)
|
||||
// Попробуем записать его целиком
|
||||
// Close file (will be done in DownloadAll)
|
||||
// Try to write it entirely
|
||||
return S_FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
// Закрываем файл (сделается на DownloadAll)
|
||||
// Попробуем записать его целиком
|
||||
// Close file (will be done in DownloadAll)
|
||||
// Try to write it entirely
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetSession );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
DWORD DownloadFilePath ( HINTERNET hInternet, LPBYTE pBuffer, LONGLONG nStartByte, LONGLONG nEndByte, std::wstring sFileURL )
|
||||
{
|
||||
// Неоткрытая сессия
|
||||
// Session not opened
|
||||
if ( NULL == hInternet )
|
||||
return -1;
|
||||
|
||||
// Пришли непонятные параметры
|
||||
// Invalid parameters received
|
||||
if ( nStartByte > nEndByte || !pBuffer )
|
||||
return -1;
|
||||
|
||||
// Заголовок запроса ( содержит nEndByte - nStartByte байт )
|
||||
// Request header (contains nEndByte - nStartByte bytes)
|
||||
std::wstring sHTTPHdr = L"Range: bytes=" + std::to_wstring(nStartByte) + L"-" + std::to_wstring(nEndByte);
|
||||
// Открываем ссылку для закачки
|
||||
// Open URL for download
|
||||
HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternet, sFileURL.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
|
||||
if ( NULL == hInternetOpenURL )
|
||||
return -1;
|
||||
// Открытие произошло, проверяем ответ
|
||||
// Opened successfully, check response
|
||||
if ( FALSE == QueryStatusCode ( hInternetOpenURL, TRUE ) )
|
||||
{
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetOpenURL );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Какое колличество байт прочитано
|
||||
// Number of bytes read
|
||||
DWORD dwBytesRead = 0;
|
||||
// Читаем файл
|
||||
// Read file
|
||||
if ( FALSE == InternetReadFile ( hInternetOpenURL, pBuffer, DOWNLOAD_FILE_SIZE, &dwBytesRead ) )
|
||||
{
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetOpenURL );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Закрываем хендл соединения
|
||||
// Close connection handle
|
||||
InternetCloseHandle ( hInternetOpenURL );
|
||||
|
||||
return dwBytesRead;
|
||||
@ -287,93 +290,93 @@ namespace NSNetwork
|
||||
|
||||
BOOL QueryStatusCode ( HINTERNET hInternet, BOOL bIsRanges )
|
||||
{
|
||||
// Зачем проверять у неоткрытой сессии что-то
|
||||
// Why check anything for an unopened session
|
||||
if ( NULL == hInternet )
|
||||
return FALSE;
|
||||
|
||||
// Результат ответа
|
||||
// Response result
|
||||
INT nResult = 0;
|
||||
// Размер данных ответа ( должно быть = 4 )
|
||||
// Response data size (should be = 4)
|
||||
DWORD dwLengthDataSize = 4;
|
||||
|
||||
// Делаем запрос, если не проходит - то возвращаем FALSE
|
||||
// Make request, if it fails - return FALSE
|
||||
if ( FALSE == HttpQueryInfo ( hInternet, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &nResult, &dwLengthDataSize, NULL ) )
|
||||
return FALSE;
|
||||
|
||||
// Запрос прошел, теперь проверяем код ответа
|
||||
// Request succeeded, now check response code
|
||||
if ( HTTP_STATUS_NOT_FOUND == nResult )
|
||||
{
|
||||
// Объект не найден, плохая ссылка или что-то еще
|
||||
// Object not found, bad link or something else
|
||||
return FALSE;
|
||||
}
|
||||
else if ( ( HTTP_STATUS_OK != nResult && FALSE == bIsRanges ) || ( HTTP_STATUS_PARTIAL_CONTENT != nResult && TRUE == bIsRanges ) )
|
||||
{
|
||||
// Запрос не прошел по какой-то причине
|
||||
// Request failed for some reason
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Все отлично, запрос прошел
|
||||
// Everything is fine, request succeeded
|
||||
return TRUE;
|
||||
}
|
||||
// Проверяет, доступно ли для ресурса чтение частями и возвращает -1 если не доступно и размер данных, если доступно
|
||||
// Checks if resource supports reading in chunks and returns -1 if not available, or data size if available
|
||||
LONGLONG IsAccept_Ranges ( HINTERNET hInternet )
|
||||
{
|
||||
// Зачем проверять у неоткрытой сессии что-то
|
||||
// Why check anything for an unopened session
|
||||
if ( NULL == hInternet )
|
||||
return -1;
|
||||
|
||||
// Результат ответа
|
||||
// Response result
|
||||
wchar_t arrResult [ MAX_SIZE ] = { 0 };
|
||||
// Размер данных ответа
|
||||
// Response data size
|
||||
DWORD dwLengthDataSize = sizeof ( arrResult );
|
||||
|
||||
// Делаем запрос, если не проходит - то возвращаем FALSE
|
||||
// Make request, if it fails - return FALSE
|
||||
if ( FALSE == HttpQueryInfoW ( hInternet, HTTP_QUERY_CONTENT_RANGE, &arrResult, &dwLengthDataSize, NULL ) )
|
||||
{
|
||||
// Получаем последнюю ошибку
|
||||
// Get last error
|
||||
DWORD dwLastError = GetLastError ();
|
||||
if ( dwLastError == ERROR_HTTP_HEADER_NOT_FOUND )
|
||||
{
|
||||
// Не пришел заголовок, значит ресурс не поддерживает чтение частями
|
||||
// Header not received, resource doesn't support reading in chunks
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Возникла какая-то другая ошибка - возвращаем FALSE
|
||||
// Some other error occurred - return FALSE
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Если размер 0, то заголовка нет
|
||||
// If size is 0, there is no header
|
||||
if ( 0 >= dwLengthDataSize )
|
||||
return -1;
|
||||
|
||||
// Приведем к std::wstring
|
||||
// Convert to std::wstring
|
||||
std::wstring strResult ( arrResult );
|
||||
|
||||
// Содержит размер данных
|
||||
// Contains data size
|
||||
LONGLONG nFileSize = 0;
|
||||
|
||||
try
|
||||
{
|
||||
// Ищем индекс размера данных в строке
|
||||
// Find data size index in string
|
||||
INT nStartIndex = (INT)strResult.find ( CONTENT_RANGE );
|
||||
if ( -1 == nStartIndex )
|
||||
return -1;
|
||||
|
||||
// Оставляем в строке только размер данных
|
||||
// Leave only data size in string
|
||||
strResult = strResult.substr( nStartIndex + CONTENT_RANGE_SIZE );
|
||||
// Теперь получим размер данных, переводя стринг в LONGLONG
|
||||
// Now get the data size by converting string to LONGLONG
|
||||
nFileSize = _wtoi64 ( strResult.c_str() );
|
||||
// Т.к. реально нумерация с 0 ( поэтому добавляем еще 1 байт )
|
||||
// Since numbering starts from 0 (so we add 1 more byte)
|
||||
if ( 0 < nFileSize )
|
||||
nFileSize += 1;
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
// не нашли возвращаем ошибку
|
||||
// not found, return error
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Все отлично, ресурс поддерживает чтение частями, возвращаем размер
|
||||
// All good, resource supports partial reading, return size
|
||||
return nFileSize;
|
||||
}
|
||||
|
||||
@ -388,7 +391,7 @@ namespace NSNetwork
|
||||
DownloadProgress progress;
|
||||
progress.func_checkAborted = m_check_aborted;
|
||||
progress.func_onProgress = m_func_onProgress;
|
||||
// Скачиваем файл с возвратом процентов состояния
|
||||
// Download file with progress percentage callback
|
||||
return URLDownloadToFileW (NULL, sFileURL.c_str(), strFileOutput.c_str(), NULL, static_cast<IBindStatusCallback*>(&progress));
|
||||
}
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
#include "Session.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include <list>
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _WEB_SOCKET_H_
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "ixwebsocket_internal.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _IX_WEB_SOCKET_H_
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "./../include/websocket.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "socketio_internal_private.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _IO_WEB_SOCKET_H_
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -46,7 +49,7 @@ namespace NSNetwork
|
||||
{
|
||||
public:
|
||||
std::shared_ptr<sio::client> m_socket;
|
||||
// проблема закрытия сокета, пока он не приконнектился
|
||||
// problem closing socket while it's not yet connected
|
||||
bool m_connecting_in_process;
|
||||
bool m_closing_in_progress;
|
||||
|
||||
@ -136,7 +139,7 @@ namespace NSNetwork
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// TODO: пока только текстовые и json команды
|
||||
// TODO: for now only text and json commands
|
||||
switch (message->get_flag())
|
||||
{
|
||||
case sio::message::flag_null:
|
||||
@ -208,7 +211,7 @@ namespace NSNetwork
|
||||
{
|
||||
//CTemporaryCS (&m_internal->m_oCS);
|
||||
|
||||
// если json -то надо объект
|
||||
// if json - then need object
|
||||
if (0 == message_str.find("{") ||
|
||||
0 == message_str.find("["))
|
||||
{
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -50,7 +53,7 @@ namespace NSNetwork
|
||||
{
|
||||
public:
|
||||
std::shared_ptr<sio_no_tls::client> m_socket;
|
||||
// проблема закрытия сокета, пока он не приконнектился
|
||||
// problem closing socket while it's not yet connected
|
||||
bool m_connecting_in_process;
|
||||
bool m_closing_in_progress;
|
||||
|
||||
@ -125,7 +128,7 @@ namespace NSNetwork
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
// TODO: пока только текстовые и json команды
|
||||
// TODO: for now only text and json commands
|
||||
switch (message->get_flag())
|
||||
{
|
||||
case sio_no_tls::message::flag_null:
|
||||
@ -197,7 +200,7 @@ namespace NSNetwork
|
||||
{
|
||||
//CTemporaryCS (&m_internal->m_oCS);
|
||||
|
||||
// если json -то надо объект
|
||||
// if json - then need object
|
||||
if (0 == message_str.find("{") ||
|
||||
0 == message_str.find("["))
|
||||
{
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _SOCKET_ROCKET_H_
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "socketRocket_internal.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _SOCKET_ROCKET_OBJC_H_
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
#ifndef _WEB_WORKER_BASE_H_
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
core_mac:CONFIG += apple_platform
|
||||
core_ios:CONFIG += apple_platform
|
||||
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
TARGET = kernel_network
|
||||
TEMPLATE = lib
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifndef _OFFICEDEFINES_H_
|
||||
#define _OFFICEDEFINES_H_
|
||||
@ -54,19 +57,19 @@ namespace EncodingType
|
||||
const int BigEndian = 51;
|
||||
}
|
||||
|
||||
#define PERMISSION_PRINT ( 1 << 2 ) // Ограничение печати документа
|
||||
#define PERMISSION_CHANGE ( 1 << 3 ) // Ограничение на изменение содержимого документа (текст, графика, картинки)
|
||||
#define PERMISSION_COPY ( 1 << 4 ) // Ограничение на копирование документа и его содержимого
|
||||
#define PERMISSION_PRINT ( 1 << 2 ) // Restriction on document printing
|
||||
#define PERMISSION_CHANGE ( 1 << 3 ) // Restriction on changing document content (text, graphics, images)
|
||||
#define PERMISSION_COPY ( 1 << 4 ) // Restriction on copying document and its content
|
||||
|
||||
//Тип печати
|
||||
const int c_nPrintTypeFit = 0; //вписывать по аспекту
|
||||
const int c_nPrintTypeStrech = 1; //растягивать
|
||||
const int c_nPrintType100 = 2; // печатать как есть
|
||||
//пример xml для функции PrintPage <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings>
|
||||
//enable - 0; diable - 1 ( если атрибут не задан, то он берется как 0 )
|
||||
//ZoomEnable растягивать любой документ до размеров страницы
|
||||
//RotateEnable поворачивать документ,если в повернутом состоянии он будет занимать большую площадь(например при c_nPrintType100) или если в обычном состоянии он не вписывает, а в повернутом вписывается
|
||||
//PrintableAreaEnable печать только в области печати принтера
|
||||
//Print type
|
||||
const int c_nPrintTypeFit = 0; //fit by aspect ratio
|
||||
const int c_nPrintTypeStrech = 1; //stretch
|
||||
const int c_nPrintType100 = 2; // print as is
|
||||
//xml example for PrintPage function <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings>
|
||||
//enable - 0; disable - 1 (if attribute is not set, it defaults to 0)
|
||||
//ZoomEnable stretch any document to page size
|
||||
//RotateEnable rotate document if rotated state takes more area (e.g. with c_nPrintType100) or if normal state doesn't fit but rotated does
|
||||
//PrintableAreaEnable print only in printer's printable area
|
||||
|
||||
namespace TextFormatting
|
||||
{
|
||||
@ -75,7 +78,7 @@ namespace TextFormatting
|
||||
const int c_nWordProcessing = 2;
|
||||
}
|
||||
|
||||
//additional param сохранения нескольких документов в один для IAVSOfficeFileConverter
|
||||
//additional param for saving multiple documents into one for IAVSOfficeFileConverter
|
||||
const int c_nSaveModeNone = 0;
|
||||
const int c_nSaveModeStart = 1;
|
||||
const int c_nSaveModeContinue = 2;
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@ -48,39 +51,39 @@
|
||||
|
||||
// AVSOfficeUniversalConverter 0x0050 - 0x0075
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST (AVS_ERROR_FIRST + 0x0050)
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Входная XML имеет неправильный формат
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Ошибка при создании темповой директории
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Ошибка при удалении темповой директории
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //при добавлении рекламы
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //ошибка при копировании source в destination( копируются когда их тип совпадает )
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //ошибка при копировании source в destination( копируются когда их тип совпадает )
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Input XML has incorrect format
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Error creating temp directory
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Error removing temp directory
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //when adding advertisement
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //error copying source to destination (copied when their types match)
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //error copying source to destination (copied when their types match)
|
||||
|
||||
|
||||
// AVSOfficeFile 0x0075 - 0x00100
|
||||
#define AVS_OFFICEFILE_ERROR_FIRST (AVS_ERROR_FIRST + 0x0075)
|
||||
#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Ошибка при создании темповой директории или файла
|
||||
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //Формат файла не поддерживается
|
||||
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //Формат файла не поддерживается
|
||||
#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //Формат файла не поддерживается
|
||||
#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //печать за границами области печати
|
||||
#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Error creating temp directory or file
|
||||
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //File format is not supported
|
||||
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //File format is not supported
|
||||
#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //File format is not supported
|
||||
#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //printing outside of print area
|
||||
|
||||
//AVSOfficeMsFile
|
||||
#define AVS_MSFILE_ERROR_OLDER (AVS_ERROR_FIRST + 0x0090)
|
||||
|
||||
|
||||
// AVSOdfFile 0x0100 - 0x0200
|
||||
#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Ошибка в входном файле
|
||||
#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Ошибка в шаблоном файле
|
||||
#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Ошибка при конвертации
|
||||
#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Error in input file
|
||||
#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Error in template file
|
||||
#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Error during conversion
|
||||
|
||||
|
||||
// AVSTxtFile 0x0200 - 0x0300
|
||||
#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Ошибка в входном файле
|
||||
#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Ошибка в шаблоном файле
|
||||
#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Ошибка при конвертации
|
||||
#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Error in input file
|
||||
#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Error in template file
|
||||
#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Error during conversion
|
||||
|
||||
// AVSOfficePDFWriter 0x0300 - 0x0400
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "OfficeFileFormatChecker.h"
|
||||
|
||||
@ -113,7 +116,7 @@ bool COfficeFileFormatChecker::isMultiPartsHtmlFormatFile(unsigned char *pBuffer
|
||||
return false;
|
||||
|
||||
const char *contentTypeFormatLine1 = "Content-Type: multipart/related";
|
||||
const char *contentTypeFormatLine2 = "Content-Type: text/html"; // может быть и вне заданого буфера (todooo)
|
||||
const char *contentTypeFormatLine2 = "Content-Type: text/html"; // may be outside the given buffer (todooo)
|
||||
|
||||
std::string xml_string((char *)pBuffer, dwBytes);
|
||||
|
||||
@ -706,7 +709,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
|
||||
std::wstring fileName = _fileName;
|
||||
#endif
|
||||
|
||||
// приоритет как оказывается важен
|
||||
// priority turns out to be important
|
||||
// Metamorphic Manual for windows 28415.doc
|
||||
POLE::Storage storage(fileName.c_str());
|
||||
if (storage.open())
|
||||
@ -719,7 +722,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
|
||||
}
|
||||
else if (isDocFormatFile(&storage))
|
||||
{
|
||||
// nFileType внутри
|
||||
// nFileType inside
|
||||
return true;
|
||||
}
|
||||
else if (isXlsFormatFile(&storage))
|
||||
@ -930,7 +933,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
|
||||
//------------------------------------------------------------------------------------------------
|
||||
if (iXmlFile(fileName))
|
||||
{
|
||||
// nFileType внутри
|
||||
// nFileType inside
|
||||
return true;
|
||||
}
|
||||
//// by Extension
|
||||
@ -978,7 +981,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML;
|
||||
else if (0 == sExt.compare(L".bin")) // base64 string
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_CANVAS_PDF;
|
||||
else if (0 == sExt.compare(L".doct")) // случай архива с html viewer
|
||||
else if (0 == sExt.compare(L".doct")) // case of archive with html viewer
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY;
|
||||
else if (0 == sExt.compare(L".txt") || 0 == sExt.compare(L".xml") || 0 == sExt.compare(L".rtf") || 0 == sExt.compare(L".doc") || 0 == sExt.compare(L".docx"))
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT;
|
||||
@ -1168,7 +1171,7 @@ bool COfficeFileFormatChecker::isDocFormatFile(const std::wstring &fileName)
|
||||
{
|
||||
if (isDocFormatFile(&storage))
|
||||
{
|
||||
// nFileType внутри;
|
||||
// nFileType inside;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1191,7 +1194,7 @@ bool COfficeFileFormatChecker::isOnlyOfficeFormatFile(const std::wstring &fileNa
|
||||
{
|
||||
COfficeUtils OfficeUtils(NULL);
|
||||
|
||||
ULONG nBufferSize = 128; // ограничим считывание из бинарника
|
||||
ULONG nBufferSize = 128; // limit reading from binary
|
||||
BYTE *pBuffer = NULL;
|
||||
|
||||
HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"Editor.bin", &pBuffer, nBufferSize);
|
||||
@ -1541,7 +1544,7 @@ bool COfficeFileFormatChecker::isOpenOfficeFormatFile(const std::wstring &fileNa
|
||||
}
|
||||
else
|
||||
{
|
||||
// если не записан тип смотрим манифест
|
||||
// if type is not written, check manifest
|
||||
nBufferSize = 0;
|
||||
HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"META-INF/manifest.xml", &pBuffer, nBufferSize);
|
||||
if (hresult == S_OK && pBuffer != NULL)
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@ -131,7 +134,7 @@
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION AVS_OFFICESTUDIO_FILE_OTHER + 0x0005
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING AVS_OFFICESTUDIO_FILE_OTHER + 0x0006
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_OOXML AVS_OFFICESTUDIO_FILE_OTHER + 0x0007
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // Для mail-merge
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // For mail-merge
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_ZIP AVS_OFFICESTUDIO_FILE_OTHER + 0x0009
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_ODF AVS_OFFICESTUDIO_FILE_OTHER + 0x000a
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO AVS_OFFICESTUDIO_FILE_OTHER + 0x000b
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
// OfficeFileTemplate.h : Declaration of the CAVSOfficeFileTemplate
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma once // for MSVS
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
VERSION = $$cat(version.txt)
|
||||
|
||||
PRODUCT_VERSION = $$(PRODUCT_VERSION)
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "rbtree.h"
|
||||
#include "rbtreeexception.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "fstream_utils.h"
|
||||
#include "fstream_wrapper.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "stream_utils.h"
|
||||
#include "fstream_wrapper.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,3 +1,36 @@
|
||||
# Copyright (C) Ascensio System SIA, 2009-2026
|
||||
#
|
||||
# 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, together with the
|
||||
# additional terms provided in the LICENSE file.
|
||||
#
|
||||
# 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: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
#
|
||||
# You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
# LV-1050, Latvia, European Union.
|
||||
#
|
||||
# The interactive user interfaces in modified versions of the Program
|
||||
# are required to display Appropriate Legal Notices in accordance with
|
||||
# Section 5 of the GNU AGPL version 3.
|
||||
#
|
||||
# No trademark rights are granted under this License.
|
||||
#
|
||||
# All non-code elements of the Product, including illustrations,
|
||||
# icon sets, and technical writing content, are licensed under the
|
||||
# Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
#
|
||||
# This license applies only to such non-code elements and does not
|
||||
# modify or replace the licensing terms applicable to the Program's
|
||||
# source code, which remains licensed under the GNU Affero General
|
||||
# Public License v3.
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
QT -= core gui
|
||||
|
||||
TARGET = CompoundFileLib
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "cfitem.h"
|
||||
#include "idirectoryentry.h"
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
||||
@ -1,33 +1,36 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* 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.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* 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
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* 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.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* 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
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#include "cfstorage.h"
|
||||
#include "cfexception.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user