ReactOS 0.4.16-dev-1133-g947c03e
__crt_stdio_input::string_input_adapter< Character > Class Template Reference

#include <corecrt_internal_stdio_input.h>

Public Types

using traits = __acrt_stdio_char_traits< Character >
 
using char_type = Character
 
using unsigned_char_type = typename traits::unsigned_char_type
 
using int_type = typename traits::int_type
 

Public Member Functions

 string_input_adapter (char_type const *const string, size_t const length) throw ()
 
bool validate () throw ()
 
int_type get () throw ()
 
void unget (int_type const c) throw ()
 
size_t characters_read () const throw ()
 

Private Attributes

char_type const_first
 
char_type const_last
 
char_type const_it
 

Detailed Description

template<typename Character>
class __crt_stdio_input::string_input_adapter< Character >

Definition at line 130 of file corecrt_internal_stdio_input.h.

Member Typedef Documentation

◆ char_type

template<typename Character >
using __crt_stdio_input::string_input_adapter< Character >::char_type = Character

Definition at line 135 of file corecrt_internal_stdio_input.h.

◆ int_type

template<typename Character >
using __crt_stdio_input::string_input_adapter< Character >::int_type = typename traits::int_type

Definition at line 137 of file corecrt_internal_stdio_input.h.

◆ traits

template<typename Character >
using __crt_stdio_input::string_input_adapter< Character >::traits = __acrt_stdio_char_traits<Character>

Definition at line 134 of file corecrt_internal_stdio_input.h.

◆ unsigned_char_type

template<typename Character >
using __crt_stdio_input::string_input_adapter< Character >::unsigned_char_type = typename traits::unsigned_char_type

Definition at line 136 of file corecrt_internal_stdio_input.h.

Constructor & Destructor Documentation

◆ string_input_adapter()

template<typename Character >
__crt_stdio_input::string_input_adapter< Character >::string_input_adapter ( char_type const *const  string,
size_t const  length 
)
throw (
)
inline

Definition at line 139 of file corecrt_internal_stdio_input.h.

143 : _first{string}, _last{string + length}, _it{string}
144 {
145 }
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Member Function Documentation

◆ characters_read()

template<typename Character >
size_t __crt_stdio_input::string_input_adapter< Character >::characters_read ( ) const
throw (
)
inline

Definition at line 177 of file corecrt_internal_stdio_input.h.

178 {
179 return static_cast<size_t>(_it - _first);
180 }

◆ get()

template<typename Character >
int_type __crt_stdio_input::string_input_adapter< Character >::get ( )
throw (
)
inline

Definition at line 154 of file corecrt_internal_stdio_input.h.

155 {
156 if (_it == _last)
157 return traits::eof;
158
159 // If we are processing narrow characters, the character value may be
160 // negative. In this case, its value will have been sign extended in
161 // the conversion to int_type. Mask the sign extension bits for
162 // compatibility with the other input adapters:
163 return static_cast<unsigned_char_type>(*_it++);
164 }
typename traits::unsigned_char_type unsigned_char_type

◆ unget()

template<typename Character >
void __crt_stdio_input::string_input_adapter< Character >::unget ( int_type const  c)
throw (
)
inline

Definition at line 166 of file corecrt_internal_stdio_input.h.

167 {
168 if (_it == _first)
169 return;
170
171 if (_it == _last && c == traits::eof)
172 return;
173
174 --_it;
175 }
const GLubyte * c
Definition: glext.h:8905

◆ validate()

template<typename Character >
bool __crt_stdio_input::string_input_adapter< Character >::validate ( )
throw (
)
inline

Definition at line 147 of file corecrt_internal_stdio_input.h.

148 {
149 _VALIDATE_RETURN(_it != nullptr, EINVAL, false);
150 _VALIDATE_RETURN(_it <= _last, EINVAL, false);
151 return true;
152 }
#define EINVAL
Definition: acclib.h:90
#define _VALIDATE_RETURN(expr, errorcode, retexpr)

Member Data Documentation

◆ _first

◆ _it

◆ _last


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