当前位置: 首页>>代码示例>>C++>>正文


C++ AppendToString函数代码示例

本文整理汇总了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=", "]");
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:7,代码来源:Layers.cpp

示例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;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:16,代码来源:nsXMLContentSerializer.cpp

示例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);
        }
    }
}
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:27,代码来源:nsHTMLContentSerializer.cpp

示例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;
}
开发者ID:AOSC-Dev,项目名称:Pale-Moon,代码行数:47,代码来源:nsXHTMLContentSerializer.cpp

示例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));
  }
开发者ID:aliverobotics,项目名称:Pumas-SmallSize,代码行数:17,代码来源:utility.c

示例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;
}
开发者ID:nightahul,项目名称:gecko-dev,代码行数:17,代码来源:Layers.cpp

示例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);
    }
  }
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:46,代码来源:nsXHTMLContentSerializer.cpp

示例8: AppendToString

nsACString&
RefLayer::PrintInfo(nsACString& aTo, const char* aPrefix)
{
  ContainerLayer::PrintInfo(aTo, aPrefix);
  if (0 != mId) {
    AppendToString(aTo, mId, " [id=", "]");
  }
  return aTo;
}
开发者ID:nightahul,项目名称:gecko-dev,代码行数:9,代码来源:Layers.cpp

示例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);
  }
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:19,代码来源:parsefun.c

示例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;
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:20,代码来源:Layers.cpp

示例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);
  }
开发者ID:aliverobotics,项目名称:Pumas-SmallSize,代码行数:20,代码来源:parsefun.c

示例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());
  }
}
开发者ID:marshall,项目名称:gecko-dev,代码行数:20,代码来源:ContentHost.cpp

示例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());
  }
}
开发者ID:brendanlong,项目名称:gecko-dev,代码行数:20,代码来源:ContentHost.cpp

示例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);
}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:41,代码来源:nsXHTMLContentSerializer.cpp

示例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;
}
开发者ID:sahlberg,项目名称:timberwolf,代码行数:12,代码来源:Layers.cpp


注:本文中的AppendToString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。