mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
39 lines
791 B
C++
39 lines
791 B
C++
#pragma once
|
|
|
|
#include "VirtualStreamReader.h"
|
|
#include "ByteStructure.h"
|
|
|
|
namespace DocFileFormat
|
|
{
|
|
class WideString: public wstring, public ByteStructure
|
|
{
|
|
public:
|
|
WideString( VirtualStreamReader reader, int length ): wstring()
|
|
{
|
|
}
|
|
|
|
WideString(): wstring()
|
|
{
|
|
}
|
|
|
|
virtual ~WideString()
|
|
{
|
|
}
|
|
|
|
virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length )
|
|
{
|
|
WideString* newObject = new WideString();
|
|
|
|
unsigned char *bytes = NULL;
|
|
bytes = reader->ReadBytes( length, true );
|
|
|
|
//It's a real string table
|
|
FormatUtils::GetSTLCollectionFromBytes<WideString>( newObject, bytes, length, ENCODING_UNICODE );
|
|
|
|
RELEASEARRAYOBJECTS( bytes );
|
|
|
|
return static_cast<ByteStructure*>( newObject );
|
|
}
|
|
};
|
|
}
|