libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::Detail::RuntimeStringBufferSink Struct Reference

Sink used by the second formatting pass to fill retained storage. More...

#include <libxr_string.hpp>

Public Member Functions

ErrorCode Write (std::string_view chunk)
 

Data Fields

char * data = nullptr
 
size_t capacity = 0
 
size_t size = 0
 

Detailed Description

Sink used by the second formatting pass to fill retained storage.

格式化第二遍使用的保留存储写入端。

Definition at line 214 of file libxr_string.hpp.

Member Function Documentation

◆ Write()

ErrorCode LibXR::Detail::RuntimeStringBufferSink::Write ( std::string_view chunk)
inlinenodiscard

Definition at line 220 of file libxr_string.hpp.

221 {
222 if (capacity - size < chunk.size())
223 {
225 }
226 if (!chunk.empty())
227 {
228 std::memcpy(data + size, chunk.data(), chunk.size());
229 size += chunk.size();
230 }
231 return ErrorCode::OK;
232 }
@ OUT_OF_RANGE
超出范围 | Out of range
@ OK
操作成功 | Operation successful

Field Documentation

◆ capacity

size_t LibXR::Detail::RuntimeStringBufferSink::capacity = 0

Definition at line 217 of file libxr_string.hpp.

◆ data

char* LibXR::Detail::RuntimeStringBufferSink::data = nullptr

Definition at line 216 of file libxr_string.hpp.

◆ size

size_t LibXR::Detail::RuntimeStringBufferSink::size = 0

Definition at line 218 of file libxr_string.hpp.


The documentation for this struct was generated from the following file: