mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-21 01:10:35 +08:00
39 lines
946 B
C++
39 lines
946 B
C++
#pragma once
|
|
#include "..\Reader\Records.h"
|
|
|
|
class CRecordTextBytesAtom : public CUnknownRecord
|
|
{
|
|
public:
|
|
CString m_strText;
|
|
|
|
public:
|
|
|
|
CRecordTextBytesAtom()
|
|
{
|
|
}
|
|
|
|
~CRecordTextBytesAtom()
|
|
{
|
|
}
|
|
|
|
virtual void ReadFromStream(SRecordHeader oHeader, IStream* pStream)
|
|
{
|
|
m_oHeader = oHeader;
|
|
m_strText = StreamUtils::ReadCString(pStream, m_oHeader.RecLen);
|
|
}
|
|
virtual CString ToString()
|
|
{
|
|
XmlUtils::CXmlWriter oWriter;
|
|
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
|
|
|
|
oWriter.WriteNodeBegin(strName, TRUE);
|
|
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
|
|
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
|
|
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
|
|
oWriter.WriteAttribute(_T("text"), m_strText);
|
|
|
|
oWriter.WriteNodeEnd(strName, TRUE);
|
|
|
|
return oWriter.GetXmlString();
|
|
}
|
|
}; |