Kaydet (Commit) db11071c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fold INetMessageIOStream into INetMIMEMessageStream

Change-Id: I5aa24881d6a4625f1d2249fda8788bb03ef02e27
üst df1c4380
...@@ -110,18 +110,6 @@ public: ...@@ -110,18 +110,6 @@ public:
bool IsHeaderParsed (void) const { return bHeaderParsed; } bool IsHeaderParsed (void) const { return bHeaderParsed; }
}; };
class INetMessageIOStream
: public INetMessageIStream,
public INetMessageOStream
{
INetMessageIOStream (const INetMessageIOStream& rStrm) SAL_DELETED_FUNCTION;
INetMessageIOStream& operator= (const INetMessageIOStream& rStrm) SAL_DELETED_FUNCTION;
public:
INetMessageIOStream (sal_uIntPtr nBufferSize = 2048);
virtual ~INetMessageIOStream (void);
};
enum INetMessageEncoding enum INetMessageEncoding
{ {
INETMSG_ENCODING_7BIT, INETMSG_ENCODING_7BIT,
...@@ -131,7 +119,9 @@ enum INetMessageEncoding ...@@ -131,7 +119,9 @@ enum INetMessageEncoding
INETMSG_ENCODING_BASE64 INETMSG_ENCODING_BASE64
}; };
class TOOLS_DLLPUBLIC INetMIMEMessageStream : public INetMessageIOStream class TOOLS_DLLPUBLIC INetMIMEMessageStream
: public INetMessageIStream,
public INetMessageOStream
{ {
int eState; int eState;
......
...@@ -410,18 +410,6 @@ int INetMessageOStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -410,18 +410,6 @@ int INetMessageOStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
return INETSTREAM_STATUS_OK; return INETSTREAM_STATUS_OK;
} }
// INetMessageIOStream
INetMessageIOStream::INetMessageIOStream(sal_uIntPtr nBufferSize)
: INetMessageIStream (nBufferSize),
INetMessageOStream ()
{
}
INetMessageIOStream::~INetMessageIOStream(void)
{
}
// INetMessageEncodeQPStream_Impl // INetMessageEncodeQPStream_Impl
static const sal_Char hex2pr[16] = { static const sal_Char hex2pr[16] = {
...@@ -1059,7 +1047,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine(const sal_Char* pData, ...@@ -1059,7 +1047,7 @@ int INetMessageDecode64Stream_Impl::PutMsgLine(const sal_Char* pData,
// INetMIMEMessageStream // INetMIMEMessageStream
INetMIMEMessageStream::INetMIMEMessageStream(sal_uIntPtr nBufferSize) INetMIMEMessageStream::INetMIMEMessageStream(sal_uIntPtr nBufferSize)
: INetMessageIOStream(nBufferSize), : INetMessageIStream(nBufferSize),
eState (INETMSG_EOL_BEGIN), eState (INETMSG_EOL_BEGIN),
nChildIndex (0), nChildIndex (0),
pChildStrm (NULL), pChildStrm (NULL),
...@@ -1202,7 +1190,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) ...@@ -1202,7 +1190,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize)
} }
// Generate the message header. // Generate the message header.
int nRead = INetMessageIOStream::GetMsgLine(pData, nSize); int nRead = INetMessageIStream::GetMsgLine(pData, nSize);
if (nRead <= 0) if (nRead <= 0)
{ {
// Reset state. // Reset state.
...@@ -1292,7 +1280,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) ...@@ -1292,7 +1280,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize)
if (eEncoding == INETMSG_ENCODING_7BIT) if (eEncoding == INETMSG_ENCODING_7BIT)
{ {
// No Encoding. // No Encoding.
return INetMessageIOStream::GetMsgLine(pData, nSize); return INetMessageIStream::GetMsgLine(pData, nSize);
} }
// Apply appropriate Encoding. // Apply appropriate Encoding.
...@@ -1346,7 +1334,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -1346,7 +1334,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
if (!IsHeaderParsed()) if (!IsHeaderParsed())
{ {
// Parse the message header. // Parse the message header.
int nRet = INetMessageIOStream::PutMsgLine(pData, nSize); int nRet = INetMessageOStream::PutMsgLine(pData, nSize);
return nRet; return nRet;
} }
else else
...@@ -1381,7 +1369,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -1381,7 +1369,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
return status; return status;
} }
return INetMessageIOStream::PutMsgLine(pData, nSize); return INetMessageOStream::PutMsgLine(pData, nSize);
} }
else else
{ {
...@@ -1452,7 +1440,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -1452,7 +1440,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
else { else {
SAL_WARN( "tools.stream", "Boundary not found." ); SAL_WARN( "tools.stream", "Boundary not found." );
} }
status = INetMessageIOStream::PutMsgLine( status = INetMessageOStream::PutMsgLine(
pOldPos, pChar - pOldPos + 1 ); pOldPos, pChar - pOldPos + 1 );
if( status != INETSTREAM_STATUS_OK ) if( status != INETSTREAM_STATUS_OK )
return status; return status;
...@@ -1487,7 +1475,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -1487,7 +1475,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
// Initialize control variables. // Initialize control variables.
} }
eState = INETMSG_EOL_BEGIN; eState = INETMSG_EOL_BEGIN;
status = INetMessageIOStream::PutMsgLine( status = INetMessageOStream::PutMsgLine(
pOldPos, pChar - pOldPos + 1 ); pOldPos, pChar - pOldPos + 1 );
if( status != INETSTREAM_STATUS_OK ) if( status != INETSTREAM_STATUS_OK )
return status; return status;
...@@ -1541,7 +1529,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize) ...@@ -1541,7 +1529,7 @@ int INetMIMEMessageStream::PutMsgLine(const sal_Char* pData, sal_uIntPtr nSize)
if (eEncoding == INETMSG_ENCODING_7BIT) if (eEncoding == INETMSG_ENCODING_7BIT)
{ {
// No decoding necessary. // No decoding necessary.
return INetMessageIOStream::PutMsgLine(pData, nSize); return INetMessageOStream::PutMsgLine(pData, nSize);
} }
else else
{ {
......
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