| 334 | int64_t bytes_read_; |
| 335 | |
| 336 | bool check_closed() { |
| 337 | if (closed_) { |
| 338 | return true; |
| 339 | } |
| 340 | |
| 341 | auto is_open_result = SafeCallIntoR<bool>( |
| 342 | [&]() { |
| 343 | cpp11::sexp result = cpp11::package("base")["isOpen"](connection_sexp_); |
| 344 | return cpp11::as_cpp<bool>(result); |
| 345 | }, |
| 346 | "isOpen() on R connection"); |
| 347 | |
| 348 | if (!is_open_result.ok()) { |
| 349 | closed_ = true; |
| 350 | } else { |
| 351 | closed_ = !is_open_result.ValueUnsafe(); |
| 352 | } |
| 353 | |
| 354 | return closed_; |
| 355 | } |
| 356 | |
| 357 | bool check_seekable() { |
| 358 | auto is_seekable_result = SafeCallIntoR<bool>([&] { |
nothing calls this directly
no test coverage detected