[20044] | 1 | /* $Id: VFSExplorerImpl.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * VirtualBox COM class implementation
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2009-2023 Oracle and/or its affiliates.
|
---|
[20044] | 8 | *
|
---|
[96407] | 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
|
---|
[20044] | 26 | */
|
---|
| 27 |
|
---|
[76562] | 28 | #ifndef MAIN_INCLUDED_VFSExplorerImpl_h
|
---|
| 29 | #define MAIN_INCLUDED_VFSExplorerImpl_h
|
---|
[76487] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[20044] | 33 |
|
---|
[49644] | 34 | #include "VFSExplorerWrap.h"
|
---|
[20044] | 35 |
|
---|
| 36 | class ATL_NO_VTABLE VFSExplorer :
|
---|
[49644] | 37 | public VFSExplorerWrap
|
---|
[20044] | 38 | {
|
---|
[49644] | 39 | public:
|
---|
[20044] | 40 |
|
---|
[90828] | 41 | DECLARE_COMMON_CLASS_METHODS(VFSExplorer)
|
---|
[20044] | 42 |
|
---|
| 43 | // public initializer/uninitializer for internal purposes only
|
---|
[35638] | 44 | HRESULT FinalConstruct() { return BaseFinalConstruct(); }
|
---|
| 45 | void FinalRelease() { uninit(); BaseFinalRelease(); }
|
---|
[20044] | 46 |
|
---|
| 47 | HRESULT init(VFSType_T aType, Utf8Str aFilePath, Utf8Str aHostname, Utf8Str aUsername, Utf8Str aPassword, VirtualBox *aVirtualBox);
|
---|
| 48 | void uninit();
|
---|
| 49 |
|
---|
[30716] | 50 | /* public methods only for internal purposes */
|
---|
[90828] | 51 | static HRESULT setErrorStatic(HRESULT aResultCode, const char *aText, ...)
|
---|
[30716] | 52 | {
|
---|
[90828] | 53 | va_list va;
|
---|
| 54 | va_start(va, aText);
|
---|
| 55 | HRESULT hrc = setErrorInternalV(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, va, false, true);
|
---|
| 56 | va_end(va);
|
---|
| 57 | return hrc;
|
---|
[30716] | 58 | }
|
---|
| 59 |
|
---|
[20044] | 60 | private:
|
---|
[49644] | 61 |
|
---|
| 62 | // wrapped IVFSExplorer properties
|
---|
| 63 | HRESULT getPath(com::Utf8Str &aPath);
|
---|
| 64 | HRESULT getType(VFSType_T *aType);
|
---|
| 65 |
|
---|
| 66 | // wrapped IVFSExplorer methods
|
---|
| 67 | HRESULT update(ComPtr<IProgress> &aProgress);
|
---|
| 68 | HRESULT cd(const com::Utf8Str &aDir, ComPtr<IProgress> &aProgress);
|
---|
| 69 | HRESULT cdUp(ComPtr<IProgress> &aProgress);
|
---|
| 70 | HRESULT entryList(std::vector<com::Utf8Str> &aNames,
|
---|
| 71 | std::vector<ULONG> &aTypes,
|
---|
| 72 | std::vector<LONG64> &aSizes,
|
---|
| 73 | std::vector<ULONG> &aModes);
|
---|
| 74 | HRESULT exists(const std::vector<com::Utf8Str> &aNames,
|
---|
| 75 | std::vector<com::Utf8Str> &aExists);
|
---|
| 76 | HRESULT remove(const std::vector<com::Utf8Str> &aNames,
|
---|
| 77 | ComPtr<IProgress> &aProgress);
|
---|
| 78 |
|
---|
[20044] | 79 | /* Private member vars */
|
---|
[50174] | 80 | VirtualBox * const mVirtualBox;
|
---|
[20044] | 81 |
|
---|
[49644] | 82 | ////////////////////////////////////////////////////////////////////////////////
|
---|
| 83 | ////
|
---|
| 84 | //// VFSExplorer definitions
|
---|
| 85 | ////
|
---|
| 86 | //////////////////////////////////////////////////////////////////////////////////
|
---|
| 87 | //
|
---|
[60448] | 88 | class TaskVFSExplorer; /* Worker thread helper */
|
---|
[49871] | 89 | struct Data;
|
---|
[20044] | 90 | Data *m;
|
---|
| 91 |
|
---|
| 92 | /* Private member methods */
|
---|
[55611] | 93 | FsObjType_T i_iprtToVfsObjType(RTFMODE aType) const;
|
---|
[20044] | 94 |
|
---|
[49644] | 95 | HRESULT i_updateFS(TaskVFSExplorer *aTask);
|
---|
| 96 | HRESULT i_deleteFS(TaskVFSExplorer *aTask);
|
---|
| 97 |
|
---|
[20044] | 98 | };
|
---|
| 99 |
|
---|
[76562] | 100 | #endif /* !MAIN_INCLUDED_VFSExplorerImpl_h */
|
---|
[20044] | 101 |
|
---|