add comment, remove InitUnicodeDecoder method

This commit is contained in:
ftang%netscape.com 1999-02-16 18:32:02 +00:00
Родитель 7f9bb9b776
Коммит 3de1f86877
4 изменённых файлов: 26 добавлений и 30 удалений

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

@ -34,6 +34,8 @@ const int kBufsize=1;
const int kBufsize=64;
#endif
// #define DEFAULTCHARSET "Shift_JIS"
#define DEFAULTCHARSET "ISO-8859-1"
/**
* Use this constructor if you want i/o to be based on
@ -53,8 +55,9 @@ nsScanner::nsScanner(nsString& anHTMLString) :
mOffset=0;
mMarkPos=-1;
mFileStream=0;
nsAutoString defaultCharset(DEFAULTCHARSET);
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
SetDocumentCharset(defaultCharset);
}
/**
@ -88,7 +91,8 @@ nsScanner::nsScanner(nsString& aFilename,PRBool aCreateStream) :
#endif
} //if
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
nsAutoString defaultCharset(DEFAULTCHARSET);
SetDocumentCharset(defaultCharset);
}
@ -111,12 +115,7 @@ nsScanner::nsScanner(nsString& aFilename,fstream& aStream,PRBool assumeOwnership
mOwnsStream=assumeOwnership;
mFileStream=&aStream;
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
}
void nsScanner::InitUnicodeDecoder()
{
nsAutoString defaultCharset("ISO-8859-1");
nsAutoString defaultCharset(DEFAULTCHARSET);
SetDocumentCharset(defaultCharset);
}

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

@ -267,8 +267,12 @@ class nsScanner {
static void SelfTest();
/**
* Change the charset and the Unicode Decoder
*/
* Use this setter to change the scanner's unicode decoder
*
* @update ftang 2/12/99
* @param aCharset a normalized (alias resolved) charset name
* @return
*/
nsresult SetDocumentCharset(const nsString& aCharset);
protected:
@ -283,11 +287,6 @@ class nsScanner {
*/
nsresult FillBuffer(void);
/**
* Initialize the charset and the Unicode Decoder
*/
void InitUnicodeDecoder();
fstream* mFileStream;
nsString mBuffer;
nsString mFilename;

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

@ -34,6 +34,8 @@ const int kBufsize=1;
const int kBufsize=64;
#endif
// #define DEFAULTCHARSET "Shift_JIS"
#define DEFAULTCHARSET "ISO-8859-1"
/**
* Use this constructor if you want i/o to be based on
@ -53,8 +55,9 @@ nsScanner::nsScanner(nsString& anHTMLString) :
mOffset=0;
mMarkPos=-1;
mFileStream=0;
nsAutoString defaultCharset(DEFAULTCHARSET);
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
SetDocumentCharset(defaultCharset);
}
/**
@ -88,7 +91,8 @@ nsScanner::nsScanner(nsString& aFilename,PRBool aCreateStream) :
#endif
} //if
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
nsAutoString defaultCharset(DEFAULTCHARSET);
SetDocumentCharset(defaultCharset);
}
@ -111,12 +115,7 @@ nsScanner::nsScanner(nsString& aFilename,fstream& aStream,PRBool assumeOwnership
mOwnsStream=assumeOwnership;
mFileStream=&aStream;
mUnicodeDecoder = nsnull;
InitUnicodeDecoder();
}
void nsScanner::InitUnicodeDecoder()
{
nsAutoString defaultCharset("ISO-8859-1");
nsAutoString defaultCharset(DEFAULTCHARSET);
SetDocumentCharset(defaultCharset);
}

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

@ -267,8 +267,12 @@ class nsScanner {
static void SelfTest();
/**
* Change the charset and the Unicode Decoder
*/
* Use this setter to change the scanner's unicode decoder
*
* @update ftang 2/12/99
* @param aCharset a normalized (alias resolved) charset name
* @return
*/
nsresult SetDocumentCharset(const nsString& aCharset);
protected:
@ -283,11 +287,6 @@ class nsScanner {
*/
nsresult FillBuffer(void);
/**
* Initialize the charset and the Unicode Decoder
*/
void InitUnicodeDecoder();
fstream* mFileStream;
nsString mBuffer;
nsString mFilename;