Blender V5.3
blender::io::ply::PlyReadBuffer Class Reference

#include <ply_import_buffer.hh>

Public Member Functions

 PlyReadBuffer (const char *file_path, size_t read_buffer_size=64 *1024)
 ~PlyReadBuffer ()
void after_header (bool is_binary)
Span< char > read_line ()
std::optional< Span< char > > try_read_line ()
bool read_bytes (void *dst, size_t size)

Detailed Description

Reads underlying PLY file in large chunks, and provides interface for ASCII/header parsing to read individual lines, and for binary parsing to read chunks of bytes.

Definition at line 23 of file ply_import_buffer.hh.

Constructor & Destructor Documentation

◆ PlyReadBuffer()

blender::io::ply::PlyReadBuffer::PlyReadBuffer ( const char * file_path,
size_t read_buffer_size = 64 * 1024 )

Definition at line 27 of file ply_import_buffer.cc.

References blender::BLI_fopen().

◆ ~PlyReadBuffer()

blender::io::ply::PlyReadBuffer::~PlyReadBuffer ( )

Definition at line 33 of file ply_import_buffer.cc.

Member Function Documentation

◆ after_header()

void blender::io::ply::PlyReadBuffer::after_header ( bool is_binary)

After header is parsed, indicate whether the rest of reading will be ASCII or binary.

Definition at line 40 of file ply_import_buffer.cc.

Referenced by blender::io::ply::read_header().

◆ read_bytes()

bool blender::io::ply::PlyReadBuffer::read_bytes ( void * dst,
size_t size )

Reads a number of bytes into provided destination pointer. Returns false if this amount of bytes can not be read.

Definition at line 81 of file ply_import_buffer.cc.

Referenced by blender::io::ply::parse_row_binary(), blender::io::ply::read_list_count(), blender::io::ply::read_list_values(), and blender::io::ply::skip_property().

◆ read_line()

Span< char > blender::io::ply::PlyReadBuffer::read_line ( )

Gets the next line from the file as a Span. The line does not include any newline characters.

Definition at line 45 of file ply_import_buffer.cc.

References try_read_line().

Referenced by blender::io::ply::load_face_element(), blender::io::ply::load_tristrips_element(), blender::io::ply::parse_row_ascii(), and blender::io::ply::read_header().

◆ try_read_line()

std::optional< Span< char > > blender::io::ply::PlyReadBuffer::try_read_line ( )

Same as read_line, but returns nothing at the end of the file.

Definition at line 50 of file ply_import_buffer.cc.

References blender::BLI_assert(), and blender::is_newline().

Referenced by read_line(), and blender::io::ply::skip_element().


The documentation for this class was generated from the following files: