chxavfilesystemwatcher.cpp

来自「symbian 下的helix player源代码」· C++ 代码 · 共 96 行

CPP
96
字号
/************************************************************************
 * chxavfilesystemwatcher.cpp
 * --------------------------
 *
 * Synopsis:
 * Manages active object and RFs to watch for file system events for a 
 * given path.
 *
 * Notifications are forwarded to a single observer/client.
 * 
 * 
 * Target:
 * Symbian OS
 *
 *
 * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 ************************************************************************/ 

// Symbian includes...
#include <f32file.h>

// Includes from this project...
#include "chxavmisc.h"
#include "hxsym_debug.h"
#include "chxavfilesystemwatcher.h"


CHXAvFileSystemWatcher::CHXAvFileSystemWatcher(RFs& fs)
: m_fs(fs)
, m_notifyType(ENotifyEntry)
{
}

///////////////////////////////////
// dtor
CHXAvFileSystemWatcher::~CHXAvFileSystemWatcher()
{
    StopWatching();
}

////////////////////////////////////////////////////////
//
void CHXAvFileSystemWatcher::ConstructL()
{
    BaseConstructL();
    m_spWatchPath = KNullDesC().AllocL();
}


////////////////////////////////////////////////////////
// path can have wildcard to watch directories across
// drives, e.g.:
//
// *:\realnetworks\data
// c:\realnetworks\data
//
// **** you cannot watch from the root, e.g., 'c:\'
//
void CHXAvFileSystemWatcher::SetWatchPathL(const TDesC& path)
{
    // cleanup old stuff in case we are chaging the path
    StopWatching(); 
    m_spWatchPath = path.AllocL();
    DPRINTF(SYMP_FILE, ("CHXAvFileSystemWatcher::SetWatchPathL(): watching '%s'\n", dbg::CharPtr(path)()));

}

////////////////////////////////////////////////////////
//
void CHXAvFileSystemWatcher::DoIssueRequest(const CHXAvActiveCmplPtr& spActive)
{
    if( m_spWatchPath->Length() > 0)
    {
        m_fs.NotifyChange(m_notifyType, spActive->Status(), *m_spWatchPath);
    }
    else
    {
        // no watch path; watch everything
        m_fs.NotifyChange(m_notifyType, spActive->Status());
    }
}

////////////////////////////////////////////////////////
//
void CHXAvFileSystemWatcher::DoCancelRequest(const CHXAvActiveCmplPtr& spActive)
{
    m_fs.NotifyChangeCancel(spActive->Status());
}






⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?