VirtualBox

Changeset 96089 in vbox for trunk/include


Ignore:
Timestamp:
Aug 7, 2022 2:12:29 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/RTStream: Added RTStrmSeek, RTStrmTell, RTStrmSetBufferingMode and RTStrmQueryFileHandle. bugref:10261

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r96078 r96089  
    22902290# define RTStrmOpenFV                                   RT_MANGLER(RTStrmOpenFV)
    22912291# define RTStrmOpenFileHandle                           RT_MANGLER(RTStrmOpenFileHandle)
     2292# define RTStrmQueryFileHandle                          RT_MANGLER(RTStrmQueryFileHandle)
    22922293# define RTStrmPrintf                                   RT_MANGLER(RTStrmPrintf)
    22932294# define RTStrmPrintfV                                  RT_MANGLER(RTStrmPrintfV)
     
    22992300# define RTStrmReadEx                                   RT_MANGLER(RTStrmReadEx)
    23002301# define RTStrmRewind                                   RT_MANGLER(RTStrmRewind)
     2302# define RTStrmSetBufferingMode                         RT_MANGLER(RTStrmSetBufferingMode)
    23012303# define RTStrmSetMode                                  RT_MANGLER(RTStrmSetMode)
     2304# define RTStrmSeek                                     RT_MANGLER(RTStrmSeek)
     2305# define RTStrmTell                                     RT_MANGLER(RTStrmTell)
    23022306# define RTStrmWriteEx                                  RT_MANGLER(RTStrmWriteEx)
    23032307# define RTStrmIsTerminal                               RT_MANGLER(RTStrmIsTerminal)
  • trunk/include/iprt/stream.h

    r96077 r96089  
    144144
    145145/**
     146 * Queries the file handle backing the stream.
     147 *
     148 * @returns iprt status code.
     149 * @retval  VERR_NOT_AVAILABLE if the stream has no valid handle associated with
     150 *          it.
     151 *
     152 * @param   pStream         The stream.
     153 * @param   phFile          Where to return the file handle.  This should not be
     154 *                          closed!
     155 */
     156RTR3DECL(int) RTStrmQueryFileHandle(PRTSTREAM pStream, PRTFILE phFile);
     157
     158/**
    146159 * Closes the specified stream.
    147160 *
     
    188201RTR3DECL(int) RTStrmSetMode(PRTSTREAM pStream, int fBinary, int fCurrentCodeSet);
    189202
     203/** Stream buffering modes. */
     204typedef enum RTSTRMBUFMODE
     205{
     206    RTSTRMBUFMODE_INVALID = 0,
     207    RTSTRMBUFMODE_FULL,         /**< Full buffering. */
     208    RTSTRMBUFMODE_LINE,         /**< Line buffering. On Windows this could be the same as RTSTRMBUFMODE_FULL. */
     209    RTSTRMBUFMODE_UNBUFFERED,   /**< No buffering. */
     210    RTSTRMBUFMODE_END,
     211    RTSTRMBUFMODE_32BIT_HACK = 0x7fffffff
     212} RTSTRMBUFMODE;
     213
     214/**
     215 * Changes the stream buffering mode.
     216 *
     217 * @returns iprt status code.
     218 * @param   pStream         The stream.
     219 * @param   enmBufMode      The new buffering mode.
     220 */
     221RTR3DECL(int) RTStrmSetBufferingMode(PRTSTREAM pStream, RTSTRMBUFMODE enmBufMode);
     222
    190223/**
    191224 * Returns the current echo mode.
     225 *
    192226 * This works only for standard input streams.
    193227 *
     
    201235/**
    202236 * Changes the behavior for echoing inpit characters on the command line.
     237 *
    203238 * This works only for standard input streams.
    204239 *
     
    242277 */
    243278RTR3DECL(int) RTStrmRewind(PRTSTREAM pStream);
     279
     280/**
     281 * Changes the file position.
     282 *
     283 * @returns IPRT status code.
     284 *
     285 * @param   pStream         The stream.
     286 * @param   off             The seek offset.
     287 * @param   uMethod         Seek method, i.e. one of the RTFILE_SEEK_* defines.
     288 *
     289 * @remarks Not all streams are seekable and that behavior is currently
     290 *          undefined for those.
     291 */
     292RTR3DECL(int) RTStrmSeek(PRTSTREAM pStream, RTFOFF off, uint32_t uMethod);
     293
     294/**
     295 * Tells the stream position.
     296 *
     297 * @returns Stream position or IPRT error status. Non-negative numbers are
     298 *          stream positions, while negative numbers are IPRT error stauses.
     299 *
     300 * @param   pStream         The stream.
     301 *
     302 * @remarks Not all streams have a position and that behavior is currently
     303 *          undefined for those.
     304 */
     305RTR3DECL(RTFOFF) RTStrmTell(PRTSTREAM pStream);
    244306
    245307/**
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