VirtualBox

source: vbox/trunk/src/VBox/Main/include/MediumIOImpl.h@ 73768

Last change on this file since 73768 was 72948, checked in by vboxsync, 6 years ago

Main: Introducing IMediumIO for accessing the content of a medium. The new IMedium::openForIO method instantiates and returns this interface. N.B. Write access hasn't been implemented yet.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/* $Id: MediumIOImpl.h 72948 2018-07-07 16:20:42Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation - MediumIO.
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#ifndef ____H_MEDIUMIOIMPL
19#define ____H_MEDIUMIOIMPL
20
21#include "MediumIOWrap.h"
22
23class ATL_NO_VTABLE MediumIO :
24 public MediumIOWrap
25{
26public:
27 /** @name Dummy/standard constructors and destructors.
28 * @{ */
29 DECLARE_EMPTY_CTOR_DTOR(MediumIO)
30 HRESULT FinalConstruct();
31 void FinalRelease();
32 /** @} */
33
34 /** @name Initializer & uninitializer.
35 * @{ */
36 HRESULT initForMedium(Medium *pMedium, bool fWritable, com::Utf8Str const &rStrKeyId, com::Utf8Str const &rStrPassword);
37 void uninit();
38 /** @} */
39
40private:
41 /** @name Wrapped IMediumIO properties
42 * @{ */
43 HRESULT getMedium(ComPtr<IMedium> &a_rPtrMedium);
44 HRESULT getWritable(BOOL *a_fWritable);
45 HRESULT getExplorer(ComPtr<IVFSExplorer> &a_rPtrExplorer);
46 /** @} */
47
48 /** @name Wrapped IMediumIO methods
49 * @{ */
50 HRESULT read(LONG64 a_off, ULONG a_cbRead, std::vector<BYTE> &a_rData);
51 HRESULT write(LONG64 a_off, const std::vector<BYTE> &a_rData, ULONG *a_pcbWritten);
52 HRESULT formatFAT(BOOL a_fQuick);
53 HRESULT initializePartitionTable(PartitionTableType_T a_enmFormat, BOOL a_fWholeDiskInOneEntry);
54 HRESULT close();
55 /** @} */
56
57 /** @name Internal workers.
58 * @{ */
59 void i_close();
60 /** @} */
61
62 struct Data;
63 Data *m;
64};
65
66#endif
67/* vi: set tabstop=4 shiftwidth=4 expandtab: */
68
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use