ReactOS 0.4.16-dev-852-gcfcc8d8
__crt_stdio_output::positional_parameter_base< Character, OutputAdapter > Class Template Reference

#include <corecrt_internal_stdio_output.h>

Inheritance diagram for __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >:
Collaboration diagram for __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >:

Classes

struct  parameter_data
 

Protected Types

typedef positional_parameter_base self_type
 
typedef format_validation_base< Character, OutputAdapter > base_type
 
typedef __crt_char_traits< Character > char_traits
 
- Protected Types inherited from __crt_stdio_output::format_validation_base< Character, OutputAdapter >
using common_data_base = typename standard_base< Character, OutputAdapter >::template output_adapter_data< Character, OutputAdapter >::template common_data< Character >
 
- Protected Types inherited from __crt_stdio_output::standard_base< Character, OutputAdapter >
using common_data_base = typename output_adapter_data< Character, OutputAdapter >::template common_data< Character >
 

Protected Member Functions

template<typename... Ts>
 positional_parameter_base (Ts &&... arguments) throw ()
 
bool advance_to_next_pass () throw ()
 
bool validate_and_update_state_at_end_of_format_string () throw ()
 
bool should_format () throw ()
 
template<typename RequestedParameterType , typename ActualParameterType >
bool extract_argument_from_va_list (ActualParameterType &result) throw ()
 
bool update_field_width () throw ()
 
bool update_precision () throw ()
 
bool validate_state_for_type_case_a () throw ()
 
bool should_skip_normal_state_processing () throw ()
 
bool validate_and_update_state_at_beginning_of_format_character () throw ()
 
bool should_skip_type_state_output () const throw ()
 
- Protected Member Functions inherited from __crt_stdio_output::format_validation_base< Character, OutputAdapter >
template<typename... Ts>
 format_validation_base (Ts &&... arguments) throw ()
 
__forceinline bool validate_and_update_state_at_end_of_format_string () throw ()
 
- Protected Member Functions inherited from __crt_stdio_output::standard_base< Character, OutputAdapter >
template<typename... Ts>
 standard_base (Ts &&... arguments) throw ()
 
bool advance_to_next_pass () throw ()
 
__forceinline bool validate_and_update_state_at_end_of_format_string () const throw ()
 
bool should_format () throw ()
 
template<typename RequestedParameterType , typename ActualParameterType >
bool extract_argument_from_va_list (ActualParameterType &result) throw ()
 
bool update_field_width () throw ()
 
bool update_precision () throw ()
 
bool validate_state_for_type_case_a () const throw ()
 
bool should_skip_normal_state_processing () throw ()
 
bool validate_and_update_state_at_beginning_of_format_character () throw ()
 
bool should_skip_type_state_output () const throw ()
 
- Protected Member Functions inherited from __crt_stdio_output::output_adapter_data< Character, OutputAdapter >
 output_adapter_data (OutputAdapter const &output_adapter, uint64_t const options, Character const *const format, __crt_cached_ptd_host &ptd, va_list const arglist) throw ()
 
- Protected Member Functions inherited from __crt_stdio_output::common_data< Character >
 common_data (__crt_cached_ptd_host &ptd)
 
char *& tchar_string (char) throw ()
 
wchar_t *& tchar_string (wchar_t) throw ()
 
Character *& tchar_string () throw ()
 

Private Types

enum class  pass : unsigned { not_started , position_scan , output , finished }
 
enum class  mode : unsigned { unknown , nonpositional , positional }
 
enum class  parameter_type : unsigned {
  unused , int32 , int64 , pointer ,
  real64
}
 

Private Member Functions

bool is_positional_parameter_reappearance_consistent (parameter_data const &parameter, parameter_type const actual_type, Character const format_type, length_modifier const length) throw ()
 
bool validate_and_store_parameter_data (parameter_data &parameter, parameter_type const actual_type, Character const format_type, length_modifier const length) throw ()
 

Static Private Member Functions

template<typename T >
static parameter_type __cdecl get_parameter_type (T *) throw ()
 
static parameter_type __cdecl get_parameter_type (short) throw ()
 
