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 210 of file libxr_string.hpp.

Member Function Documentation

◆ Write()

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

Definition at line 216 of file libxr_string.hpp.

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

Field Documentation

◆ capacity

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

Definition at line 213 of file libxr_string.hpp.

◆ data

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

Definition at line 212 of file libxr_string.hpp.

◆ size

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

Definition at line 214 of file libxr_string.hpp.


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