本文整理汇总了C++中AppendToString函数的典型用法代码示例。如果您正苦于以下问题:C++ AppendToString函数的具体用法?C++ AppendToString怎么用?C++ AppendToString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AppendToString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendToString
nsACString&
ThebesLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
{
Layer::PrintInfo(aTo, aPrefix);
return mValidRegion.IsEmpty() ?
aTo : AppendToString(aTo, mValidRegion, " [valid=", "]");
}
示例2: NS_ENSURE_ARG
NS_IMETHODIMP
nsXMLContentSerializer::AppendCDATASection(nsIDOMCDATASection* aCDATASection,
PRInt32 aStartOffset,
PRInt32 aEndOffset,
nsAString& aStr)
{
NS_ENSURE_ARG(aCDATASection);
nsresult rv;
AppendToString(NS_LITERAL_STRING("<![CDATA["), aStr);
rv = AppendTextData(aCDATASection, aStartOffset, aEndOffset, aStr, PR_FALSE, PR_TRUE);
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
AppendToString(NS_LITERAL_STRING("]]>"), aStr);
return NS_OK;
}
示例3: AppendToString
void
nsHTMLContentSerializer::EndIndentation(nsIAtom* aName,
PRBool aHasDirtyAttr,
nsAString& aStr)
{
if ((aName == nsGkAtoms::head) ||
(aName == nsGkAtoms::table) ||
(aName == nsGkAtoms::tr) ||
(aName == nsGkAtoms::ul) ||
(aName == nsGkAtoms::ol) ||
(aName == nsGkAtoms::dl) ||
(aName == nsGkAtoms::li) ||
(aName == nsGkAtoms::tbody) ||
(aName == nsGkAtoms::form) ||
(aName == nsGkAtoms::blockquote) ||
(aName == nsGkAtoms::dt) ||
(aName == nsGkAtoms::dd) ||
(aName == nsGkAtoms::frameset)) {
mIndent--;
}
if ((mDoFormat || aHasDirtyAttr) && !mPreLevel && !mColPos) {
for (PRInt32 i = mIndent; --i >= 0; ) {
AppendToString(kIndentStr, aStr);
}
}
}
示例4: NS_ENSURE_TRUE
bool
nsXHTMLContentSerializer::AfterElementStart(nsIContent* aContent,
nsIContent* aOriginalElement,
nsAString& aStr)
{
nsIAtom *name = aContent->Tag();
if (aContent->GetNameSpaceID() == kNameSpaceID_XHTML &&
mRewriteEncodingDeclaration &&
name == nsGkAtoms::head) {
// Check if there already are any content-type meta children.
// If there are, they will be modified to use the correct charset.
// If there aren't, we'll insert one here.
bool hasMeta = false;
for (nsIContent* child = aContent->GetFirstChild();
child;
child = child->GetNextSibling()) {
if (child->IsHTML(nsGkAtoms::meta) &&
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
nsAutoString header;
child->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, header);
if (header.LowerCaseEqualsLiteral("content-type")) {
hasMeta = true;
break;
}
}
}
if (!hasMeta) {
NS_ENSURE_TRUE(AppendNewLineToString(aStr), false);
if (mDoFormat) {
NS_ENSURE_TRUE(AppendIndentation(aStr), false);
}
NS_ENSURE_TRUE(AppendToString(NS_LITERAL_STRING("<meta http-equiv=\"content-type\""), aStr), false);
NS_ENSURE_TRUE(AppendToString(NS_LITERAL_STRING(" content=\"text/html; charset="), aStr), false);
NS_ENSURE_TRUE(AppendToString(NS_ConvertASCIItoUTF16(mCharset), aStr), false);
if (mIsHTMLSerializer) {
NS_ENSURE_TRUE(AppendToString(NS_LITERAL_STRING("\">"), aStr), false);
} else {
NS_ENSURE_TRUE(AppendToString(NS_LITERAL_STRING("\" />"), aStr), false);
}
}
}
return true;
}
示例5: AppendToString
globle char *AppendStrings(
void *theEnv,
char *str1,
char *str2)
{
int pos = 0;
unsigned max = 0;
char *theString = NULL;
void *thePtr;
theString = AppendToString(theEnv,str1,theString,&pos,&max);
theString = AppendToString(theEnv,str2,theString,&pos,&max);
thePtr = EnvAddSymbol(theEnv,theString);
rm(theEnv,theString,max);
return(ValueToString(thePtr));
}
示例6: PrintInfo
static nsACString&
PrintInfo(nsACString& aTo, LayerComposite* aLayerComposite)
{
if (!aLayerComposite) {
return aTo;
}
if (const nsIntRect* clipRect = aLayerComposite->GetShadowClipRect()) {
AppendToString(aTo, *clipRect, " [shadow-clip=", "]");
}
if (!aLayerComposite->GetShadowTransform().IsIdentity()) {
AppendToString(aTo, aLayerComposite->GetShadowTransform(), " [shadow-transform=", "]");
}
if (!aLayerComposite->GetShadowVisibleRegion().IsEmpty()) {
AppendToString(aTo, aLayerComposite->GetShadowVisibleRegion(), " [shadow-visible=", "]");
}
return aTo;
}
示例7: AppendNewLineToString
void
nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
nsIDOMElement *aOriginalElement,
nsAString& aStr)
{
nsIAtom *name = aContent->Tag();
if (aContent->GetNameSpaceID() == kNameSpaceID_XHTML &&
mRewriteEncodingDeclaration &&
name == nsGkAtoms::head) {
// Check if there already are any content-type meta children.
// If there are, they will be modified to use the correct charset.
// If there aren't, we'll insert one here.
PRBool hasMeta = PR_FALSE;
PRUint32 i, childCount = aContent->GetChildCount();
for (i = 0; i < childCount; ++i) {
nsIContent* child = aContent->GetChildAt(i);
if (child->IsHTML() &&
child->Tag() == nsGkAtoms::meta &&
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
nsAutoString header;
child->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, header);
if (header.LowerCaseEqualsLiteral("content-type")) {
hasMeta = PR_TRUE;
break;
}
}
}
if (!hasMeta) {
AppendNewLineToString(aStr);
if (mDoFormat) {
AppendIndentation(aStr);
}
AppendToString(NS_LITERAL_STRING("<meta http-equiv=\"content-type\""),
aStr);
AppendToString(NS_LITERAL_STRING(" content=\"text/html; charset="), aStr);
AppendToString(NS_ConvertASCIItoUTF16(mCharset), aStr);
if (mIsHTMLSerializer)
AppendToString(NS_LITERAL_STRING("\">"), aStr);
else
AppendToString(NS_LITERAL_STRING("\" />"), aStr);
}
}
}
示例8: AppendToString
nsACString&
RefLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
{
ContainerLayer::PrintInfo(aTo, aPrefix);
if (0 != mId) {
AppendToString(aTo, mId, " [id=", "]");
}
return aTo;
}
示例9: PrintErrorCapture
static int PrintErrorCapture(
char *logicalName,
char *str)
{
if (strcmp(logicalName,WERROR) == 0)
{
ErrorString = AppendToString(str,ErrorString,
&ErrorCurrentPosition,
&ErrorMaximumPosition);
}
else if (strcmp(logicalName,WWARNING) == 0)
{
WarningString = AppendToString(str,WarningString,
&WarningCurrentPosition,
&WarningMaximumPosition);
}
return(1);
}
示例10: nsPrintfCString
nsACString&
Layer::PrintInfo(nsACString& aTo, const char* aPrefix)
{
aTo += aPrefix;
aTo += nsPrintfCString(64, "%s%s (0x%p)", mManager->Name(), Name(), this);
if (mUseClipRect) {
AppendToString(aTo, mClipRect, " [clip=", "]");
}
if (!mTransform.IsIdentity())
AppendToString(aTo, mTransform, " [transform=", "]");
if (!mVisibleRegion.IsEmpty())
AppendToString(aTo, mVisibleRegion, " [visible=", "]");
if (1.0 != mOpacity)
aTo.AppendPrintf(" [opacity=%g]", mOpacity);
if (IsOpaqueContent())
aTo += " [opaqueContent]";
return aTo;
}
示例11: PrintErrorCapture
static int PrintErrorCapture(
void *theEnv,
char *logicalName,
char *str)
{
if (strcmp(logicalName,WERROR) == 0)
{
ParseFunctionData(theEnv)->ErrorString = AppendToString(theEnv,str,ParseFunctionData(theEnv)->ErrorString,
&ParseFunctionData(theEnv)->ErrorCurrentPosition,
&ParseFunctionData(theEnv)->ErrorMaximumPosition);
}
else if (strcmp(logicalName,WWARNING) == 0)
{
ParseFunctionData(theEnv)->WarningString = AppendToString(theEnv,str,ParseFunctionData(theEnv)->WarningString,
&ParseFunctionData(theEnv)->WarningCurrentPosition,
&ParseFunctionData(theEnv)->WarningMaximumPosition);
}
return(1);
}
示例12: nsPrintfCString
void
ContentHostTexture::PrintInfo(std::stringstream& aStream, const char* aPrefix)
{
aStream << aPrefix;
aStream << nsPrintfCString("ContentHost (0x%p)", this).get();
AppendToString(aStream, mBufferRect, " [buffer-rect=", "]");
AppendToString(aStream, mBufferRotation, " [buffer-rotation=", "]");
if (PaintWillResample()) {
aStream << " [paint-will-resample]";
}
if (mTextureHost) {
nsAutoCString pfx(aPrefix);
pfx += " ";
aStream << "\n";
mTextureHost->PrintInfo(aStream, pfx.get());
}
}
示例13: nsPrintfCString
void
DeprecatedContentHostSingleBuffered::PrintInfo(nsACString& aTo, const char* aPrefix)
{
aTo += aPrefix;
aTo += nsPrintfCString("DeprecatedContentHostSingleBuffered (0x%p)", this);
AppendToString(aTo, mBufferRect, " [buffer-rect=", "]");
AppendToString(aTo, mBufferRotation, " [buffer-rotation=", "]");
if (PaintWillResample()) {
aTo += " [paint-will-resample]";
}
nsAutoCString pfx(aPrefix);
pfx += " ";
if (mDeprecatedTextureHost) {
aTo += "\n";
mDeprecatedTextureHost->PrintInfo(aTo, pfx.get());
}
}
示例14: NS_ASSERTION
void
nsXHTMLContentSerializer::AppendEndOfElementStart(nsIContent *aOriginalElement,
nsIAtom * aName,
PRInt32 aNamespaceID,
nsAString& aStr)
{
// this method is not called by nsHTMLContentSerializer
// so we don't have to check HTML element, just XHTML
NS_ASSERTION(!mIsHTMLSerializer, "nsHTMLContentSerializer shouldn't call this method !");
if (kNameSpaceID_XHTML != aNamespaceID) {
nsXMLContentSerializer::AppendEndOfElementStart(aOriginalElement, aName,
aNamespaceID, aStr);
return;
}
nsIContent* content = aOriginalElement;
// for non empty elements, even if they are not a container, we always
// serialize their content, because the XHTML element could contain non XHTML
// nodes useful in some context, like in an XSLT stylesheet
if (HasNoChildren(content)) {
nsIParserService* parserService = nsContentUtils::GetParserService();
if (parserService) {
bool isContainer;
parserService->
IsContainer(parserService->HTMLCaseSensitiveAtomTagToId(aName),
isContainer);
if (!isContainer) {
// for backward compatibility with HTML 4 user agents
// only non-container HTML elements can be closed immediatly,
// and a space is added before />
AppendToString(NS_LITERAL_STRING(" />"), aStr);
return;
}
}
}
AppendToString(kGreaterThan, aStr);
}
示例15: AppendToString
nsACString&
ThebesLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
{
Layer::PrintInfo(aTo, aPrefix);
if (!mValidRegion.IsEmpty()) {
AppendToString(aTo, mValidRegion, " [valid=", "]");
}
if (mXResolution != 1.0 || mYResolution != 1.0) {
aTo.AppendPrintf(" [xres=%g yres=%g]", mXResolution, mYResolution);
}
return aTo;
}