static parameter_type __cdecl get_parameter_type (unsigned short) throw ()
 
static parameter_type __cdecl get_parameter_type (wchar_t) throw ()
 
static parameter_type __cdecl get_parameter_type (int) throw ()
 
static parameter_type __cdecl get_parameter_type (unsigned int) throw ()
 
static parameter_type __cdecl get_parameter_type (__int64) throw ()
 
static parameter_type __cdecl get_parameter_type (unsigned __int64) throw ()
 
static parameter_type __cdecl get_parameter_type (_CRT_DOUBLE) throw ()
 
template<typename Character2 >
static bool __cdecl is_pointer_specifier (Character2 const specifier) throw ()
 
template<typename Character2 >
static bool __cdecl is_string_specifier (Character2 const specifier) throw ()
 
template<typename Character2 >
static bool __cdecl is_character_specifier (Character2 const specifier) throw ()
 
template<typename Character2 >
static bool __cdecl is_integral_specifier (Character2 const specifier) throw ()
 

Private Attributes

pass _current_pass
 
mode _format_mode
 
Character const_format
 
parameter_data _parameters [_ARGMAX]
 
int _maximum_index
 
int _type_index
 

Additional Inherited Members

- Static Protected Member Functions inherited from __crt_stdio_output::format_validation_base< Character, OutputAdapter >
static unsigned state_count () throw ()
 
static printf_state_transition_table conststate_transition_table () throw ()
 
- Static Protected Member Functions inherited from __crt_stdio_output::standard_base< Character, OutputAdapter >
static unsigned state_count () throw ()
 
static printf_state_transition_table conststate_transition_table () throw ()
 
- Protected Attributes inherited from __crt_stdio_output::output_adapter_data< Character, OutputAdapter >
OutputAdapter _output_adapter
 
- Protected Attributes inherited from __crt_stdio_output::common_data< Character >
uint64_t _options
 
__crt_cached_ptd_host & _ptd
 
Character const_format_it
 
va_list _valist_it
 
int _characters_written
 
state _state
 
unsigned _flags
 
int _field_width
 
int _precision
 
length_modifier _length
 
bool _suppress_output
 
Character _format_char
 
union {
   char *   _narrow_string
 
   wchar_t *   _wide_string
 
}; 
 
int _string_length
 
bool _string_is_wide
 
formatting_buffer _buffer
 

Detailed Description

template<typename Character, typename OutputAdapter>
class __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >

Definition at line 1193 of file corecrt_internal_stdio_output.h.

Member Typedef Documentation

◆ base_type

template<typename Character , typename OutputAdapter >
typedef format_validation_base<Character, OutputAdapter> __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::base_type
protected

Definition at line 1212 of file corecrt_internal_stdio_output.h.

◆ char_traits

template<typename Character , typename OutputAdapter >
typedef __crt_char_traits<Character> __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::char_traits
protected

Definition at line 1213 of file corecrt_internal_stdio_output.h.

◆ self_type

template<typename Character , typename OutputAdapter >
typedef positional_parameter_base __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::self_type
protected

Definition at line 1211 of file corecrt_internal_stdio_output.h.

Member Enumeration Documentation

◆ mode

◆ parameter_type

◆ pass

Constructor & Destructor Documentation

◆ positional_parameter_base()

template<typename Character , typename OutputAdapter >
template<typename... Ts>
__crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::positional_parameter_base ( Ts &&...  arguments)
throw (
)
inlineprotected

Definition at line 1216 of file corecrt_internal_stdio_output.h.

1217 : format_validation_base<Character, OutputAdapter>{arguments... },
1219 _format_mode {mode::unknown },
1221 _type_index {-1 },
1222 _maximum_index {-1 }
1223 {
1224 // Note that we do not zero-initialize the parameter data table until
1225 // the first positional parameter is encountered in the format string.
1226 }

Member Function Documentation

◆ advance_to_next_pass()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::advance_to_next_pass ( )
throw (
)
inlineprotected

Definition at line 1228 of file corecrt_internal_stdio_output.h.

