add comment, remove InitUnicodeDecoder method

git-svn-id: svn://10.0.0.236/trunk@20797 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ftang%netscape.com 1999-02-16 18:32:02 +00:00
parent e63ce482f2
commit 2b67a2ec3f
4 changed files with 26 additions and 30 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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;