PRBool test_concat_2() { nsCString fieldTextStr("xyz"); nsCString text("text"); const nsACString& aText = text; nsCAutoString result( fieldTextStr + aText ); if (strcmp(result.get(), "xyztext") == 0) return PR_TRUE; printf("[result=%s]\n", result.get()); return PR_FALSE; }
bool test_concat_2() { nsCString fieldTextStr("xyz"); nsCString text("text"); const nsACString& aText = text; nsAutoCString result( fieldTextStr + aText ); if (strcmp(result.get(), "xyztext") == 0) return true; printf("[result=%s]\n", result.get()); return false; }
void nsXBLProtoImplField::AppendFieldText(const nsAString& aText) { if (mFieldText) { nsDependentString fieldTextStr(mFieldText, mFieldTextLength); nsAutoString newFieldText = fieldTextStr + aText; PRUnichar* temp = mFieldText; mFieldText = ToNewUnicode(newFieldText); mFieldTextLength = newFieldText.Length(); nsMemory::Free(temp); } else { mFieldText = ToNewUnicode(aText); mFieldTextLength = aText.Length(); } }