libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::Print::Text< N > Struct Template Reference

Structural literal wrapper used as the NTTP source for printf formats. More...

#include <printf.hpp>

Public Member Functions

constexpr Text (const char(&text)[N])
 Copies the string literal into the structural NTTP object.
 
constexpr size_t Size () const
 Returns the format length without the terminating zero byte. / 返回不含结尾零字节的格式串长度
 
constexpr const char * Data () const
 Returns the literal bytes including the terminating zero byte. / 返回含结尾零字节的字面量指针
 

Data Fields

char data [N] {}
 Literal bytes including the terminating zero byte. / 含结尾零字节的字面量字节序列
 

Detailed Description

template<size_t N>
struct LibXR::Print::Text< N >

Structural literal wrapper used as the NTTP source for printf formats.

作为 printf 格式源的结构化字符串字面量包装。

Definition at line 16 of file printf.hpp.

Constructor & Destructor Documentation

◆ Text()

template<size_t N>
LibXR::Print::Text< N >::Text ( const char(&) text[N])
inlineconstexpr

Copies the string literal into the structural NTTP object.

将字符串字面量复制到结构化 NTTP 对象中。

Definition at line 25 of file printf.hpp.

26 {
27 for (size_t i = 0; i < N; ++i)
28 {
29 data[i] = text[i];
30 }
31 }
char data[N]
Literal bytes including the terminating zero byte. / 含结尾零字节的字面量字节序列
Definition printf.hpp:19

Member Function Documentation

◆ Data()

template<size_t N>
const char * LibXR::Print::Text< N >::Data ( ) const
inlinenodiscardconstexpr

Returns the literal bytes including the terminating zero byte. / 返回含结尾零字节的字面量指针

Definition at line 36 of file printf.hpp.

36{ return data; }

◆ Size()

template<size_t N>
size_t LibXR::Print::Text< N >::Size ( ) const
inlinenodiscardconstexpr

Returns the format length without the terminating zero byte. / 返回不含结尾零字节的格式串长度

Definition at line 34 of file printf.hpp.

34{ return N - 1; }

Field Documentation

◆ data

template<size_t N>
char LibXR::Print::Text< N >::data[N] {}

Literal bytes including the terminating zero byte. / 含结尾零字节的字面量字节序列

Definition at line 19 of file printf.hpp.

19{};

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