Files
core/Common/OfficeFileFormatChecker.h
Sergey.Konovalov 93a49c4d5f преобразование кодировок при открытии/сохранении txt/csv через icu;
перенесена часть логики, в которой нужен FormatFrom, чтобы был только один checker.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64771 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-21 00:32:05 +03:00

57 lines
1.6 KiB
C++

#pragma once
#include <string>
#include "OfficeFileFormats.h"
namespace POLE
{
class Storage;
}
class COfficeFileFormatChecker
{
public:
int nFileType;
COfficeFileFormatChecker()
{
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
}
COfficeFileFormatChecker(std::wstring sFileName)
{
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
isOfficeFile(sFileName);
}
bool isOfficeFile(const std::wstring & fileName);
std::wstring GetFormatExtension(const std::wstring & fileName);
std::wstring GetExtensionByType(int type);
private:
bool isOOXFormatFile (const std::wstring & fileName);
bool isOpenOfficeFormatFile (const std::wstring & fileName);
bool isOnlyOfficeFormatFile (const std::wstring & fileName);
bool isDocFormatFile (POLE::Storage *storage);
bool isXlsFormatFile (POLE::Storage *storage);
bool isPptFormatFile (POLE::Storage *storage);
bool isMS_OFFCRYPTOFormatFile (POLE::Storage * storage);
bool isRtfFormatFile (unsigned char* pBuffer,int dwBytes);
bool isHtmlFormatFile (unsigned char* pBuffer,int dwBytes);
bool isPdfFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryDoctFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryXlstFormatFile (unsigned char* pBuffer,int dwBytes);
bool isBinaryPpttFormatFile (unsigned char* pBuffer,int dwBytes);
bool isDjvuFormatFile(unsigned char* pBuffer,int dwBytes);
bool isMobiFormatFile(unsigned char* pBuffer,int dwBytes);
bool isFB2FormatFile(unsigned char* pBuffer,int dwBytes);
bool isXpsFile(const std::wstring & fileName);
};