Commit e8574965 authored by ElenaSubbotina's avatar ElenaSubbotina

..

parent 143f65ae
......@@ -37,7 +37,7 @@
namespace CRYPT
{
struct CryptRC4Data
struct _rc4CryptData
{
struct SALT_TAG
{
......
......@@ -37,7 +37,7 @@
namespace CRYPT
{
RC4Decryptor::RC4Decryptor(CryptRC4Data & header, std::wstring _password, int _type) :
RC4Decryptor::RC4Decryptor(_rc4CryptData & header, std::wstring _password, int _type) :
crypt(new RC4Crypt(header, _password, _type))
{
crypt_data = header;
......
......@@ -40,7 +40,7 @@ namespace CRYPT
class RC4Decryptor : public Decryptor
{
public:
RC4Decryptor(CryptRC4Data & header, std::wstring password, int type);
RC4Decryptor(_rc4CryptData & header, std::wstring password, int type);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
virtual bool SetPassword(std::wstring password);
......@@ -50,7 +50,7 @@ namespace CRYPT
private:
int type;
CryptPtr crypt;
CryptRC4Data crypt_data;
_rc4CryptData crypt_data;
};
typedef boost::shared_ptr<RC4Decryptor> RC4DecryptorPtr;
......
......@@ -38,7 +38,7 @@
namespace CRYPT
{
RC4Crypt::RC4Crypt(CRYPT::CryptRC4Data & data, std::wstring password, int type)
RC4Crypt::RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password, int type)
{
m_VerifyPassword = false;
......
......@@ -41,7 +41,7 @@ namespace CRYPT
class RC4Crypt : public Crypt
{
public:
RC4Crypt(CRYPT::CryptRC4Data & data, std::wstring password, int type);
RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password, int type);
virtual void Encrypt(char* data, const size_t size);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
......
......@@ -49,8 +49,8 @@ public:
Version EncryptionVersionInfo;
CRYPT::CryptRC4Data crypt_data_rc4;
CRYPT::ECMADecryptor::_cryptData crypt_data_aes;
CRYPT::_rc4CryptData crypt_data_rc4;
CRYPT::_ecmaCryptData crypt_data_aes;
bool bStandard;
};
......
......@@ -61,8 +61,6 @@ public:
std::wstring GetExtensionByType(int type);
static int GetFormatByExtension(const std::wstring& ext);
private:
bool isOOXFormatFile (const std::wstring & fileName);
bool isOpenOfficeFormatFile (const std::wstring & fileName);
bool isOnlyOfficeFormatFile (const std::wstring & fileName);
......
......@@ -338,85 +338,7 @@ namespace XmlUtils
bool SaveToFile(const std::wstring& strFilePath/*, bool bEncodingToUTF8 = false*/)
{
return NSFile::CFileBinary::SaveToFile(strFilePath, m_str);
//#if defined(_WIN32) || defined (_WIN64)
// // win32 unicode and multibyte strings
// FILE* pFile = _tfopen(strFilePath, (L"wt"));
//#else
// // *nix build
// #ifdef _UNICODE
// std::string sFilePathUtf8 = stringWstingToUtf8String (strFilePath);
// FILE* pFile = fopen(sFilePathUtf8.c_str(), "wt");
// #else
// // path is already utf8
// std::string sFilePathUtf8 = strFilePath;
// FILE* pFile = fopen(sFilePathUtf8.c_str(), "wt");
// #endif
//#endif
//
// if (!pFile)
// return false;
//
// std::string str; str = m_str;
// if (bEncodingToUTF8)
//#ifdef _UNICODE
// str = EncodingUnicodeToUTF8();
//#else
// str = EncodingASCIIToUTF8();
//#endif
//
// fprintf(pFile, str);
//
// fclose(pFile);
//
// return true;
}
//#ifdef _UNICODE
// std::string EncodingUnicodeToUTF8()
// {
// //#if defined(_WIN32) || defined (_WIN64)
// // int nLength = m_str.GetLength();
//
// // // Encoding Unicode to UTF-8
// // std::string saStr;
// // WideCharToMultiByte(CP_UTF8, 0, m_str.GetBuffer(), nLength + 1, saStr.GetBuffer(nLength*3 + 1), nLength*3, NULL, NULL);
// // saStr.ReleaseBuffer();
// // return saStr;
// //#else
//
// std::string sStrTempUtf8 = stringWstingToUtf8String (m_str);
// std::string saStr = sStrTempUtf8;
// return saStr;
// //#endif
// }
//#else
// std::wstring EncodingASCIIToUTF8()
// {
// int nLength = m_str.GetLength();
//
// wchar_t* pWStr = new wchar_t[nLength + 1];
// if (!pWStr)
// return (L"");
//
// // set end string
// pWStr[nLength] = 0;
//
// // Encoding ASCII to Unicode
// MultiByteToWideChar(CP_ACP, 0, m_str, nLength, pWStr, nLength);
//
// int nLengthW = (int) wcslen(pWStr);
//
// // Encoding Unicode to UTF-8
// std::wstring cStr;
// WideCharToMultiByte(CP_UTF8, 0, pWStr, nLengthW + 1, cStr.GetBuffer(nLengthW*3 + 1), nLengthW*3, NULL, NULL);
// cStr.ReleaseBuffer();
//
// delete[] pWStr;
//
// return cStr;
// }
//#endif
void WriteString(const std::wstring& strValue)
{
m_str += strValue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment