VirtualBox

Ignore:
Timestamp:
Sep 28, 2018 3:08:24 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125394
Message:

DnD: Renaming for DnDURIObject / DnDURIList classes, some typedefs to distinguish flags better. No functional changes.

Location:
trunk/src/VBox/GuestHost/DragAndDrop
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDDroppedFiles.cpp

    r69753 r74526  
    55
    66/*
    7  * Copyright (C) 2014-2017 Oracle Corporation
     7 * Copyright (C) 2014-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3838    , m_hDir(NULL) { }
    3939
    40 DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, uint32_t fFlags)
     40DnDDroppedFiles::DnDDroppedFiles(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */)
    4141    : m_fOpen(0)
    4242    , m_hDir(NULL)
     
    101101}
    102102
    103 int DnDDroppedFiles::OpenEx(const char *pszPath, uint32_t fFlags)
     103int DnDDroppedFiles::OpenEx(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */)
    104104{
    105105    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
     
    168168}
    169169
    170 int DnDDroppedFiles::OpenTemp(uint32_t fFlags)
     170int DnDDroppedFiles::OpenTemp(DNDURIDROPPEDFILEFLAGS fFlags /* = DNDURIDROPPEDFILE_FLAGS_NONE */)
    171171{
    172172    AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); /* Flags not supported yet. */
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp

    r69758 r74526  
    55
    66/*
    7  * Copyright (C) 2014-2017 Oracle Corporation
     7 * Copyright (C) 2014-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848}
    4949
    50 int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, uint32_t fFlags)
     50int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, DNDURILISTFLAGS fFlags)
    5151{
    5252    AssertPtrReturn(pcszSource, VERR_INVALID_POINTER);
     
    6464                         pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode));
    6565
    66             DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
     66            DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::Type_File, pcszSource, pcszTarget);
    6767            if (pObjFile)
    6868            {
     
    7070                {
    7171                    /** @todo Add a standard fOpen mode for this list. */
    72                     rc = pObjFile->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);
     72                    rc = pObjFile->Open(DnDURIObject::View_Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);
    7373                }
    7474
     
    9090            LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode));
    9191
    92             DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
     92            DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Type_Directory, pcszSource, pcszTarget,
    9393                                                     objInfo.Attr.fMode, 0 /* Size */);
    9494            if (pObjDir)
     
    112112
    113113int DnDURIList::appendPathRecursive(const char *pcszSrcPath,
    114                                     const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, uint32_t fFlags)
     114                                    const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase,
     115                                    DNDURILISTFLAGS fFlags)
    115116{
    116117    AssertPtrReturn(pcszSrcPath, VERR_INVALID_POINTER);
     
    118119    AssertPtrReturn(pcszDstPath, VERR_INVALID_POINTER);
    119120
    120     LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu\n",
    121                  pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase));
     121    LogFlowFunc(("pcszSrcPath=%s, pcszDstPath=%s, pcszDstBase=%s, cchDstBase=%zu, fFlags=0x%x\n",
     122                 pcszSrcPath, pcszDstPath, pcszDstBase, cchDstBase, fFlags));
    122123
    123124    RTFSOBJINFO objInfo;
     
    278279}
    279280
    280 int DnDURIList::AppendNativePath(const char *pszPath, uint32_t fFlags)
     281int DnDURIList::AppendNativePath(const char *pszPath, DNDURILISTFLAGS fFlags)
    281282{
    282283    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
     
    307308
    308309int DnDURIList::AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths,
    309                                           uint32_t fFlags)
     310                                          DNDURILISTFLAGS fFlags)
    310311{
    311312    AssertPtrReturn(pszNativePaths, VERR_INVALID_POINTER);
     
    318319
    319320int DnDURIList::AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths,
    320                                           uint32_t fFlags)
     321                                          DNDURILISTFLAGS fFlags)
    321322{
    322323    int rc = VINF_SUCCESS;
     
    334335}
    335336
    336 int DnDURIList::AppendURIPath(const char *pszURI, uint32_t fFlags)
     337int DnDURIList::AppendURIPath(const char *pszURI, DNDURILISTFLAGS fFlags)
    337338{
    338339    AssertPtrReturn(pszURI, VERR_INVALID_POINTER);
     
    385386
    386387int DnDURIList::AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths,
    387                                        uint32_t fFlags)
     388                                       DNDURILISTFLAGS fFlags)
    388389{
    389390    AssertPtrReturn(pszURIPaths, VERR_INVALID_POINTER);
     
    396397
    397398int DnDURIList::AppendURIPathsFromList(const RTCList<RTCString> &lstURI,
    398                                        uint32_t fFlags)
     399                                       DNDURILISTFLAGS fFlags)
    399400{
    400401    int rc = VINF_SUCCESS;
     
    447448}
    448449
    449 int DnDURIList::RootFromURIData(const void *pvData, size_t cbData, uint32_t fFlags)
     450int DnDURIList::SetFromURIData(const void *pvData, size_t cbData, DNDURILISTFLAGS fFlags)
    450451{
    451452    Assert(fFlags == 0); RT_NOREF1(fFlags);
     
    493494}
    494495
    495 RTCString DnDURIList::RootToString(const RTCString &strPathBase /* = "" */,
     496RTCString DnDURIList::GetRootEntries(const RTCString &strPathBase /* = "" */,
    496497                                   const RTCString &strSeparator /* = "\r\n" */) const
    497498{
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp

    r69500 r74526  
    66
    77/*
    8  * Copyright (C) 2014-2017 Oracle Corporation
     8 * Copyright (C) 2014-2018 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737
    3838DnDURIObject::DnDURIObject(void)
    39     : m_Type(Unknown)
     39    : m_Type(Type_Unknown)
    4040    , m_fOpen(false)
    4141    , m_fMode(0)
     
    4646}
    4747
    48 DnDURIObject::DnDURIObject(Type type,
     48DnDURIObject::DnDURIObject(Type enmType,
    4949                           const RTCString &strSrcPath /* = 0 */,
    5050                           const RTCString &strDstPath /* = 0 */,
    5151                           uint32_t fMode  /* = 0 */, uint64_t cbSize  /* = 0 */)
    52     : m_Type(type)
     52    : m_Type(enmType)
    5353    , m_strSrcPath(strSrcPath)
    5454    , m_strTgtPath(strDstPath)
     
    7474    switch (m_Type)
    7575    {
    76         case File:
     76        case Type_File:
    7777        {
    7878            RTFileClose(u.m_hFile);
     
    8181        }
    8282
    83         case Directory:
     83        case Type_Directory:
    8484            break;
    8585
     
    102102    switch (m_Type)
    103103    {
    104         case File:
     104        case Type_File:
    105105            Assert(m_cbProcessed <= m_cbSize);
    106106            fComplete = m_cbProcessed == m_cbSize;
    107107            break;
    108108
    109         case Directory:
     109        case Type_Directory:
    110110            fComplete = true;
    111111            break;
     
    124124}
    125125
    126 int DnDURIObject::Open(Dest enmDest, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */)
    127 {
    128     return OpenEx(  enmDest == Source
     126int DnDURIObject::Open(View enmView, uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */)
     127{
     128    return OpenEx(  enmView == View_Source
    129129                  ? m_strSrcPath : m_strTgtPath
    130                   , m_Type, enmDest, fOpen, fMode, 0 /* fFlags */);
    131 }
    132 
    133 int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, Dest enmDest,
    134                          uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, uint32_t fFlags /* = 0 */)
     130                  , m_Type, enmView, fOpen, fMode, 0 /* fFlags */);
     131}
     132
     133int DnDURIObject::OpenEx(const RTCString &strPath, Type enmType, View enmView,
     134                         uint64_t fOpen /* = 0 */, uint32_t fMode /* = 0 */, DNDURIOBJECTFLAGS fFlags /* = DNDURIOBJECT_FLAGS_NONE */)
    135135{
    136136    Assert(fFlags == 0); RT_NOREF1(fFlags);
    137137    int rc = VINF_SUCCESS;
    138138
    139     switch (enmDest)
    140     {
    141         case Source:
     139    switch (enmView)
     140    {
     141        case View_Source:
    142142            m_strSrcPath = strPath;
    143143            break;
    144144
    145         case Target:
     145        case View_Target:
    146146            m_strTgtPath = strPath;
    147147            break;
     
    155155        && fOpen) /* Opening mode specified? */
    156156    {
    157         LogFlowThisFunc(("enmType=%RU32, strPath=%s, fOpen=0x%x, enmType=%RU32, enmDest=%RU32\n",
    158                          enmType, strPath.c_str(), fOpen, enmType, enmDest));
     157        LogFlowThisFunc(("strPath=%s, enmType=%RU32, enmView=%RU32, fOpen=0x%x, fMode=0x%x, fFlags=0x%x\n",
     158                         strPath.c_str(), enmType, enmView, fOpen, fFlags));
    159159        switch (enmType)
    160160        {
    161             case File:
     161            case Type_File:
    162162            {
    163163                if (!m_fOpen)
     
    207207            }
    208208
    209             case Directory:
     209            case Type_Directory:
    210210                rc = VINF_SUCCESS;
    211211                break;
     
    294294    switch (m_Type)
    295295    {
    296         case File:
    297         {
    298             rc = OpenEx(m_strSrcPath, File, Source,
     296        case Type_File:
     297        {
     298            rc = OpenEx(m_strSrcPath, Type_File, View_Source,
    299299                        /* Use some sensible defaults. */
    300300                        RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */);
     
    319319        }
    320320
    321         case Directory:
     321        case Type_Directory:
    322322        {
    323323            rc = VINF_SUCCESS;
     
    346346    Close();
    347347
    348     m_Type        = Unknown;
     348    m_Type        = Type_Unknown;
    349349    m_strSrcPath  = "";
    350350    m_strTgtPath  = "";
     
    365365    switch (m_Type)
    366366    {
    367         case File:
    368         {
    369             rc = OpenEx(m_strTgtPath, File, Target,
     367        case Type_File:
     368        {
     369            rc = OpenEx(m_strTgtPath, Type_File, View_Target,
    370370                        /* Use some sensible defaults. */
    371371                        RTFILE_O_OPEN_CREATE | RTFILE_O_DENY_WRITE | RTFILE_O_WRITE, 0 /* fFlags */);
     
    379379        }
    380380
    381         case Directory:
     381        case Type_Directory:
    382382        {
    383383            rc = VINF_SUCCESS;
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