VirtualBox

source: vbox/trunk/src/VBox/Main/include/DataStreamImpl.h@ 74761

Last change on this file since 74761 was 74761, checked in by vboxsync, 7 years ago

Main/MediumIO: add stub for a method to convert a medium to a data stream with a given medium format

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1/* $Id: DataStreamImpl.h 74761 2018-10-11 11:26:32Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2018 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19#ifndef ____H_DATASTREAMIMPL
20#define ____H_DATASTREAMIMPL
21
22#include "DataStreamWrap.h"
23
24
25class ATL_NO_VTABLE DataStream
26 : public DataStreamWrap
27{
28public:
29 DECLARE_EMPTY_CTOR_DTOR(DataStream)
30
31 HRESULT FinalConstruct();
32 void FinalRelease();
33
34 HRESULT init(unsigned long aBufferSize);
35 void uninit();
36
37 /// Feed data into the stream, used by the stream source.
38 /// Blocks if the internal buffer cannot take anything, otherwise
39 /// as much as the internal buffer can hold is taken (if smaller
40 /// than @a cbWrite). Modeled after RTStrmWriteEx.
41 int i_write(const void *pvBuf, size_t cbWrite, size_t *pcbWritten);
42
43private:
44 // wrapped IDataStream attributes and methods
45 HRESULT getReadSize(ULONG *aReadSize);
46 HRESULT read(ULONG aSize, ULONG aTimeoutMS, std::vector<BYTE> &aData);
47
48private:
49 std::vector<BYTE> m_aBuffer;
50};
51
52#endif // !____H_DATASTREAMIMPL
53
54/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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