| 209 | } |
| 210 | |
| 211 | uint64_t FileAccessEncryptedv3::get_buffer(uint8_t *p_dst, uint64_t p_length) const { |
| 212 | ERR_FAIL_COND_V(!p_dst && p_length > 0, -1); |
| 213 | ERR_FAIL_COND_V_MSG(writing, -1, "File has not been opened in read mode."); |
| 214 | |
| 215 | uint64_t to_copy = MIN(p_length, get_length() - pos); |
| 216 | for (uint64_t i = 0; i < to_copy; i++) { |
| 217 | p_dst[i] = data[pos++]; |
| 218 | } |
| 219 | |
| 220 | if (to_copy < p_length) { |
| 221 | eofed = true; |
| 222 | } |
| 223 | |
| 224 | return to_copy; |
| 225 | } |
| 226 | |
| 227 | Error FileAccessEncryptedv3::get_error() const { |
| 228 | return eofed ? ERR_FILE_EOF : OK; |
no outgoing calls
no test coverage detected