129
edits
m (→Strings: end the sentence:)) |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 33: | Line 33: | ||
<span class="highlightblue">+ StringBeginsWith(someString, NS_LITERAL_CSTRING("imap://");</span> | <span class="highlightblue">+ StringBeginsWith(someString, NS_LITERAL_CSTRING("imap://");</span> | ||
The following applies to both nsXPIDLString and nsXPIDLCString. This class is going away when we use frozen linkage so we want to replace it with If you are changing an interface such that somemethod now takes a nsAString / nsACString then you don't need the getter_Copies either: | The following applies to both nsXPIDLString and nsXPIDLCString. This class is going away when we use frozen linkage so we want to replace it with nsString and nsCString. If you are changing an interface such that somemethod now takes a nsAString / nsACString then you don't need the getter_Copies either: | ||
<span class="highlightred">- nsXPIDLString strValue; | <span class="highlightred">- nsXPIDLString strValue; | ||
Line 43: | Line 43: | ||
nsCString charValue; | nsCString charValue; | ||
<span class="highlightred">- uniValue.Assign(NS_ConvertASCIItoUTF16(charValue));</span> | <span class="highlightred">- uniValue.Assign(NS_ConvertASCIItoUTF16(charValue));</span> | ||
<span class="highlightblue">+ CopyASCIItoUTF16( | <span class="highlightblue">+ CopyASCIItoUTF16(charValue, uniValue);</span> | ||
nsCString charValue; | nsCString charValue; | ||
Line 49: | Line 49: | ||
<span class="highlightred">- charValue.AssignWithConversion(uniValue);</span> | <span class="highlightred">- charValue.AssignWithConversion(uniValue);</span> | ||
<span class="highlightblue">+ LossyCopyUTF16toASCII(uniValue, charValue);</span> | <span class="highlightblue">+ LossyCopyUTF16toASCII(uniValue, charValue);</span> | ||
The append methods like AppendUTF8toUTF16 are not available in the frozen linkage world: | |||
nsCString charValue; | |||
nsString uniValue; | |||
<span class="highlightred">- AppendUTF8toUTF16(charVAlue, uniValue);</span> | |||
<span class="highlightblue">+ uniValue.Append(NS_ConvertUTF8toUTF16(charValue));</span> | |||
nsCString charStr; | nsCString charStr; | ||
Line 65: | Line 72: | ||
<span class="highlightred">- if (nsCRT::strncmp("imap:", charStr, 5))</span> | <span class="highlightred">- if (nsCRT::strncmp("imap:", charStr, 5))</span> | ||
<span class="highlightblue">+ if (!StringBeginsWith(charStr, NS_LITERAL_CSTRING("imap:")))</span> | <span class="highlightblue">+ if (!StringBeginsWith(charStr, NS_LITERAL_CSTRING("imap:")))</span> | ||
Replacement of case-insensitive checking code: | |||
<span class="highlightred">- char *strA; | |||
- char *strB; | |||
- if (PL_strncasaecmp(strA, strB)) { | |||
... | |||
- }</span> | |||
<span class="highlightblue">+ nsACString strA; | |||
+ nsACString strB; | |||
+ if (strA.Equals(strB, nsCaseInsensitiveCStringComparator())) { | |||
... | |||
+ } | |||
+ | |||
+ nsString strA; | |||
+ nsString strB; | |||
+ if (strA.Equals(strB, nsCaseInsensitiveStringComparator())) { | |||
... | |||
+ }</span> | |||
== nsCOMPtr == | == nsCOMPtr == |
edits