VirtualBox

source: vbox/trunk/src/VBox/Main/include/SharedFolderImpl.h@ 75380

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

Main,VBoxManage,FE/Qt: Extended the createSharedFolder and ISharedFolder methods with a mount poit parameter/attribute for use when auto-mounting. This is especially useful for Windows and OS/2 guests which operates with drive letters. The change has not yet trickled down to the guest interface and VBoxService.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/* $Id: SharedFolderImpl.h 75380 2018-11-09 22:25:30Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.215389.xyz. 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_SHAREDFOLDERIMPL
19#define ____H_SHAREDFOLDERIMPL
20
21#include "SharedFolderWrap.h"
22#include <VBox/shflsvc.h>
23
24class Console;
25
26class ATL_NO_VTABLE SharedFolder :
27 public SharedFolderWrap
28{
29public:
30
31 DECLARE_EMPTY_CTOR_DTOR (SharedFolder)
32
33 HRESULT FinalConstruct();
34 void FinalRelease();
35
36 // public initializer/uninitializer for internal purposes only
37 HRESULT init(Machine *aMachine, const com::Utf8Str &aName, const com::Utf8Str &aHostPath,
38 bool aWritable, bool aAutoMount, const com::Utf8Str &aAutoMountPoint, bool fFailOnError);
39 HRESULT initCopy(Machine *aMachine, SharedFolder *aThat);
40 HRESULT init(Console *aConsole, const com::Utf8Str &aName, const com::Utf8Str &aHostPath,
41 bool aWritable, bool aAutoMount, const com::Utf8Str &aAutoMountPoint, bool fFailOnError);
42// HRESULT init(VirtualBox *aVirtualBox, const Utf8Str &aName, const Utf8Str &aHostPath,
43// bool aWritable, const com::Utf8Str &aAutoMountPoint, bool aAutoMount, bool fFailOnError);
44 void uninit();
45
46 // public methods for internal purposes only
47 // (ensure there is a caller and a read lock before calling them!)
48
49 /**
50 * Public internal method. Returns the shared folder's name. Needs caller! Locking not necessary.
51 * @return
52 */
53 const Utf8Str &i_getName() const;
54
55 /**
56 * Public internal method. Returns the shared folder's host path. Needs caller! Locking not necessary.
57 * @return
58 */
59 const Utf8Str &i_getHostPath() const;
60
61 /**
62 * Public internal method. Returns true if the shared folder is writable. Needs caller and locking!
63 * @return
64 */
65 bool i_isWritable() const;
66
67 /**
68 * Public internal method. Returns true if the shared folder is auto-mounted. Needs caller and locking!
69 * @return
70 */
71 bool i_isAutoMounted() const;
72
73 /**
74 * Public internal method for getting the auto mount point.
75 */
76 const Utf8Str &i_getAutoMountPoint() const;
77
78protected:
79
80 HRESULT i_protectedInit(VirtualBoxBase *aParent,
81 const Utf8Str &aName,
82 const Utf8Str &aHostPath,
83 bool aWritable,
84 bool aAutoMount,
85 const com::Utf8Str &aAutoMountPoint,
86 bool fFailOnError);
87private:
88
89 // wrapped ISharedFolder properies.
90 HRESULT getName(com::Utf8Str &aName);
91 HRESULT getHostPath(com::Utf8Str &aHostPath);
92 HRESULT getAccessible(BOOL *aAccessible);
93 HRESULT getWritable(BOOL *aWritable);
94 HRESULT getAutoMount(BOOL *aAutoMount);
95 HRESULT getAutoMountPoint(com::Utf8Str &aAutoMountPoint);
96 HRESULT getLastAccessError(com::Utf8Str &aLastAccessError);
97
98 VirtualBoxBase * const mParent;
99
100 /* weak parents (only one of them is not null) */
101#if !defined(VBOX_COM_INPROC)
102 Machine * const mMachine;
103 VirtualBox * const mVirtualBox;
104#else
105 Console * const mConsole;
106#endif
107
108 struct Data; // opaque data struct, defined in SharedFolderImpl.cpp
109 Data *m;
110};
111
112#endif // !____H_SHAREDFOLDERIMPL
113/* 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