ReactOS 0.4.16-dev-822-gbcedb53
__crt_stdio_output::output_adapter_common< Character, Derived > Class Template Reference

#include <corecrt_internal_stdio_output.h>

Public Member Functions

void write_character (Character const c, int *const count_written, __crt_cached_ptd_host &ptd) const throw ()
 

Protected Member Functions

void write_string_impl (Character const *const string, int const length, int *const count_written, __crt_cached_ptd_host &ptd) const throw ()
 

Detailed Description

template<typename Character, typename Derived>
class __crt_stdio_output::output_adapter_common< Character, Derived >

Definition at line 75 of file corecrt_internal_stdio_output.h.

Member Function Documentation

◆ write_character()

template<typename Character , typename Derived >
void __crt_stdio_output::output_adapter_common< Character, Derived >::write_character ( Character const  c,
int *const  count_written,
__crt_cached_ptd_host &  ptd 
) const
throw (
)
inline

Definition at line 78 of file corecrt_internal_stdio_output.h.

79 {
80 if (static_cast<Derived const*>(this)->write_character_without_count_update(c, ptd))
81 {
82 ++*count_written;
83 }
84 else
85 {
86 *count_written = -1;
87 }
88 }
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
const GLubyte * c
Definition: glext.h:8905
#define const
Definition: zconf.h:233

Referenced by __crt_stdio_output::output_adapter_common< Character, Derived >::write_string_impl().

◆ write_string_impl()

template<typename Character , typename Derived >
void __crt_stdio_output::output_adapter_common< Character, Derived >::write_string_impl ( Character const *const  string,
int const  length,
int *const  count_written,
__crt_cached_ptd_host &  ptd 
) const
throw (
)
inlineprotected

Definition at line 91 of file corecrt_internal_stdio_output.h.

97 {
98 auto const reset_errno = ptd.get_errno().create_guard();
99
100 Character const* const string_last{string + length};
101 for (Character const* it{string}; it != string_last; ++it)
102 {
103 if (static_cast<Derived const*>(this)->write_character_without_count_update(*it, ptd))
104 {
105 ++*count_written;
106 }
107 else
108 {
109 // Non-standard extension: EILSEQ errors are recoverable.
110 // Standard behavior when we've encountered an 'illegal sequence' error
111 // (i.e. EILSEQ) is to set 'errno' to EILSEQ and return -1.
112 // Instead, we write '?' and continue writing the string.
113 if (!ptd.get_errno().check(EILSEQ))
114 {
115 // *printf returns the number of characters written
116 // set count written to -1 to indicate an error occurred
117 *count_written = -1;
118 break;
119 }
120
121 write_character('?', count_written, ptd);
122 }
123 }
124 }
void write_character(Character const c, int *const count_written, __crt_cached_ptd_host &ptd) const
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define EILSEQ
Definition: errno.h:109

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