chxavnamedisplaytrait.cpp
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:2k
源码类别:
Symbian
开发平台:
C/C++
- /*****************************************************************************
- * chxavnamedisplaytrait.cpp
- * -------------------------
- *
- * Synopsis:
- * Encapsulates state and logic for deciding how to display filenames
- * to users based on whether or not you want to hide file extensions
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *****************************************************************************/
- // Include from this project...
- #include "chxavfileutil.h"
- #include "chxavnamedisplaytrait.h"
- #include "chxavutil.h"
- ////////////////////////////////////////////
- // return name split into two components:
- //
- // first : as it should be displayed to user
- // second : what should be appended to user input, i.e., dotted extension
- // (for file) or path suffix (for folder)
- //
- NameExt CHXAvNameDisplayTrait::GetDisplayText(const TDesC& fullName, bool bAssumeFolder) const
- {
- NameExt pair;
- if( bAssumeFolder || CHXAvFile::HasFolderSuffix(fullName) )
- {
- // return 'foldername' , '/'
- pair.first.Set(CHXAvFile::GetNakedPathNode(fullName));
- pair.second.Set(CHXAvUtil::KPathSep);
- }
- else
- {
- if(m_bHideExtensions )
- {
- // hide extensions for filenames only
- pair.first.Set(CHXAvFile::GetNakedName(fullName));
- pair.second.Set(CHXAvFile::GetExtension(fullName));
- }
- else
- {
- pair.first.Set(CHXAvFile::GetNakedPathNode(fullName));
- }
- }
- return pair;
- }