Blender V5.0
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
8
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 FILE *file_ = nullptr;
45 Array<char> buffer_;
46 int pos_ = 0;
47 int buf_used_ = 0;
48 int last_newline_ = 0;
49 size_t read_buffer_size_ = 0;
50 bool at_eof_ = false;
51 bool is_binary_ = false;
52};
53
54} // namespace blender::io::ply
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
PlyReadBuffer(const char *file_path, size_t read_buffer_size=64 *1024)
bool read_bytes(void *dst, size_t size)