Commit 78779482 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

XlsFile2

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63584 954022d7-b5bf-4e40-9824-e11837661b57
parent f6e08db4
...@@ -201,40 +201,43 @@ const std::string bin2str(const char* buf, const size_t nbuf) ...@@ -201,40 +201,43 @@ const std::string bin2str(const char* buf, const size_t nbuf)
} }
const std::wstring guid2bstr(const GUID guid) const std::wstring guid2bstr(const _GUID_ guid)
{ {
LPOLESTR guid_str; //todooooo
if(S_OK != StringFromIID(guid, &guid_str))
{ //LPOLESTR guid_str;
// The only case is E_OUTOFMEMORY, so just throw anything //if(S_OK != StringFromIID(guid, &guid_str))
throw;// EXCEPT::LE::WhatIsTheFuck("StringFromIID failed.", "guid2bstr"); //{
} // // The only case is E_OUTOFMEMORY, so just throw anything
std::wstring guid_ret = guid_str; // throw;// EXCEPT::LE::WhatIsTheFuck("StringFromIID failed.", "guid2bstr");
CoTaskMemFree(guid_str); //}
std::wstring guid_ret;// = guid_str;
//CoTaskMemFree(guid_str);
return guid_ret; return guid_ret;
} }
const std::string guid2str(const GUID guid) const std::string guid2str(const _GUID_ guid)
{ {
std::wstring s = guid2bstr(guid); std::wstring s = guid2bstr(guid);
return std::string(s.begin(),s.end()); return std::string(s.begin(),s.end());
} }
const bool bstr2guid(const std::wstring & guid_str, GUID& guid) const bool bstr2guid(const std::wstring & guid_str, _GUID_& guid)
{ {
HRESULT res = IIDFromString((LPWSTR)(guid_str.c_str()), &guid); //todoooo
if(S_OK != res) //HRESULT res = IIDFromString((LPWSTR)(guid_str.c_str()), &guid);
{ //if(S_OK != res)
switch(res) //{
{ // switch(res)
case E_INVALIDARG: // {
return false; // case E_INVALIDARG:
case E_OUTOFMEMORY: // return false;
throw;// EXCEPT::LE::WhatIsTheFuck("IIDFromString failed.", "bstr2guid"); // case E_OUTOFMEMORY:
} // throw;// EXCEPT::LE::WhatIsTheFuck("IIDFromString failed.", "bstr2guid");
} // }
//}
return true; return true;
} }
......
#pragma once #pragma once
#include "guiddef.h" #include "../../../Common/DocxFormat/Source/Base/Types_32.h"
typedef struct
{
_UINT32 Data1;
_UINT16 Data2;
_UINT16 Data3;
unsigned char Data4[ 8 ];
} _GUID_;
namespace XLS namespace XLS
{ {
...@@ -26,9 +34,9 @@ namespace STR ...@@ -26,9 +34,9 @@ namespace STR
const std::wstring int2wstr(const int val, const int radix = 10); const std::wstring int2wstr(const int val, const int radix = 10);
const std::wstring double2str(const double val); const std::wstring double2str(const double val);
const std::string bin2str(const char* buf, const size_t nbuf); const std::string bin2str(const char* buf, const size_t nbuf);
const std::wstring guid2bstr(const GUID guid); const std::wstring guid2bstr(const _GUID_ guid);
const std::string guid2str(const GUID guid); const std::string guid2str(const _GUID_ guid);
const bool bstr2guid(const std::wstring & guid_str, GUID& guid); const bool bstr2guid(const std::wstring & guid_str, _GUID_& guid);
const std::wstring int2hex_wstr(const int val, const size_t size_of = 4); const std::wstring int2hex_wstr(const int val, const size_t size_of = 4);
const std::wstring wchar_t2hex_str(const wchar_t val); const std::wstring wchar_t2hex_str(const wchar_t val);
const std::wstring escapeUrlW(const std::wstring& str); const std::wstring escapeUrlW(const std::wstring& str);
......
...@@ -110,26 +110,26 @@ public: ...@@ -110,26 +110,26 @@ public:
CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(long& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(long& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(double& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(double& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(GUID& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(_GUID_& val) { loadAnyData(val); return *this; };
//CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }; //CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(short& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(short& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }; CFRecord& operator>>(char& val) { loadAnyData(val); return *this; };
CFRecord& operator>>(bool& val); CFRecord& operator>>(bool& val);
CFRecord& operator>>(std::wstring & val); CFRecord& operator>>(std::wstring & val);
CFRecord& operator<<(unsigned char& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(unsigned char& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(unsigned short& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(unsigned short& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(long& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(long& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(double& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(double& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(GUID& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(_GUID_& val) { storeAnyData(val); return *this; };
//CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }; //CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(short& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(short& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(char& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(char& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; }; CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; };
CFRecord& operator<<(bool& val); CFRecord& operator<<(bool& val);
CFRecord& operator<<(std::wstring & val); CFRecord& operator<<(std::wstring & val);
......
...@@ -11,20 +11,20 @@ ...@@ -11,20 +11,20 @@
namespace XLS namespace XLS
{; {;
CFStream::CFStream(IStream* stream) CFStream::CFStream(POLE::Stream* stream)
: stream_(stream)
{ {
if(NULL == stream) if(NULL == stream)
{ {
throw;// EXCEPT::RT::CompoundFileFormatError("Wrong IStream pointer (NULL)"); throw;// EXCEPT::RT::CompoundFileFormatError("Wrong IStream pointer (NULL)");
} }
stream_ = stream;
} }
CFStream::~CFStream() CFStream::~CFStream()
{ {
stream_->Commit(0); if (stream_) delete stream_;
stream_->Release(); stream_ = NULL;
} }
...@@ -35,17 +35,11 @@ void CFStream::read(void* buf, const size_t size) ...@@ -35,17 +35,11 @@ void CFStream::read(void* buf, const size_t size)
{ {
throw;// EXCEPT::RT::CompoundFileFormatError("Wrong buffer pointer (NULL)"); throw;// EXCEPT::RT::CompoundFileFormatError("Wrong buffer pointer (NULL)");
} }
ULONG num_read = 0; POLE::uint64 num_read = stream_->read((unsigned char*)buf, size);
HRESULT hres = stream_->Read(buf, size, &num_read);
if(FAILED(hres))
{
std::wstringstream str;
str << L"Impossible to read " << size << L" unsigned chars from \"" << getStreamName() << L"\" stream";
throw;// EXCEPT::RT::CompoundFileFormatError(str.str(), hres);
}
if(num_read < size) if(num_read < size)
{ {
throw;// EXCEPT::RT::EndOfStreamReached(getStreamName(), num_read, size); throw;// EXCEPT::RT::EndOfStreamReached(stream_->fullName(), num_read, size);
} }
// Tipa successful // Tipa successful
} }
...@@ -58,12 +52,11 @@ void CFStream::write(const void* buf, const size_t size) ...@@ -58,12 +52,11 @@ void CFStream::write(const void* buf, const size_t size)
{ {
throw;// EXCEPT::RT::CompoundFileFormatError("Wrong buffer pointer (NULL)"); throw;// EXCEPT::RT::CompoundFileFormatError("Wrong buffer pointer (NULL)");
} }
ULONG num_written = 0; POLE::uint64 num_written = stream_->write((unsigned char*)buf, size);
HRESULT hres = stream_->Write(buf, size, &num_written); if(num_written != size)
if(FAILED(hres))
{ {
std::wstringstream str; //std::wstringstream str;
str << L"Impossible to write " << size << L" unsigned chars to \"" << getStreamName() << L"\" stream"; //str << L"Impossible to write " << size << L" unsigned chars to \"" << stream_->fullName() << L"\" stream";
throw;// EXCEPT::RT::CompoundFileFormatError(str.str(), hres); throw;// EXCEPT::RT::CompoundFileFormatError(str.str(), hres);
} }
if(num_written < size) if(num_written < size)
...@@ -86,71 +79,39 @@ const bool CFStream::isEOF() const ...@@ -86,71 +79,39 @@ const bool CFStream::isEOF() const
// Stream pointer // Stream pointer
const unsigned long CFStream::getStreamPointer() const const unsigned long CFStream::getStreamPointer() const
{ {
LARGE_INTEGER null_ptr; POLE::uint64 pos = stream_->tell();
null_ptr.QuadPart = 0; return pos;
ULARGE_INTEGER seek_ptr;
stream_->Seek(null_ptr, STREAM_SEEK_CUR, &seek_ptr);
return seek_ptr.QuadPart;
} }
void CFStream::seekFromCurForward(const size_t offset) void CFStream::seekFromCurForward(const size_t offset)
{ {
LARGE_INTEGER seek_ptr; POLE::uint64 pos = offset + stream_->tell();
seek_ptr.QuadPart = offset;
stream_->Seek(seek_ptr, STREAM_SEEK_CUR, NULL); stream_->seek(pos);
} }
void CFStream::seekFromBegin(const unsigned long offset) void CFStream::seekFromBegin(const unsigned long offset)
{ {
LARGE_INTEGER seek_ptr; POLE::uint64 pos = offset;
seek_ptr.QuadPart = offset;
HRESULT result = stream_->Seek(seek_ptr, STREAM_SEEK_SET, NULL); stream_->seek(pos);
} }
void CFStream::seekToEnd() void CFStream::seekToEnd()
{ {
LARGE_INTEGER seek_ptr; stream_->seek(stream_->size());
seek_ptr.QuadPart = 0;
HRESULT result = stream_->Seek(seek_ptr, STREAM_SEEK_END, NULL);
} }
// Stream current size // Stream current size
const unsigned long CFStream::getStreamSize() const const unsigned long CFStream::getStreamSize() const
{ {
STATSTG info; return stream_->size();
stream_->Stat(&info, STATFLAG_DEFAULT);
return info.cbSize.QuadPart;
} }
// Stream name
//const std::string CFStream::getStreamName() const
//{
// STATSTG info;
// HRESULT hres = stream_->Stat(&info, STATFLAG_DEFAULT);
// if(FAILED(hres))
// {
// Log::warning("Can't obtain the name of the Compound File stream");
// return "";
// }
// return static_cast<char*>(std::wstring (info.pwcsName));
//}
const std::wstring CFStream::getStreamName() const
{
STATSTG info;
HRESULT hres = stream_->Stat(&info, STATFLAG_DEFAULT);
if(FAILED(hres))
{
Log::warning("Can't obtain the name of the Compound File stream");
return L"";
}
return std::wstring (info.pwcsName);
}
void CFStream::writeAndApplyDelayedItems(void* buf, const size_t size, const ReceiverItems& receiver_items_from_record, const SourceItems& source_items_from_record) void CFStream::writeAndApplyDelayedItems(void* buf, const size_t size, const ReceiverItems& receiver_items_from_record, const SourceItems& source_items_from_record)
{ {
appendDelayedItems(receiver_items_from_record, source_items_from_record); appendDelayedItems(receiver_items_from_record, source_items_from_record);
......
#pragma once #pragma once
#include "objidl.h" #include "../../../Common/3dParty/pole/pole.h"
#include "CFRecordType.h" #include "CFRecordType.h"
#include "BinSmartPointers.h" #include "BinSmartPointers.h"
...@@ -12,7 +13,7 @@ namespace XLS ...@@ -12,7 +13,7 @@ namespace XLS
class CFStream class CFStream
{ {
public: public:
CFStream(IStream* stream); CFStream(POLE::Stream* stream);
~CFStream(); ~CFStream();
template<class Type> template<class Type>
...@@ -64,14 +65,11 @@ public: ...@@ -64,14 +65,11 @@ public:
void appendDelayedItems(const ReceiverItems& receiver_items_from_record, const SourceItems& source_items_from_record); void appendDelayedItems(const ReceiverItems& receiver_items_from_record, const SourceItems& source_items_from_record);
void applyDelayedItems(); void applyDelayedItems();
private:
// Stream name
const std::wstring getStreamName() const;
private: private:
IStream* stream_; POLE::Stream * stream_;
CFStream::ReceiverItems receiver_items; CFStream::ReceiverItems receiver_items;
CFStream::SourceItems source_items; CFStream::SourceItems source_items;
}; };
} // namespace XLS } // namespace XLS
......
...@@ -10,120 +10,94 @@ namespace XLS ...@@ -10,120 +10,94 @@ namespace XLS
CompoundFile::~CompoundFile() CompoundFile::~CompoundFile()
{ {
storage_->Commit(0);
streams.clear(); streams.clear();
storage_->Release();
if (storage_)delete storage_;
storage_ = NULL;
} }
CompoundFile::CompoundFile(const std::wstring & file_path, const ReadWriteMode mode) CompoundFile::CompoundFile(const std::wstring & file_path, const ReadWriteMode mode)
: rwMode(mode) : rwMode(mode)
{ {
HRESULT hres = S_OK;
unsigned int grfMode = 0; unsigned int grfMode = 0;
storage_ = new POLE::Storage(file_path.c_str());
if (storage_ == NULL) return;
switch(rwMode) switch(rwMode)
{ {
case cf_ReadMode: case cf_ReadMode:
hres = StgIsStorageFile(file_path.c_str()); {
switch(hres) if (storage_->open(false, false) == false)
{ throw;
case S_FALSE:
throw;// EXCEPT::RT::CompoundFileFormatError("The specified file \"" + std::string(static_cast<char*>(file_path)) + "\" is not a valid Compound File.", hres);; }break;
case STG_E_FILENOTFOUND:
throw;// EXCEPT::RT::CompoundFileFormatError("Not found the path \"" + std::string(static_cast<char*>(file_path)) + "\"", hres);;
}
grfMode = STGM_READ | STGM_DIRECT | STGM_SHARE_DENY_WRITE;
if(FAILED( hres = StgOpenStorage(file_path.c_str(), NULL, grfMode, NULL, 0, &storage_)))
{
throw;// EXCEPT::RT::CompoundFileFormatError("Error opening \"" + std::string(static_cast<char*>(file_path)) + "\"", hres);
}
break;
case cf_WriteMode: case cf_WriteMode:
grfMode = STGM_CREATE | STGM_READWRITE | STGM_SIMPLE | STGM_SHARE_EXCLUSIVE; {
if(FAILED( hres = StgCreateStorageEx(file_path.c_str(), grfMode, STGFMT_STORAGE, 0, NULL, NULL, if (storage_->open(true, true) == false)
IID_IStorage, reinterpret_cast<void**>(&storage_)))) throw;
{ }break;
throw;// EXCEPT::RT::CompoundFileFormatError("Error creating \"" + std::string(static_cast<char*>(file_path)) + "\"", hres);
}
break;
} }
/*
IEnumSTATSTG* storageInfo = NULL;
if(FAILED(hres = storage_->EnumElements(0, 0, 0, &storageInfo)))
{
throw 1;
}
Log::info("The Compound File contains the following streams:");
STATSTG elem;
while(S_OK == storageInfo->Next(1, &elem, 0))
{
Log::info(std::string("name: \"") + static_cast<char*>(std::wstring (elem.pwcsName)) + "\" type: " + STR::int2str(elem.type) + " size: " +
STR::int2hex_wstr(elem.cbSize.HighPart) + STR::int2hex_wstr(elem.cbSize.LowPart));
}
*/
} }
// Opens "Workbook" stream and returns the only reference // Opens "Workbook" stream and returns the only reference
CFStreamPtr CompoundFile::getWorkbookStream() CFStreamPtr CompoundFile::getWorkbookStream()
{ {
return getNamedStream(L"Workbook"); return getNamedStream("Workbook");
} }
// Creates "Workbook" stream and returns the only reference // Creates "Workbook" stream and returns the only reference
CFStreamPtr CompoundFile::createWorkbookStream() CFStreamPtr CompoundFile::createWorkbookStream()
{ {
return createNamedStream(L"Workbook"); return createNamedStream("Workbook");
} }
// Opens "SummaryInformation" stream and returns the only reference // Opens "SummaryInformation" stream and returns the only reference
CFStreamPtr CompoundFile::getSummaryInformationStream() CFStreamPtr CompoundFile::getSummaryInformationStream()
{ {
return getNamedStream(L"\005SummaryInformation"); return getNamedStream("\005SummaryInformation");
} }
// Creates "SummaryInformation" stream and returns the only reference // Creates "SummaryInformation" stream and returns the only reference
CFStreamPtr CompoundFile::createSummaryInformationStream() CFStreamPtr CompoundFile::createSummaryInformationStream()
{ {
return createNamedStream(L"\005SummaryInformation"); return createNamedStream("\005SummaryInformation");
} }
// Closes "SummaryInformation" stream // Closes "SummaryInformation" stream
void CompoundFile::closeSummaryInformationStream() void CompoundFile::closeSummaryInformationStream()
{ {
return closeNamedStream(L"\005SummaryInformation"); return closeNamedStream("\005SummaryInformation");
} }
// Opens "SummaryInformation" stream and returns the only reference // Opens "SummaryInformation" stream and returns the only reference
CFStreamPtr CompoundFile::getDocumentSummaryInformationStream() CFStreamPtr CompoundFile::getDocumentSummaryInformationStream()
{ {
return getNamedStream(L"\005DocumentSummaryInformation"); return getNamedStream("\005DocumentSummaryInformation");
} }
// Creates "SummaryInformation" stream and returns the only reference // Creates "SummaryInformation" stream and returns the only reference
CFStreamPtr CompoundFile::createDocumentSummaryInformationStream() CFStreamPtr CompoundFile::createDocumentSummaryInformationStream()
{ {
return createNamedStream(L"\005DocumentSummaryInformation"); return createNamedStream("\005DocumentSummaryInformation");
} }
// Closes "SummaryInformation" stream // Closes "SummaryInformation" stream
void CompoundFile::closeDocumentSummaryInformationStream() void CompoundFile::closeDocumentSummaryInformationStream()
{ {
closeNamedStream(L"\005DocumentSummaryInformation"); closeNamedStream("\005DocumentSummaryInformation");
} }
CFStreamPtr CompoundFile::getNamedStream(const std::wstring& name) CFStreamPtr CompoundFile::getNamedStream(const std::string& name)
{ {
if(!streams[name]) if(!streams[name])
{ {
...@@ -133,7 +107,7 @@ CFStreamPtr CompoundFile::getNamedStream(const std::wstring& name) ...@@ -133,7 +107,7 @@ CFStreamPtr CompoundFile::getNamedStream(const std::wstring& name)
} }
CFStreamPtr CompoundFile::createNamedStream(const std::wstring& name) CFStreamPtr CompoundFile::createNamedStream(const std::string& name)
{ {
if(!streams[name]) if(!streams[name])
{ {
...@@ -143,18 +117,17 @@ CFStreamPtr CompoundFile::createNamedStream(const std::wstring& name) ...@@ -143,18 +117,17 @@ CFStreamPtr CompoundFile::createNamedStream(const std::wstring& name)
} }
void CompoundFile::closeNamedStream(const std::wstring& name) void CompoundFile::closeNamedStream(const std::string& name)
{ {
streams[name].reset(); streams[name].reset();
} }
// Opens a stream in the storage (shall be called not more than once per stream) // Opens a stream in the storage (shall be called not more than once per stream)
IStream* CompoundFile::openStream(const std::wstring & stream_name) POLE::Stream* CompoundFile::openStream(const std::string & stream_name)
{ {
IStream* pStream = NULL; POLE::Stream* pStream = new POLE::Stream(storage_, stream_name);
HRESULT hres = storage_->OpenStream(stream_name.c_str(), NULL, STGM_READ | STGM_DIRECT | STGM_SHARE_EXCLUSIVE, NULL, &pStream ); if(pStream == NULL)
if(FAILED(hres))
{ {
throw;// EXCEPT::RT::CompoundFileFormatError(std::string("Error opening \"") + static_cast<char*>(stream_name) + "\" stream", hres); throw;// EXCEPT::RT::CompoundFileFormatError(std::string("Error opening \"") + static_cast<char*>(stream_name) + "\" stream", hres);
} }
...@@ -163,11 +136,10 @@ IStream* CompoundFile::openStream(const std::wstring & stream_name) ...@@ -163,11 +136,10 @@ IStream* CompoundFile::openStream(const std::wstring & stream_name)
// Creates a new stream in the storage // Creates a new stream in the storage
IStream* CompoundFile::createStream(const std::wstring & stream_name) POLE::Stream* CompoundFile::createStream(const std::string & stream_name)
{ {
IStream* pStream = NULL; POLE::Stream* pStream = new POLE::Stream(storage_, stream_name, true);
HRESULT hres = storage_->CreateStream(stream_name.c_str(), STGM_READWRITE | STGM_SHARE_EXCLUSIVE, NULL, NULL, &pStream); if(pStream == NULL)
if(FAILED(hres))
{ {
throw;// EXCEPT::RT::CompoundFileFormatError(std::string("Error creating \"") + static_cast<char*>(stream_name) + "\" stream", hres); throw;// EXCEPT::RT::CompoundFileFormatError(std::string("Error creating \"") + static_cast<char*>(stream_name) + "\" stream", hres);
} }
......
#pragma once #pragma once
#include "objidl.h" #include "../../../Common/3dParty/pole/pole.h"
#include "BinSmartPointers.h" #include "BinSmartPointers.h"
#include <map> #include <map>
...@@ -27,24 +28,24 @@ public: ...@@ -27,24 +28,24 @@ public:
CFStreamPtr getSummaryInformationStream(); CFStreamPtr getSummaryInformationStream();
CFStreamPtr createSummaryInformationStream(); CFStreamPtr createSummaryInformationStream();
void closeSummaryInformationStream(); void closeSummaryInformationStream();
CFStreamPtr getDocumentSummaryInformationStream(); CFStreamPtr getDocumentSummaryInformationStream();
CFStreamPtr createDocumentSummaryInformationStream(); CFStreamPtr createDocumentSummaryInformationStream();
void closeDocumentSummaryInformationStream(); void closeDocumentSummaryInformationStream();
private: private:
IStream* openStream (const std::wstring & stream_name); // Opens a stream in the storage (shall be called not more than once per stream) POLE::Stream* openStream (const std::string & stream_name); // Opens a stream in the storage (shall be called not more than once per stream)
IStream* createStream (const std::wstring & stream_name); // Creates a new stream in the storage POLE::Stream* createStream (const std::string & stream_name); // Creates a new stream in the storage
CFStreamPtr getNamedStream (const std::wstring& name); CFStreamPtr getNamedStream (const std::string& name);
CFStreamPtr createNamedStream (const std::wstring& name); CFStreamPtr createNamedStream (const std::string& name);
void closeNamedStream (const std::wstring& name); void closeNamedStream (const std::string& name);
private: private:
std::map<std::wstring, CFStreamPtr> streams; std::map<std::string, CFStreamPtr> streams;
IStorage* storage_; POLE::Storage *storage_;
ReadWriteMode rwMode; ReadWriteMode rwMode;
}; };
} // namespace XLS } // namespace XLS
......
...@@ -327,6 +327,14 @@ ...@@ -327,6 +327,14 @@
RelativePath="..\XlsFormat\Binary\CompoundFile.h" RelativePath="..\XlsFormat\Binary\CompoundFile.h"
> >
</File> </File>
<File
RelativePath="..\..\..\Common\3dParty\pole\pole.cpp"
>
</File>
<File
RelativePath="..\..\..\Common\3dParty\pole\pole.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Logic" Name="Logic"
......
...@@ -283,14 +283,6 @@ ...@@ -283,14 +283,6 @@
RelativePath="..\..\..\Common\DocxFormat\Source\SystemUtility\FileSystem\Directory.cpp" RelativePath="..\..\..\Common\DocxFormat\Source\SystemUtility\FileSystem\Directory.cpp"
> >
</File> </File>
<File
RelativePath="..\..\..\Common\3dParty\pole\pole.cpp"
>
</File>
<File
RelativePath="..\..\..\Common\3dParty\pole\pole.h"
>
</File>
<File <File
RelativePath="..\common\simple_xml_writer.h" RelativePath="..\common\simple_xml_writer.h"
> >
......
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