advgetopt/conf_file.cpp
/** \brief Read one characte from the input stream.
 *
 * This function reads one character from the input stream and returns it
 * as an `int`.
 *
 * If there is an ungotten character (i.e. ungetc() was called) then that
 * character is returned.
 *
 * When the end of the file is reached, this function returns -1.
 *
 * \note
 * This function is oblivious of UTF-8. It should not matter since any
 * Unicode character would anyway be treated as is.
 *
 * \param[in,out] in  The input stream.
 *
 * \return The character read or -1 when EOF is reached.
 */
\brief Read one characte from the input stream.
This function reads one character from the input stream and returns it
as an `int`.

If there is an ungotten character  was called) then that
character is returned.

When the end of the file is reached, this function returns -1.

\note
This function is oblivious of UTF-8. It should not matter since any
Unicode character would anyway be treated as is.

\param[in,out] in  The input stream.

\return The character read or -1 when EOF is reached.
\ brief Read one characte from the input stream . This function reads one character from the input stream and returns it as an ` int ` . If there is an ungotten character was called ) then that character is returned . When the end of the file is reached this function returns - 1 . \ note This function is oblivious of UTF - 8 . It should not matter since any Unicode character would anyway be treated as is . \ param [ in out ] in The input stream . \ return The character read or - 1 when EOF is reached .
int conf_file::getc(std::ifstream & in)
{
    if(f_unget_char != '\0')
    {
        int const r(f_unget_char);
        f_unget_char = '\0';
        return r;
    }
    char c;
    in.get(c);
    if(!in)
    {
        return EOF;
    }
    return static_cast<std::uint8_t>(c);
}
int conf_file :: getc ( std :: ifstream & in ) { if ( f_unget_char != ' \0 ' ) { int const r ( f_unget_char ) ; f_unget_char = ' \0 ' ; return r ; } char c ; in . get ( c ) ; if ( ! in ) { return EOF ; } return static_cast < std :: uint8_t > ( c ) ; }
\brief Read one characte from the input stream.
\ brief Read one characte from the input stream .