Blender V4.3
ply_import_buffer.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include <cstdio>
12
13#include "BLI_array.hh"
14#include "BLI_span.hh"
15
16namespace blender::io::ply {
17
23 public:
24 PlyReadBuffer(const char *file_path, size_t read_buffer_size = 64 * 1024);
26
28 void after_header(bool is_binary);
29
34
39 bool read_bytes(void *dst, size_t size);
40
41 private:
42 bool refill_buffer();
43
44 private:
45 FILE *file_ = nullptr;
46 Array<char> buffer_;
47 int pos_ = 0;
48 int buf_used_ = 0;
49 int last_newline_ = 0;
50 size_t read_buffer_size_ = 0;
51 bool at_eof_ = false;
52 bool is_binary_ = false;
53};
54
55} // namespace blender::io::ply
PlyReadBuffer(const char *file_path, size_t read_buffer_size=64 *1024)
bool read_bytes(void *dst, size_t size)