1229 {
1230 _current_pass = static_cast<pass>(static_cast<unsigned>(_current_pass) + 1);
1232 return false;
1233
1234 // If we are in the output pass but the format string is a non-positional,
1235 // ordinary format string, then we do not need a second pass:
1236 if (_current_pass == pass::output && _format_mode == mode::nonpositional)
1237 return false;
1238
1239 // All characters before the first format specifier are output in the
1240 // first pass. We reset the format mode to 'unknown' to ensure that
1241 // they are not output again during the second pass.
1242 _format_mode = mode::unknown;
1243
1244 _maximum_index = -1;
1245 _type_index = -1;
1246
1247 _field_width = 0;
1248 _precision = 0;
1250
1251 return true;
1252 }
pass
Definition: typegen.h:25

◆ extract_argument_from_va_list()

template<typename Character , typename OutputAdapter >
template<typename RequestedParameterType , typename ActualParameterType >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::extract_argument_from_va_list ( ActualParameterType &  result)
throw (
)
inlineprotected

Definition at line 1295 of file corecrt_internal_stdio_output.h.

1296 {
1297 if (_format_mode == mode::nonpositional)
1298 {
1299 return base_type::template extract_argument_from_va_list<RequestedParameterType>(result);
1300 }
1301
1303
1305 {
1308 get_parameter_type(RequestedParameterType()),
1310 _length
1311 );
1312 }
1313 else
1314 {
1315 result = static_cast<ActualParameterType>(peek_va_arg<RequestedParameterType>(_parameters[_type_index]._valist_it));
1316 return true;
1317 }
1318 }
#define EINVAL
Definition: acclib.h:90
bool validate_and_store_parameter_data(parameter_data &parameter, parameter_type const actual_type, Character const format_type, length_modifier const length)
#define _UCRT_VALIDATE_RETURN(ptd, expr, errorcode, retexpr)
GLuint64EXT * result
Definition: glext.h:11304
#define _ARGMAX
Definition: corecrt.h:277

