VirtualBox

Changeset 55631 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
May 4, 2015 4:08:10 AM (10 years ago)
Author:
vboxsync
Message:

IGuestSession:

  • Added pathStyle attribute and associated enum.
  • Added a currentDirectory attribute (stub).
  • Introduced fsObjExists (earlier fsExists) which works on all fs obj types.
  • Combined directoryQueryInfo and fileQueryInfo into fsObjQueryInfo (earlier fsQueryInfo) which works on all fs obj types. Caller can check the type attribute.
  • Combined fileRemove and symlinkRemove* into fsObjRemove both on suggestion from Michael and because it's impossible to implement correctly with introducing races. Besides, our implementation was already doing the fsObjRemove job, no type checks.
  • Combined directoryRename, fileRename and symlinkRename into fsObjRename since we cannot implement type specific renames without introducing races on all platforms, and again, the current implementation already does the whole shebang.
  • Combined directorySetACL and fileSetACL into fsObjSetACL, adding a UNIX-style mode parameter for use when the ACL string is empty.
  • Stubbed the recursive directory copy methods directoryCopy, directoryCopyToGuest, and directoryCopyFromGuest. These replaces the proposed FileCopyFlag::Recursive flag.
  • Stubbed a generic move-anything-inside-the-guest method, fsObjMove, for future explotations. (Considered this on file/dir level, but it's the rename and type race problem. So, did the 'mv' approach instead.)
  • Renamed CopyFileFlag to FileCopyFlag.
  • Prefixed copyTo and copyFrom with 'file' and added 'Guest' postfix to clarify the direction (now: fileCopyToGuest, fileCopyFromGuest).
  • Added fileCopy method for copy a guest file to another guest location.
  • directoryExists got a followSymlinks parameter.
  • fileExist and fileQuerySize all got a followSymlinks parameter.
  • Retired directoryRename in favor of fsObjRename.
  • Retired directorySetACL in favor of fsObjSetACL.
  • Retired fileSetACL in favor of fsObjSetACL.
  • Retired fileRemove in favor of fsObjRemove - fileRemove was already removing everything except directories, no need for ambiguous duplications.
  • Retired symlinkRemoveDirectory and symlinkRemoveFile in favor of fsObjRemove.
  • replaced the openMode string parameter int fileOpen[Ex] methods with an enum FileAccessMode (we made some wrong design choices way back).
  • replaced the disposition string parameter in fileOpen[Ex] methods with an enum FileOpenAction. This one was more obvious, should've seen this way back.
  • replaced the sharingMode stirng parameter in the fileOpenEx method with an enum FileSharingMode.
  • Documented directoryRemoveRecursive flags issue.


IFile,IGuestFile:

  • Stubbed querySize
  • Stubbed setSize.
  • Renamed FileSeekType to FileSeekOrigin.
  • Implemented seek() relative to end, flag was forgotten.
  • Made seek() return the new offset.
  • Extended setACL with a UNIX-style file mode argument that should be used if the ACL string is empty (this way we can actually get something implemented without 2 months of cross platform ACL research).
  • The openMode and disposition attributes has been updated to match the fileOpenEx enum changes.
Location:
trunk/src/VBox/Main/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h

    r55594 r55631  
    599599    /** The filename. */
    600600    Utf8Str                 mFileName;
    601     /** Then file's opening mode. */
    602     Utf8Str                 mOpenMode;
    603     /** The file's disposition mode. */
    604     Utf8Str                 mDisposition;
    605     /** The file's sharing mode.
    606      **@todo Not implemented yet.*/
    607     Utf8Str                 mSharingMode;
     601    /** The file access mode. */
     602    FileAccessMode_T        mAccessMode;
     603    /** String translation of mFileAccessMode for the GAs. */
     604    const char             *mpszAccessMode;
     605    /** The file open action.  */
     606    FileOpenAction_T        mOpenAction;
     607    /** String translation of mOpenAction for the GAs. */
     608    const char             *mpszOpenAction;
     609    /** The file sharing mode. */
     610    FileSharingMode_T       mSharingMode;
    608611    /** Octal creation mode. */
    609612    uint32_t                mCreationMode;
  • trunk/src/VBox/Main/include/GuestFileImpl.h

    r51321 r55631  
    7272private:
    7373
    74     /** Wrapped @name IGuestFile properties.
     74    /** @name Wrapped IGuestFile properties.
    7575     * @{ */
    7676    HRESULT getCreationMode(ULONG *aCreationMode);
    77     HRESULT getDisposition(com::Utf8Str &aDisposition);
    7877    HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
    79     HRESULT getFileName(com::Utf8Str &aFileName);
    8078    HRESULT getId(ULONG *aId);
    8179    HRESULT getInitialSize(LONG64 *aInitialSize);
    82     HRESULT getOpenMode(com::Utf8Str &aOpenMode);
    8380    HRESULT getOffset(LONG64 *aOffset);
    8481    HRESULT getStatus(FileStatus_T *aStatus);
     82    HRESULT getFileName(com::Utf8Str &aFileName);
     83    HRESULT getAccessMode(FileAccessMode_T *aAccessMode);
     84    HRESULT getOpenAction(FileOpenAction_T *aOpenAction);
    8585    /** @}  */
    8686
    87     /** Wrapped @name IGuestFile methods.
     87    /** @name Wrapped IGuestFile methods.
    8888     * @{ */
    8989    HRESULT close();
    9090    HRESULT queryInfo(ComPtr<IFsObjInfo> &aObjInfo);
     91    HRESULT querySize(LONG64 *aSize);
    9192    HRESULT read(ULONG aToRead,
    9293                 ULONG aTimeoutMS,
     
    9798                   std::vector<BYTE> &aData);
    9899    HRESULT seek(LONG64 aOffset,
    99                  FileSeekType_T aWhence);
    100     HRESULT setACL(const com::Utf8Str &aAcl);
     100                 FileSeekOrigin_T aWhence,
     101                 LONG64 *aNewOffset);
     102    HRESULT setACL(const com::Utf8Str &aAcl,
     103                   ULONG aMode);
     104    HRESULT setSize(LONG64 aSize);
    101105    HRESULT write(const std::vector<BYTE> &aData,
    102106                  ULONG aTimeoutMS,
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r55613 r55631  
    273273    HRESULT getProcesses(std::vector<ComPtr<IGuestProcess> > &aProcesses);
    274274    HRESULT getPathStyle(PathStyle_T *aPathStyle);
     275    HRESULT getCurrentDirectory(com::Utf8Str &aCurrentDirectory);
     276    HRESULT setCurrentDirectory(const com::Utf8Str &aCurrentDirectory);
    275277    HRESULT getDirectories(std::vector<ComPtr<IGuestDirectory> > &aDirectories);
    276278    HRESULT getFiles(std::vector<ComPtr<IGuestFile> > &aFiles);
     
    281283     * @{ */
    282284    HRESULT close();
    283     HRESULT copyFrom(const com::Utf8Str &aSource,
    284                      const com::Utf8Str &aDest,
    285                      const std::vector<CopyFileFlag_T> &aFlags,
    286                      ComPtr<IProgress> &aProgress);
    287     HRESULT copyTo(const com::Utf8Str &aSource,
    288                    const com::Utf8Str &aDest,
    289                    const std::vector<CopyFileFlag_T> &aFlags,
    290                    ComPtr<IProgress> &aProgress);
     285
     286    HRESULT directoryCopy(const com::Utf8Str &aSource,
     287                          const com::Utf8Str &aDestination,
     288                          const std::vector<DirectoryCopyFlags_T> &aFlags,
     289                          ComPtr<IProgress> &aProgress);
     290    HRESULT directoryCopyFromGuest(const com::Utf8Str &aSource,
     291                                   const com::Utf8Str &aDestination,
     292                                   const std::vector<DirectoryCopyFlags_T> &aFlags,
     293                                   ComPtr<IProgress> &aProgress);
     294    HRESULT directoryCopyToGuest(const com::Utf8Str &aSource,
     295                                 const com::Utf8Str &aDestination,
     296                                 const std::vector<DirectoryCopyFlags_T> &aFlags,
     297                                 ComPtr<IProgress> &aProgress);
    291298    HRESULT directoryCreate(const com::Utf8Str &aPath,
    292299                            ULONG aMode,
     
    298305                                com::Utf8Str &aDirectory);
    299306    HRESULT directoryExists(const com::Utf8Str &aPath,
     307                            BOOL aFollowSymlinks,
    300308                            BOOL *aExists);
    301309    HRESULT directoryOpen(const com::Utf8Str &aPath,
     
    303311                          const std::vector<DirectoryOpenFlag_T> &aFlags,
    304312                          ComPtr<IGuestDirectory> &aDirectory);
    305     HRESULT directoryQueryInfo(const com::Utf8Str &aPath,
    306                                ComPtr<IGuestFsObjInfo> &aInfo);
    307313    HRESULT directoryRemove(const com::Utf8Str &aPath);
    308314    HRESULT directoryRemoveRecursive(const com::Utf8Str &aPath,
    309315                                     const std::vector<DirectoryRemoveRecFlag_T> &aFlags,
    310316                                     ComPtr<IProgress> &aProgress);
    311     HRESULT directoryRename(const com::Utf8Str &aSource,
    312                             const com::Utf8Str &aDest,
    313                             const std::vector<PathRenameFlag_T> &aFlags);
    314     HRESULT directorySetACL(const com::Utf8Str &aPath,
    315                              const com::Utf8Str &aAcl);
    316317    HRESULT environmentScheduleSet(const com::Utf8Str &aName,
    317318                                   const com::Utf8Str &aValue);
     
    321322    HRESULT environmentDoesBaseVariableExist(const com::Utf8Str &aName,
    322323                                             BOOL *aExists);
     324
     325    HRESULT fileCopy(const com::Utf8Str &aSource,
     326                     const com::Utf8Str &aDestination,
     327                     const std::vector<FileCopyFlag_T> &aFlags,
     328                     ComPtr<IProgress> &aProgress);
     329    HRESULT fileCopyToGuest(const com::Utf8Str &aSource,
     330                            const com::Utf8Str &aDestination,
     331                            const std::vector<FileCopyFlag_T> &aFlags,
     332                            ComPtr<IProgress> &aProgress);
     333    HRESULT fileCopyFromGuest(const com::Utf8Str &aSource,
     334                              const com::Utf8Str &aDestination,
     335                              const std::vector<FileCopyFlag_T> &aFlags,
     336                              ComPtr<IProgress> &aProgress);
    323337    HRESULT fileCreateTemp(const com::Utf8Str &aTemplateName,
    324338                           ULONG aMode,
     
    327341                           ComPtr<IGuestFile> &aFile);
    328342    HRESULT fileExists(const com::Utf8Str &aPath,
     343                       BOOL aFollowSymlinks,
    329344                       BOOL *aExists);
    330     HRESULT fileRemove(const com::Utf8Str &aPath);
    331345    HRESULT fileOpen(const com::Utf8Str &aPath,
    332                      const com::Utf8Str &aOpenMode,
    333                      const com::Utf8Str &aDisposition,
     346                     FileAccessMode_T aAccessMode,
     347                     FileOpenAction_T aOpenAction,
    334348                     ULONG aCreationMode,
    335349                     ComPtr<IGuestFile> &aFile);
    336350    HRESULT fileOpenEx(const com::Utf8Str &aPath,
    337                        const com::Utf8Str &aOpenMode,
    338                        const com::Utf8Str &aDisposition,
    339                        const com::Utf8Str &aSharingMode,
     351                       FileAccessMode_T aAccessMode,
     352                       FileOpenAction_T aOpenAction,
     353                       FileSharingMode_T aSharingMode,
    340354                       ULONG aCreationMode,
    341355                       LONG64 aOffset,
    342356                       ComPtr<IGuestFile> &aFile);
    343     HRESULT fileQueryInfo(const com::Utf8Str &aPath,
    344                           ComPtr<IGuestFsObjInfo> &aInfo);
    345357    HRESULT fileQuerySize(const com::Utf8Str &aPath,
     358                          BOOL aFollowSymlinks,
    346359                          LONG64 *aSize);
    347     HRESULT fileRename(const com::Utf8Str &aSource,
    348                        const com::Utf8Str &aDest,
    349                        const std::vector<PathRenameFlag_T> &aFlags);
    350     HRESULT fileSetACL(const com::Utf8Str &aFile,
    351                        const com::Utf8Str &aAcl);
    352     HRESULT fsExists(const com::Utf8Str &aPath,
    353                      BOOL aFollowSymlinks,
    354                      BOOL *pfExists);
    355     HRESULT fsQueryInfo(const com::Utf8Str &aPath,
     360    HRESULT fsObjExists(const com::Utf8Str &aPath,
    356361                        BOOL aFollowSymlinks,
    357                         ComPtr<IGuestFsObjInfo> &aInfo);
     362                        BOOL *pfExists);
     363    HRESULT fsObjQueryInfo(const com::Utf8Str &aPath,
     364                           BOOL aFollowSymlinks,
     365                           ComPtr<IGuestFsObjInfo> &aInfo);
     366    HRESULT fsObjRemove(const com::Utf8Str &aPath);
     367    HRESULT fsObjRename(const com::Utf8Str &aOldPath,
     368                        const com::Utf8Str &aNewPath,
     369                        const std::vector<FsObjRenameFlag_T> &aFlags);
     370    HRESULT fsObjMove(const com::Utf8Str &aSource,
     371                      const com::Utf8Str &aDestination,
     372                      const std::vector<FsObjMoveFlags_T> &aFlags,
     373                      ComPtr<IProgress> &aProgress);
     374    HRESULT fsObjSetACL(const com::Utf8Str &aPath,
     375                        BOOL aFollowSymlinks,
     376                        const com::Utf8Str &aAcl,
     377                        ULONG aMode);
    358378    HRESULT processCreate(const com::Utf8Str &aCommand,
    359379                          const std::vector<com::Utf8Str> &aArguments,
     
    380400                        const std::vector<SymlinkReadFlag_T> &aFlags,
    381401                        com::Utf8Str &aTarget);
    382     HRESULT symlinkRemoveDirectory(const com::Utf8Str &aPath);
    383     HRESULT symlinkRemoveFile(const com::Utf8Str &aFile);
    384402    HRESULT waitFor(ULONG aWaitFor,
    385403                    ULONG aTimeoutMS,
     
    422440    int                     i_fileOpenInternal(const GuestFileOpenInfo &openInfo, ComObjPtr<GuestFile> &pFile, int *pGuestRc);
    423441    int                     i_fileQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *pGuestRc);
    424     int                     i_fileQuerySizeInternal(const Utf8Str &strPath, int64_t *pllSize, int *pGuestRc);
     442    int                     i_fileQuerySizeInternal(const Utf8Str &strPath, bool fFollowSymlinks, int64_t *pllSize, int *pGuestRc);
    425443    int                     i_fsQueryInfoInternal(const Utf8Str &strPath, bool fFollowSymlinks, GuestFsObjData &objData, int *pGuestRc);
    426444    const GuestCredentials &i_getCredentials(void);
Note: See TracChangeset for help on using the changeset viewer.

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