got newlines working much better; Kipp still won't be happy, but the, he never is.

git-svn-id: svn://10.0.0.236/trunk@928 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg
1998-04-30 20:23:07 +00:00
parent e9b6d10641
commit 1253f68df0
28 changed files with 1132 additions and 1012 deletions

View File

@@ -22,13 +22,13 @@
#include "string.h"
/**-------------------------------------------------------
/**
* Default constructor
*
* @update gess 3/25/98
* @param aToken -- token to init internal token
* @return
*------------------------------------------------------*/
*/
nsCParserNode::nsCParserNode(CHTMLToken* aToken): nsIParserNode(),
mName(), mEmptyString() {
NS_PRECONDITION(0!=aToken, "Null Token");
@@ -38,25 +38,25 @@ nsCParserNode::nsCParserNode(CHTMLToken* aToken): nsIParserNode(),
}
/**-------------------------------------------------------
/**
* default destructor
*
* @update gess 3/25/98
* @param
* @return
*------------------------------------------------------*/
*/
nsCParserNode::~nsCParserNode() {
}
/**-------------------------------------------------------
/**
* Causes the given attribute to be added to internal
* mAttributes list, and mAttributeCount to be incremented.
*
* @update gess 3/25/98
* @param aToken -- token to be added to attr list
* @return
*------------------------------------------------------*/
*/
void nsCParserNode::AddAttribute(CHTMLToken* aToken) {
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes), "Buffer overrun!");
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
@@ -66,7 +66,7 @@ void nsCParserNode::AddAttribute(CHTMLToken* aToken) {
}
/**-------------------------------------------------------
/**
* This method gets called when the parser encounters
* skipped content after a start token.
* NOTE: To determine if we have skipped content, simply
@@ -75,7 +75,7 @@ void nsCParserNode::AddAttribute(CHTMLToken* aToken) {
* @update gess 3/26/98
* @param aToken -- really a skippedcontent token
* @return nada
*------------------------------------------------------*/
*/
void nsCParserNode::SetSkippedContent(CHTMLToken* aToken){
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes)-1, "Buffer overrun!");
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
@@ -85,38 +85,38 @@ void nsCParserNode::SetSkippedContent(CHTMLToken* aToken){
}
/**-------------------------------------------------------
/**
* Gets the name of this node. Currently unused.
*
* @update gess 3/25/98
* @param
* @return string ref containing node name
*------------------------------------------------------*/
*/
const nsString& nsCParserNode::GetName() const {
return mName;
}
/**-------------------------------------------------------
/**
* Get text value of this node, which translates into
* getting the text value of the underlying token
*
* @update gess 3/25/98
* @param
* @return string ref of text from internal token
*------------------------------------------------------*/
*/
const nsString& nsCParserNode::GetText() const {
return mToken->GetText();
}
/**-------------------------------------------------------
/**
* Get text value of this node, which translates into
* getting the text value of the underlying token
*
* @update gess 3/25/98
* @param
* @return string ref of text from internal token
*------------------------------------------------------*/
*/
const nsString& nsCParserNode::GetSkippedContent() const {
if (0 < mAttributeCount) {
if(mAttributes[mAttributeCount-1]) {
@@ -129,51 +129,51 @@ const nsString& nsCParserNode::GetSkippedContent() const {
return mEmptyString;
}
/**-------------------------------------------------------
/**
* Get node type, meaning, get the tag type of the
* underlying token
*
* @update gess 3/25/98
* @param
* @return int value that represents tag type
*------------------------------------------------------*/
*/
PRInt32 nsCParserNode::GetNodeType(void) const{
return mToken->GetHTMLTag();
}
/**-------------------------------------------------------
/**
* Gets the token type, which corresponds to a value from
* eHTMLTags_xxx.
*
* @update gess 3/25/98
* @param
* @return
*------------------------------------------------------*/
*/
PRInt32 nsCParserNode::GetTokenType(void) const{
return mToken->GetTokenType();
}
/**-------------------------------------------------------
/**
* Retrieve the number of attributes on this node
*
* @update gess 3/25/98
* @param
* @return int -- representing attribute count
*------------------------------------------------------*/
*/
PRInt32 nsCParserNode::GetAttributeCount(void) const{
return mAttributeCount;
}
/**-------------------------------------------------------
/**
* Retrieve the string rep of the attribute key at the
* given index.
*
* @update gess 3/25/98
* @param anIndex-- offset of attribute to retrieve
* @return string rep of given attribute text key
*------------------------------------------------------*/
*/
const nsString& nsCParserNode::GetKeyAt(PRInt32 anIndex) const {
NS_PRECONDITION(anIndex<mAttributeCount, "Bad attr index");
CAttributeToken* tkn=(CAttributeToken*)(mAttributes[anIndex]);
@@ -181,13 +181,13 @@ const nsString& nsCParserNode::GetKeyAt(PRInt32 anIndex) const {
}
/**-------------------------------------------------------
/**
* Retrieve the string rep of the attribute at given offset
*
* @update gess 3/25/98
* @param anIndex-- offset of attribute to retrieve
* @return string rep of given attribute text value
*------------------------------------------------------*/
*/
const nsString& nsCParserNode::GetValueAt(PRInt32 anIndex) const {
NS_PRECONDITION(anIndex<mAttributeCount, "Bad attr index");
return (mAttributes[anIndex])->GetText();