本文整理汇总了C++中nsAutoString::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoString::Append方法的具体用法?C++ nsAutoString::Append怎么用?C++ nsAutoString::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAutoString
的用法示例。
在下文中一共展示了nsAutoString::Append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBoxName
void
nsBox::ListBox(nsAutoString& aResult)
{
nsAutoString name;
GetBoxName(name);
char addr[100];
sprintf(addr, "[@%p] ", static_cast<void*>(this));
aResult.AppendASCII(addr);
aResult.Append(name);
aResult.Append(' ');
nsIContent* content = GetContent();
// add on all the set attributes
if (content) {
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
nsCOMPtr<nsIDOMMozNamedAttrMap> namedMap;
node->GetAttributes(getter_AddRefs(namedMap));
uint32_t length;
namedMap->GetLength(&length);
nsCOMPtr<nsIDOMAttr> attribute;
for (uint32_t i = 0; i < length; ++i)
{
namedMap->Item(i, getter_AddRefs(attribute));
attribute->GetName(name);
nsAutoString value;
attribute->GetValue(value);
AppendAttribute(name, value, aResult);
}
}
}
示例2:
NS_IMETHODIMP
nsHTMLFormatConverter::ConvertFromHTMLToAOLMail(const nsAutoString & aFromStr,
nsAutoString & aToStr)
{
aToStr.AssignLiteral("<HTML>");
aToStr.Append(aFromStr);
aToStr.AppendLiteral("</HTML>");
return NS_OK;
}
示例3: AppendValue
nsresult
mozSqlResultMysql::AppendKeys(Row* aRow, nsAutoString& aKeys)
{
PRInt32 i;
for (i = 0; i < mColumnInfo.Count(); i++) {
if (((ColumnInfo*)mColumnInfo[i])->mIsPrimaryKey){
if (i){
aKeys.Append(NS_LITERAL_STRING(" AND "));
}
aKeys.Append(((ColumnInfo*)mColumnInfo[i])->mName);
aKeys.Append(PRUnichar('='));
Cell* cell = aRow->mCells[i];
AppendValue(cell, aKeys);
}
}
return NS_OK;
}
示例4: Serialize
void Serialize(const nsCString& aInput)
{
const unsigned char* p = (const unsigned char*) aInput.get();
while (p && *p) {
// ' ' to '+'
if (*p == 0x20) {
mValue.Append(0x2B);
// Percent Encode algorithm
} else if (*p == 0x2A || *p == 0x2D || *p == 0x2E ||
(*p >= 0x30 && *p <= 0x39) ||
(*p >= 0x41 && *p <= 0x5A) || *p == 0x5F ||
(*p >= 0x61 && *p <= 0x7A)) {
mValue.Append(*p);
} else {
mValue.AppendPrintf("%%%X", *p);
}
++p;
}
}
示例5: email
nsresult
nsNSSCertificate::FormatUIStrings(const nsAutoString &nickname, nsAutoString &nickWithSerial, nsAutoString &details)
{
if (!NS_IsMainThread()) {
NS_ERROR("nsNSSCertificate::FormatUIStrings called off the main thread");
return NS_ERROR_NOT_SAME_THREAD;
}
nsresult rv = NS_OK;
nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID, &rv));
if (NS_FAILED(rv) || !nssComponent) {
return NS_ERROR_FAILURE;
}
nsAutoString info;
nsAutoString temp1;
nickWithSerial.Append(nickname);
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertInfoIssuedFor", info))) {
details.Append(info);
details.Append(PRUnichar(' '));
if (NS_SUCCEEDED(GetSubjectName(temp1)) && !temp1.IsEmpty()) {
details.Append(temp1);
}
details.Append(PRUnichar('\n'));
}
if (NS_SUCCEEDED(GetSerialNumber(temp1)) && !temp1.IsEmpty()) {
details.AppendLiteral(" ");
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertDumpSerialNo", info))) {
details.Append(info);
details.AppendLiteral(": ");
}
details.Append(temp1);
nickWithSerial.AppendLiteral(" [");
nickWithSerial.Append(temp1);
nickWithSerial.Append(PRUnichar(']'));
details.Append(PRUnichar('\n'));
}
nsCOMPtr<nsIX509CertValidity> validity;
rv = GetValidity(getter_AddRefs(validity));
if (NS_SUCCEEDED(rv) && validity) {
details.AppendLiteral(" ");
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertInfoValid", info))) {
details.Append(info);
}
if (NS_SUCCEEDED(validity->GetNotBeforeLocalTime(temp1)) && !temp1.IsEmpty()) {
details.Append(PRUnichar(' '));
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertInfoFrom", info))) {
details.Append(info);
details.Append(PRUnichar(' '));
}
details.Append(temp1);
}
if (NS_SUCCEEDED(validity->GetNotAfterLocalTime(temp1)) && !temp1.IsEmpty()) {
details.Append(PRUnichar(' '));
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertInfoTo", info))) {
details.Append(info);
details.Append(PRUnichar(' '));
}
details.Append(temp1);
}
details.Append(PRUnichar('\n'));
}
if (NS_SUCCEEDED(GetKeyUsagesString(mCert, nssComponent, temp1)) && !temp1.IsEmpty()) {
details.AppendLiteral(" ");
if (NS_SUCCEEDED(nssComponent->GetPIPNSSBundleString("CertDumpKeyUsage", info))) {
details.Append(info);
details.AppendLiteral(": ");
}
details.Append(temp1);
details.Append(PRUnichar('\n'));
}
nsAutoString firstEmail;
const char *aWalkAddr;
for (aWalkAddr = CERT_GetFirstEmailAddress(mCert)
;
aWalkAddr
;
aWalkAddr = CERT_GetNextEmailAddress(mCert, aWalkAddr))
{
NS_ConvertUTF8toUTF16 email(aWalkAddr);
if (email.IsEmpty())
continue;
if (firstEmail.IsEmpty()) {
/*
* If the first email address from the subject DN is also present
* in the subjectAltName extension, GetEmailAddresses() will return
//.........这里部分代码省略.........