您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AppendToString函数代码示例

51自学网 2021-06-01 19:47:21
  C++
这篇教程C++ AppendToString函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AppendToString函数的典型用法代码示例。如果您正苦于以下问题:C++ AppendToString函数的具体用法?C++ AppendToString怎么用?C++ AppendToString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AppendToString函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,


示例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,


示例3: AppendToString

voidnsHTMLContentSerializer::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,


示例4: NS_ENSURE_TRUE

boolnsXHTMLContentSerializer::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,


示例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,


示例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,


示例7: AppendNewLineToString

voidnsXHTMLContentSerializer::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,


示例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,


示例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,


示例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,


示例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,


示例12: nsPrintfCString

voidContentHostTexture::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,


示例13: nsPrintfCString

voidDeprecatedContentHostSingleBuffered::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,


示例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,


示例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,


示例16: NS_ENSURE_ARG

NS_IMETHODIMPnsHTMLContentSerializer::AppendText(nsIDOMText* aText,                                    PRInt32 aStartOffset,                                    PRInt32 aEndOffset,                                    nsAString& aStr){    NS_ENSURE_ARG(aText);    if (mNeedLineBreaker) {        mNeedLineBreaker = PR_FALSE;        nsCOMPtr<nsIDOMDocument> domDoc;        aText->GetOwnerDocument(getter_AddRefs(domDoc));        nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);    }    nsAutoString data;    nsresult rv;    rv = AppendTextData((nsIDOMNode*)aText, aStartOffset,                        aEndOffset, data, PR_TRUE, PR_FALSE);    if (NS_FAILED(rv))        return NS_ERROR_FAILURE;    if (mPreLevel > 0) {        AppendToStringConvertLF(data, aStr);    }    else if (mFlags & nsIDocumentEncoder::OutputRaw) {        PRInt32 lastNewlineOffset = data.RFindChar('/n');        AppendToString(data, aStr);        if (lastNewlineOffset != kNotFound)            mColPos = data.Length() - lastNewlineOffset;    }    else if (!mDoFormat) {        PRInt32 lastNewlineOffset = kNotFound;        PRBool hasLongLines = HasLongLines(data, lastNewlineOffset);        if (hasLongLines) {            // We have long lines, rewrap            AppendToStringWrapped(data, aStr, PR_FALSE);            if (lastNewlineOffset != kNotFound)                mColPos = data.Length() - lastNewlineOffset;        }        else {            AppendToStringConvertLF(data, aStr);        }    }    else {        AppendToStringWrapped(data, aStr, PR_FALSE);    }    return NS_OK;}
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:52,


示例17: do_QueryInterface

nsresultnsXMLContentSerializer::AppendTextData(nsIDOMNode* aNode,                                        PRInt32 aStartOffset,                                       PRInt32 aEndOffset,                                       nsAString& aStr,                                       PRBool aTranslateEntities,                                       PRBool aIncrColumn){  nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);  const nsTextFragment* frag;  if (!content || !(frag = content->GetText())) {    return NS_ERROR_FAILURE;  }  PRInt32 endoffset = (aEndOffset == -1) ? frag->GetLength() : aEndOffset;  PRInt32 length = endoffset - aStartOffset;  NS_ASSERTION(aStartOffset >= 0, "Negative start offset for text fragment!");  NS_ASSERTION(aStartOffset <= endoffset, "A start offset is beyond the end of the text fragment!");  if (length <= 0) {    // XXX Zero is a legal value, maybe non-zero values should be an    // error.    return NS_OK;  }      if (frag->Is2b()) {    const PRUnichar *strStart = frag->Get2b() + aStartOffset;    AppendToString(Substring(strStart, strStart + length), aStr,                   aTranslateEntities, aIncrColumn);  }  else {    AppendToString(NS_ConvertASCIItoUTF16(frag->Get1b()+aStartOffset, length),                   aStr, aTranslateEntities, aIncrColumn);  }  return NS_OK;}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:39,


示例18: AppendToString

voidAppendToString(std::stringstream& aStream, const EventRegions& e,               const char* pfx, const char* sfx){  aStream << pfx << "{";  if (!e.mHitRegion.IsEmpty()) {    AppendToString(aStream, e.mHitRegion, " hitregion=", "");  }  if (!e.mDispatchToContentHitRegion.IsEmpty()) {    AppendToString(aStream, e.mDispatchToContentHitRegion, " dispatchtocontentregion=", "");  }  if (!e.mNoActionRegion.IsEmpty()) {    AppendToString(aStream, e.mNoActionRegion, " NoActionRegion=","");  }  if (!e.mHorizontalPanRegion.IsEmpty()) {    AppendToString(aStream, e.mHorizontalPanRegion, " HorizontalPanRegion=", "");  }  if (!e.mVerticalPanRegion.IsEmpty()) {    AppendToString(aStream, e.mVerticalPanRegion, " VerticalPanRegion=", "");  }  aStream << "}" << sfx;}
开发者ID:valenting,项目名称:gecko-dev,代码行数:22,


示例19: SavePPBuffer

globle void SavePPBuffer(  void *theEnv,  EXEC_STATUS,  char *str)  {   size_t increment;   /*==========================================*/   /* If the pretty print buffer isn't needed, */   /* then don't bother writing to it.         */   /*==========================================*/   if ((PrettyPrintData(theEnv,execStatus)->PPBufferStatus == OFF) || (! PrettyPrintData(theEnv,execStatus)->PPBufferEnabled))      { return; }   /*===============================*/   /* Determine the increment size. */   /*===============================*/   increment = 512;   if (PrettyPrintData(theEnv,execStatus)->PPBufferPos > increment)     { increment = PrettyPrintData(theEnv,execStatus)->PPBufferPos * 3; }   /*================================================*/   /* If the pretty print buffer isn't big enough to */   /* contain the string, then increase its size.    */   /*================================================*/   if (strlen(str) + PrettyPrintData(theEnv,execStatus)->PPBufferPos + 1 >= PrettyPrintData(theEnv,execStatus)->PPBufferMax)     {      PrettyPrintData(theEnv,execStatus)->PrettyPrintBuffer =          (char *) genrealloc(theEnv,execStatus,PrettyPrintData(theEnv,execStatus)->PrettyPrintBuffer,                                    PrettyPrintData(theEnv,execStatus)->PPBufferMax,                                    PrettyPrintData(theEnv,execStatus)->PPBufferMax + increment);      PrettyPrintData(theEnv,execStatus)->PPBufferMax += increment;     }   /*==================================================*/   /* Remember the previous tokens saved to the pretty */   /* print buffer in case it is necessary to back up. */   /*==================================================*/   PrettyPrintData(theEnv,execStatus)->PPBackupTwice = PrettyPrintData(theEnv,execStatus)->PPBackupOnce;   PrettyPrintData(theEnv,execStatus)->PPBackupOnce = PrettyPrintData(theEnv,execStatus)->PPBufferPos;   /*=============================================*/   /* Save the string to the pretty print buffer. */   /*=============================================*/   PrettyPrintData(theEnv,execStatus)->PrettyPrintBuffer = AppendToString(theEnv,execStatus,str,PrettyPrintData(theEnv,execStatus)->PrettyPrintBuffer,&PrettyPrintData(theEnv,execStatus)->PPBufferPos,&PrettyPrintData(theEnv,execStatus)->PPBufferMax);  }
开发者ID:atrniv,项目名称:CLIPS,代码行数:51,


示例20: AppendToString

nsACString&AppendToString(nsACString& s, const nsIntRegion& r,               const char* pfx, const char* sfx){  s += pfx;  nsIntRegionRectIterator it(r);  s += "< ";  while (const nsIntRect* sr = it.Next())    AppendToString(s, *sr) += "; ";  s += ">";  return s += sfx;}
开发者ID:JuannyWang,项目名称:gecko-dev,代码行数:14,


示例21: nsPrintfCString

voidImageHost::PrintInfo(std::stringstream& aStream, const char* aPrefix){  aStream << aPrefix;  aStream << nsPrintfCString("ImageHost (0x%p)", this).get();  nsAutoCString pfx(aPrefix);  pfx += "  ";  for (auto& img : mImages) {    aStream << "/n";    img.mTextureHost->PrintInfo(aStream, pfx.get());    AppendToString(aStream, img.mPictureRect, " [picture-rect=", "]");  }}
开发者ID:ollie314,项目名称:gecko-dev,代码行数:14,


示例22: nsPrintfCString

voidDeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix){  aTo += aPrefix;  aTo += nsPrintfCString("DeprecatedImageHostSingle (0x%p)", this);  AppendToString(aTo, mPictureRect, " [picture-rect=", "]");  if (mDeprecatedTextureHost) {    nsAutoCString pfx(aPrefix);    pfx += "  ";    aTo += "/n";    mDeprecatedTextureHost->PrintInfo(aTo, pfx.get());  }}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:15,



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


C++ AppendUTF8toUTF16函数代码示例
C++ AppendText函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。