VirtualBox

Changeset 41504 in vbox for trunk/include/iprt/stream.h


Ignore:
Timestamp:
May 30, 2012 6:40:48 PM (13 years ago)
Author:
vboxsync
Message:

RTStrmGetLine: Deal with correctly with \r\n, current handling is stupid as it returns two lines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/stream.h

    r39377 r41504  
    223223/**
    224224 * Reads a line from a file stream.
    225  * A line ends with a '\\n', '\\0' or the end of the file.
    226  *
    227  * @returns iprt status code.
    228  * @returns VINF_BUFFER_OVERFLOW if the buffer wasn't big enough to read an entire line.
     225 *
     226 * A line ends with a '\\n', '\\r\\n', '\\0' or the end of the file.
     227 *
     228 * @returns iprt status code.
     229 * @retval  VINF_BUFFER_OVERFLOW if the buffer wasn't big enough to read an
     230 *          entire line.
     231 * @retval  VERR_BUFFER_OVERFLOW if a lone '\\r' was encountered at the end of
     232 *          the buffer and we ended up dropping the following character.
     233 *
    229234 * @param   pStream         The stream.
    230235 * @param   pszString       Where to store the line.
    231236 *                          The line will *NOT* contain any '\\n'.
    232  * @param   cchString       The size of the string buffer.
    233  */
    234 RTR3DECL(int) RTStrmGetLine(PRTSTREAM pStream, char *pszString, size_t cchString);
     237 * @param   cbString        The size of the string buffer.
     238 */
     239RTR3DECL(int) RTStrmGetLine(PRTSTREAM pStream, char *pszString, size_t cbString);
    235240
    236241/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette