MCPcopy Create free account
hub / github.com/apache/arrow / ValidateWriteRange

Function ValidateWriteRange

cpp/src/arrow/io/interfaces.cc:344–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344Status ValidateWriteRange(int64_t offset, int64_t size, int64_t file_size) {
345 if (offset < 0 || size < 0) {
346 return Status::Invalid("Invalid write (offset = ", offset, ", size = ", size, ")");
347 }
348 if (offset + size > file_size) {
349 return Status::IOError("Write out of bounds (offset = ", offset, ", size = ", size,
350 ") in file of size ", file_size);
351 }
352 return Status::OK();
353}
354
355Status ValidateRange(int64_t offset, int64_t size) {
356 if (offset < 0 || size < 0) {

Callers 4

WriteMethod · 0.85
WriteAtMethod · 0.85
WriteAtMethod · 0.85
WriteMethod · 0.85

Calls 3

IOErrorFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected