Exemplo n.º 1
0
NS_IMETHODIMP
nsPK11Token::ChangePassword(const nsACString& oldPassword,
                            const nsACString& newPassword)
{
  // PK11_ChangePW() has different semantics for the empty string and for
  // nullptr. In order to support this difference, we need to check IsVoid() to
  // find out if our caller supplied null/undefined args or just empty strings.
  // See Bug 447589.
  return MapSECStatus(PK11_ChangePW(
    mSlot.get(),
    oldPassword.IsVoid() ? nullptr : PromiseFlatCString(oldPassword).get(),
    newPassword.IsVoid() ? nullptr : PromiseFlatCString(newPassword).get()));
}
Exemplo n.º 2
0
static void
ConvertString(const nsACString& aUTF8String, nsAString& aUTF16String)
{
  if (aUTF8String.IsVoid()) {
    aUTF16String.SetIsVoid(true);
  } else {
    CopyUTF8toUTF16(aUTF8String, aUTF16String);
  }
}
nsresult calIcalComponent::SetStringProperty(icalproperty_kind kind,
                                             const nsACString &str)
{
    icalvalue *val = nullptr;
    if (!str.IsVoid()) {
        val = icalvalue_new_string(PromiseFlatCString(str).get());
        if (!val)
            return NS_ERROR_OUT_OF_MEMORY;
    }
    return SetPropertyValue(kind, val);
}
Exemplo n.º 4
0
NS_CStringGetIsVoid(const nsACString& aStr)
{
  return aStr.IsVoid();
}