1 | /* $Id: ResourceStoreImpl.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM resource store class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2023-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef MAIN_INCLUDED_ResourceStoreImpl_h
|
---|
29 | #define MAIN_INCLUDED_ResourceStoreImpl_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "ResourceStoreWrap.h"
|
---|
35 | #include <VBox/vmm/pdmdrv.h>
|
---|
36 |
|
---|
37 | #include <iprt/vfs.h>
|
---|
38 |
|
---|
39 |
|
---|
40 | class Console;
|
---|
41 | struct DRVMAINRESOURCESTORE;
|
---|
42 |
|
---|
43 | class ATL_NO_VTABLE ResourceStore :
|
---|
44 | public ResourceStoreWrap
|
---|
45 | {
|
---|
46 | public:
|
---|
47 |
|
---|
48 | DECLARE_COMMON_CLASS_METHODS(ResourceStore)
|
---|
49 |
|
---|
50 | HRESULT FinalConstruct();
|
---|
51 | void FinalRelease();
|
---|
52 |
|
---|
53 | // public initializer/uninitializer for internal purposes only
|
---|
54 | HRESULT init(Console *aParent);
|
---|
55 | void uninit();
|
---|
56 |
|
---|
57 | int i_addItem(const char *pszNamespace, const char *pszPath, RTVFSFILE hVfsFile);
|
---|
58 |
|
---|
59 | // public methods for internal purposes only
|
---|
60 | static const PDMDRVREG DrvReg;
|
---|
61 |
|
---|
62 | private:
|
---|
63 |
|
---|
64 | static DECLCALLBACK(int) i_resourceStoreQuerySize(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
|
---|
65 | uint64_t *pcb);
|
---|
66 | static DECLCALLBACK(int) i_resourceStoreReadAll(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
|
---|
67 | void *pvBuf, size_t cbRead);
|
---|
68 | static DECLCALLBACK(int) i_resourceStoreWriteAll(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath,
|
---|
69 | const void *pvBuf, size_t cbWrite);
|
---|
70 | static DECLCALLBACK(int) i_resourceStoreDelete(PPDMIVFSCONNECTOR pInterface, const char *pszNamespace, const char *pszPath);
|
---|
71 | static DECLCALLBACK(void *) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
|
---|
72 | static DECLCALLBACK(int) i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
73 | static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns);
|
---|
74 |
|
---|
75 | struct Data; // opaque data struct, defined in ResourceStoreImpl.cpp
|
---|
76 | Data *m;
|
---|
77 | };
|
---|
78 |
|
---|
79 | #endif /* !MAIN_INCLUDED_ResourceStoreImpl_h */
|
---|