/* vim:set expandtab ts=4 sw=2 sts=2 cin: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
NS_IMETHODIMP
nsConverterOutputStream::Flush() { if (!mOutStream) return NS_OK; // Already closed.
// If we are encoding to ISO-2022-JP, potentially // transition back to the ASCII state. The buffer // needs to be large enough for an additional NCR, // though.
uint8_t buffer[12]; auto dst = Span(buffer);
Span<char16_t> src(nullptr);
uint32_t result;
size_t written;
std::tie(result, std::ignore, written, std::ignore) =
mConverter->EncodeFromUTF16(src, dst, true);
MOZ_ASSERT(result == kInputEmpty);
uint32_t streamWritten; if (!written) { return NS_OK;
} return mOutStream->Write(reinterpret_cast<char*>(dst.Elements()), written,
&streamWritten);
}
NS_IMETHODIMP
nsConverterOutputStream::Close() { if (!mOutStream) return NS_OK; // Already closed.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.