◆ get_parameter_type() [1/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( __int64  )
throw (
)
inlinestaticprivate

Definition at line 1546 of file corecrt_internal_stdio_output.h.

1546{ return parameter_type::int64; }

◆ get_parameter_type() [2/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( _CRT_DOUBLE  )
throw (
)
inlinestaticprivate

Definition at line 1548 of file corecrt_internal_stdio_output.h.

1548{ return parameter_type::real64; }

◆ get_parameter_type() [3/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( int  )
throw (
)
inlinestaticprivate

Definition at line 1544 of file corecrt_internal_stdio_output.h.

1544{ return parameter_type::int32; }

◆ get_parameter_type() [4/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( short  )
throw (
)
inlinestaticprivate

Definition at line 1541 of file corecrt_internal_stdio_output.h.

1541{ return parameter_type::int32; }

◆ get_parameter_type() [5/9]

template<typename Character , typename OutputAdapter >
template<typename T >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( T )
throw (
)
inlinestaticprivate

◆ get_parameter_type() [6/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( unsigned  __int64)
throw (
)
inlinestaticprivate

Definition at line 1547 of file corecrt_internal_stdio_output.h.

1547{ return parameter_type::int64; }

◆ get_parameter_type() [7/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( unsigned int  )
throw (
)
inlinestaticprivate

Definition at line 1545 of file corecrt_internal_stdio_output.h.

1545{ return parameter_type::int32; }

◆ get_parameter_type() [8/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( unsigned short  )
throw (
)
inlinestaticprivate

Definition at line 1542 of file corecrt_internal_stdio_output.h.

1542{ return parameter_type::int32; }

◆ get_parameter_type() [9/9]

template<typename Character , typename OutputAdapter >
static parameter_type __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::get_parameter_type ( wchar_t  )
throw (
)
inlinestaticprivate

Definition at line 1543 of file corecrt_internal_stdio_output.h.

1543{ return parameter_type::int32; }

◆ is_character_specifier()

template<typename Character , typename OutputAdapter >
template<typename Character2 >
static bool __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_character_specifier ( Character2 const  specifier)
throw (
)
inlinestaticprivate

◆ is_integral_specifier()

template<typename Character , typename OutputAdapter >
template<typename Character2 >
static bool __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_integral_specifier ( Character2 const  specifier)
throw (
)
inlinestaticprivate

Definition at line 1659 of file corecrt_internal_stdio_output.h.

1660 {
1661 return specifier == 'd' || specifier == 'i' || specifier == 'o'
1662 || specifier == 'u' || specifier == 'x' || specifier == 'X'
1663 || specifier == '*';
1664 }

Referenced by __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_positional_parameter_reappearance_consistent().

◆ is_pointer_specifier()

template<typename Character , typename OutputAdapter >
template<typename Character2 >
static bool __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_pointer_specifier ( Character2 const  specifier)
throw (
)
inlinestaticprivate

◆ is_positional_parameter_reappearance_consistent()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_positional_parameter_reappearance_consistent ( parameter_data const parameter,
parameter_type const  actual_type,
Character const  format_type,
length_modifier const  length 
)
throw (
)
inlineprivate

Definition at line 1559 of file corecrt_internal_stdio_output.h.

1565 {
1566 // Pointer format specifiers are exclusive; a parameter that previously
1567 // appeared as a pointer may not reappear as a non-pointer, and vice-
1568 // versa.
1569 bool const old_is_pointer{is_pointer_specifier(parameter._format_type)};
1570 bool const new_is_pointer{is_pointer_specifier(format_type)};
1571 if (old_is_pointer || new_is_pointer)
1572 {
1573 return old_is_pointer == new_is_pointer;
1574 }
1575
1576 // String format specifiers are exclusive, just like pointer specifiers.
1577 // We must also ensure that the two appearances match in string type:
1578 // either both must be wide or both must be narrow.
1579 bool const old_is_string{is_string_specifier(parameter._format_type)};
1580 bool const new_is_string{is_string_specifier(format_type)};
1581
1582 bool const old_is_character{is_character_specifier(parameter._format_type)};
1583 bool const new_is_character{is_character_specifier(format_type)};
1584 if (old_is_string || new_is_string || old_is_character || new_is_character)
1585 {
1586 if (old_is_string != new_is_string || old_is_character != new_is_character)
1587 return false;
1588
1589 bool const old_is_wide{is_wide_character_specifier(_options, parameter._format_type, parameter._length)};
1590 bool const new_is_wide{is_wide_character_specifier(_options, format_type, length)};
1591 if (old_is_wide != new_is_wide)
1592 return false;
1593
1594 return true;
1595 }
1596
1597 // Numeric specifiers are exclusive: either both appearances must be
1598 // numeric specifiers or neither appearance may be a numeric specifier.
1599 // Additionally, if both appearances are numeric specifiers, they must
1600 // both have the same width.
1601 bool const old_is_integral{is_integral_specifier(parameter._format_type)};
1602 bool const new_is_integral{is_integral_specifier(format_type)};
1603 if (old_is_integral || new_is_integral)
1604 {
1605 if (old_is_integral != new_is_integral)
1606 return false;
1607
1608 if ((parameter._length == length_modifier::I) != (length == length_modifier::I))
1609 return false;
1610
1611 return to_integer_size(parameter._length) == to_integer_size(length);
1612 }
1613
1614 return parameter._actual_type == actual_type;
1615 }
static bool __cdecl is_character_specifier(Character2 const specifier)
static bool __cdecl is_pointer_specifier(Character2 const specifier)
static bool __cdecl is_integral_specifier(Character2 const specifier)
static bool __cdecl is_string_specifier(Character2 const specifier)
format_type
Definition: d3dx9_private.h:49
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
size_t __cdecl to_integer_size(length_modifier const length)
bool __cdecl is_wide_character_specifier(uint64_t const options, Character const format_type, length_modifier const length)

Referenced by __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_and_store_parameter_data().

◆ is_string_specifier()

template<typename Character , typename OutputAdapter >
template<typename Character2 >
static bool __cdecl __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::is_string_specifier ( Character2 const  specifier)
throw (
)
inlinestaticprivate

◆ should_format()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::should_format ( )
throw (
)
inlineprotected

Definition at line 1289 of file corecrt_internal_stdio_output.h.

1290 {
1291 return _current_pass != pass::position_scan || _format_mode == mode::nonpositional;
1292 }

◆ should_skip_normal_state_processing()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::should_skip_normal_state_processing ( )
throw (
)
inlineprotected

Definition at line 1404 of file corecrt_internal_stdio_output.h.

1405 {
1406 if (_current_pass == pass::position_scan && _format_mode == mode::positional)
1407 return true;
1408
1409 if (_current_pass == pass::output && _format_mode == mode::unknown)
1410 return true;
1411
1412 // We do not output during the first pass if we have already come across
1413 // a positional format specifier. All characters before the first format
1414 // specifier are output in the first pass. We need to check the format
1415 // type during the second pass to ensure that they are not output a second
1416 // time.
1417 return false;
1418 }

◆ should_skip_type_state_output()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::should_skip_type_state_output ( ) const
throw (
)
inlineprotected

Definition at line 1476 of file corecrt_internal_stdio_output.h.

1477 {
1478 return _format_mode == mode::positional && _current_pass == pass::position_scan;
1479 }

◆ update_field_width()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::update_field_width ( )
throw (
)
inlineprotected

Definition at line 1320 of file corecrt_internal_stdio_output.h.

1321 {
1322 if (_format_mode == mode::nonpositional)
1323 {
1325 }
1326
1327 Character* end_pointer{nullptr};
1328 int const width_index{_tcstol_internal(_ptd, _format_it, &end_pointer, 10) - 1};
1329 _format_it = end_pointer + 1;
1330
1332 {
1333 _UCRT_VALIDATE_RETURN(_ptd, width_index >= 0 && *end_pointer == '$' && width_index < _ARGMAX, EINVAL, false);
1334
1335 _maximum_index = width_index > _maximum_index
1336 ? width_index
1338
1340 _parameters[width_index],
1343 _length
1344 );
1345 }
1346 else
1347 {
1348 _field_width = peek_va_arg<int>(_parameters[width_index]._valist_it);
1349 }
1350
1351 return true;
1352 }
__forceinline long __cdecl _tcstol_internal(__crt_cached_ptd_host &ptd, Character const *const string, EndPointer const end, int const base)

◆ update_precision()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::update_precision ( )
throw (
)
inlineprotected

Definition at line 1354 of file corecrt_internal_stdio_output.h.

1355 {
1356 if (_format_mode == mode::nonpositional)
1357 {
1359 }
1360
1361 Character* end_pointer{nullptr};
1362 int const precision_index{_tcstol_internal(_ptd, _format_it, &end_pointer, 10) - 1};
1363 _format_it = end_pointer + 1;
1364
1366 {
1367 _UCRT_VALIDATE_RETURN(_ptd, precision_index >= 0 && *end_pointer == '$' && precision_index < _ARGMAX, EINVAL, false);
1368
1369 _maximum_index = precision_index > _maximum_index
1370 ? precision_index
1372
1374 _parameters[precision_index],
1377 _length
1378 );
1379 }
1380 else
1381 {
1382 _precision = peek_va_arg<int>(_parameters[precision_index]._valist_it);
1383 }
1384
1385 return true;
1386 }

◆ validate_and_store_parameter_data()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_and_store_parameter_data ( parameter_data parameter,
parameter_type const  actual_type,
Character const  format_type,
length_modifier const  length 
)
throw (
)
inlineprivate

Definition at line 1617 of file corecrt_internal_stdio_output.h.

1623 {
1624 if (parameter._actual_type == parameter_type::unused)
1625 {
1626 parameter._actual_type = actual_type;
1627 parameter._format_type = format_type;
1628 parameter._length = length;
1629 }
1630 else
1631 {
1633 parameter, actual_type, format_type, length
1634 ), EINVAL, false);
1635 }
1636
1637 return true;
1638 }
bool is_positional_parameter_reappearance_consistent(parameter_data const &parameter, parameter_type const actual_type, Character const format_type, length_modifier const length)

Referenced by __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::extract_argument_from_va_list(), __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::update_field_width(), __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::update_precision(), and __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_state_for_type_case_a().

◆ validate_and_update_state_at_beginning_of_format_character()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_and_update_state_at_beginning_of_format_character ( )
throw (
)
inlineprotected

Definition at line 1420 of file corecrt_internal_stdio_output.h.

1421 {
1422 // We're looking for a format specifier, so we'll have just seen a '%'
1423 // and the next character is not a '%':
1424 if (_state != state::percent || *_format_it == '%')
1425 return true;
1426
1427 // When we encounter the first format specifier, we determine whether
1428 // the format string is a positional format string or a standard format
1429 // string.
1430 if (_format_mode == mode::unknown)
1431 {
1432 Character* end_pointer{nullptr};
1433
1434 // Only digits are permitted between the % and the $ in the positional format specifier.
1435 if (*_format_it < '0' || *_format_it > '9')
1436 {
1437 _format_mode = mode::nonpositional;
1438 }
1439 else if (_tcstol_internal(_ptd, _format_it, &end_pointer, 10) > 0 && *end_pointer == '$')
1440 {
1442 {
1443 memset(_parameters, 0, sizeof(_parameters));
1444 }
1445
1446 _format_mode = mode::positional;
1447 }
1448 else
1449 {
1450 _format_mode = mode::nonpositional;
1451 }
1452 }
1453
1454 if (_format_mode != mode::positional)
1455 {
1456 return true;
1457 }
1458
1459 Character* end_pointer{nullptr};
1460 _type_index = _tcstol_internal(_ptd, _format_it, &end_pointer, 10) - 1;
1461 _format_it = end_pointer + 1;
1462
1464 return true;
1465
1466 // We do not re-perform the type validations during the second pass...
1467 _UCRT_VALIDATE_RETURN(_ptd, _type_index >= 0 && *end_pointer == '$' && _type_index < _ARGMAX, EINVAL, false);
1468
1470 ? _type_index
1472
1473 return true;
1474 }
#define memset(x, y, z)
Definition: compat.h:39

◆ validate_and_update_state_at_end_of_format_string()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_and_update_state_at_end_of_format_string ( )
throw (
)
inlineprotected

Definition at line 1254 of file corecrt_internal_stdio_output.h.

1255 {
1257 return false;
1258
1259 if (_format_mode != mode::positional || _current_pass != pass::position_scan)
1260 return true;
1261
1262 // At the end of the first pass, we have the types filled into the
1263 // arg_type member for each positional parameter. We now need to get
1264 // the argument pointer for each positional parameter and store it
1265 // into the arg_ptr member.
1266 parameter_data* const first{_parameters};
1267 parameter_data* const last {_parameters + _maximum_index + 1};
1268 for (parameter_data* it{first}; it != last; ++it)
1269 {
1270 it->_valist_it = _valist_it;
1271
1272 switch (it->_actual_type)
1273 {
1274 case parameter_type::int32: read_va_arg<int >(_valist_it); break;
1275 case parameter_type::int64: read_va_arg<__int64 >(_valist_it); break;
1276 case parameter_type::pointer: read_va_arg<void* >(_valist_it); break;
1277 case parameter_type::real64: read_va_arg<_CRT_DOUBLE>(_valist_it); break;
1278
1279 default:
1280 // We should never reach this point:
1281 _UCRT_VALIDATE_RETURN(_ptd, ("Missing position in the format string", 0), EINVAL, false);
1282 break;
1283 }
1284 }
1285
1286 return true;
1287 }
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45

◆ validate_state_for_type_case_a()

template<typename Character , typename OutputAdapter >
bool __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::validate_state_for_type_case_a ( )
throw (
)
inlineprotected

Definition at line 1388 of file corecrt_internal_stdio_output.h.

1389 {
1390 if (_format_mode == mode::positional && _current_pass == pass::position_scan)
1391 {
1397 _length
1398 );
1399 }
1400
1401 return true;
1402 }

Member Data Documentation

◆ _current_pass

◆ _format

template<typename Character , typename OutputAdapter >
Character const* __crt_stdio_output::positional_parameter_base< Character, OutputAdapter >::_format
private

◆ _format_mode

◆ _maximum_index

◆ _parameters

◆ _type_index


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