[[nodiscard]] inline size_t read(std::istream& Stream, const range<char*>& Buffer) { { const auto Exceptions = Stream.exceptions(); Stream.exceptions(Exceptions & ~(Stream.failbit | Stream.eofbit)); SCOPE_EXIT{ Stream.exceptions(Exceptions); }; Stream.read(Buffer.data(), Buffer.size()); if (!Stream.bad() && Stream.eof()) Stream.clear(); } return Stream.gcount(); }
void DialogBuilder::AddButtons(range<const lng*> const Buttons, size_t const OkIndex, size_t const CancelIndex) { base::AddButtons(static_cast<int>(Buttons.size()), reinterpret_cast<const int*>(Buttons.data()), static_cast<int>(OkIndex), static_cast<int>(CancelIndex)); }