Added the unknown content stream decoder...

This commit is contained in:
rpotts%netscape.com 2000-01-08 06:26:13 +00:00
Родитель 023f2ff6e1
Коммит af08de5713
3 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@ -37,6 +37,7 @@ CPPSRCS = \
nsFTPDirListingConv.cpp \
nsConvFactories.cpp \
mozTXTToHTMLConv.cpp \
nsUnknownDecoder.cpp \
$(NULL)
EXPORTS = \

Просмотреть файл

@ -55,6 +55,7 @@ CPP_OBJS = \
.\$(OBJDIR)\nsFTPDirListingConv.obj \
.\$(OBJDIR)\nsConvFactories.obj \
.\$(OBJDIR)\mozTXTToHTMLConv.obj \
.\$(OBJDIR)\nsUnknownDecoder.obj \
$(NULL)
LOCAL_INCLUDES=-I.

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsFTPDirListingConv.h"
#include "nsMultiMixedConv.h"
#include "mozTXTToHTMLConv.h"
#include "nsUnknownDecoder.h"
nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
nsresult NS_NewMultiMixedConv(nsMultiMixedConv** result);
@ -105,6 +106,35 @@ CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult
return rv;
}
#if defined(XP_WIN) || defined(XP_UNIX)
static NS_IMETHODIMP
CreateNewUnknownDecoderFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
nsresult rv;
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
*aResult = nsnull;
if (aOuter) {
return NS_ERROR_NO_AGGREGATION;
}
nsUnknownDecoder *inst;
inst = new nsUnknownDecoder();
if (!inst) {
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(inst);
rv = inst->QueryInterface(aIID, aResult);
NS_RELEASE(inst);
return rv;
}
#endif
// The list of components we register
static nsModuleComponentInfo components[] =
{
@ -131,6 +161,13 @@ static nsModuleComponentInfo components[] =
NS_ISTREAMCONVERTER_KEY "?from=text/plain?to=text/html",
CreateNewTXTToHTMLConvFactory
},
#if defined(XP_WIN) || defined(XP_UNIX)
{ "Unknown Content-Type Decoder",
NS_UNKNOWNDECODER_CID,
NS_ISTREAMCONVERTER_KEY "?from=application/x-unknown-content-type?to=*/*",
CreateNewUnknownDecoderFactory
},
#endif
};
NS_IMPL_NSGETMODULE("nsConvModule", components);