cmn_FastDirLst Class Reference
[Common, basic classes, functions and types]

#include <cmn_FastDirLst.h>

Collaboration diagram for cmn_FastDirLst:

Collaboration graph
[legend]

List of all members.


Detailed Description

class cmn_FastDirLst is a differrent inplementation of cmn_DirLst class it use getdents instead of readdir on Linux.

getdents() gets more directory entries at once.

Definition at line 35 of file cmn_FastDirLst.h.


Public Member Functions

 cmn_FastDirLst (const cmn_Path &a_pathUTF8, UInt32_t a_bufSize=64 *1024)
 ~cmn_FastDirLst ()
string GetNextName (ivd_GenInode_t &a_inode, ivd_FileType_e &a_fileType)
void Reset ()
 Reset the search to start of directory.

Public Attributes

 log_CLASSID_m

Private Attributes

const cmn_Path m_path
int m_fileHnd
 Find handler.
unsigned int m_bufSize
char * m_buffer
 used to store
char * m_bufFilledTo
 buffer filled up to
char * m_position
 buffer pos

Constructor & Destructor Documentation

cmn_FastDirLst::cmn_FastDirLst ( const cmn_Path a_pathUTF8,
UInt32_t  a_bufSize = 64 * 1024 
) [explicit]

Definition at line 34 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m, and Reset().

00037         :
00038         m_dirList(cmn_UTF8ToLocale(a_pathUTF8), ""),
00039         m_path(a_pathUTF8)
00040 {
00041     log_FUNC_m(cmn_FastDirLst);
00042 
00043     Reset();
00044 }

Here is the call graph for this function:

cmn_FastDirLst::~cmn_FastDirLst (  ) 

Definition at line 48 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m.

00049 {
00050     log_FUNC_m(~cmn_FastDirLst);
00051 }


Member Function Documentation

string cmn_FastDirLst::GetNextName ( ivd_GenInode_t a_inode,
ivd_FileType_e a_fileType 
)

Returns:
the null terminated pointer to char array a_inode and a_fileType are return values

NULL if no more entries

Definition at line 55 of file cmn_FastDir_HPUX.cpp.

References cmn_LocaleToUTF8(), log_FUNC_m, m_path, and cmn_File::StatF().

Referenced by cmn_CleanDir(), cmn_ListDir(), rm_DiskBufAllocator::DetectVolumes(), TreeWalk::GenerateDirTree(), ParseDiskMedium(), ParseDiskMediumVolume(), cmn_TreeWalk::PushDentries(), TreeWalk::Walk(), and i_MediumDupl_i::~i_MediumDupl_i().

00056 {
00057     log_FUNC_m(GetNextName);
00058 
00059     // DirLst works with locale name, convert it to UTF-8
00060     string name = cmn_LocaleToUTF8(m_dirList.GetNextName());
00061 
00062     if (name.empty()) {
00063         return name;
00064     }
00065 
00066     cmn_File f(m_path+name);
00067     ivd_FileInfo_t info;
00068 
00069     f.StatF(info);
00070 
00071     a_inode = info.idOnFS;
00072     a_fileType = info.type;
00073 
00074     return name;
00075 
00076 }

Here is the call graph for this function:

Here is the caller graph for this function:

void cmn_FastDirLst::Reset (  ) 

Reset the search to start of directory.

Definition at line 80 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m.

Referenced by cmn_FastDirLst().

00081 {
00082     log_FUNC_m(Reset);
00083 
00084     m_dirList.Reset(); 
00085 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 43 of file cmn_FastDirLst.h.

Definition at line 45 of file cmn_FastDirLst.h.

Referenced by GetNextName().

Find handler.

Definition at line 59 of file cmn_FastDirLst.h.

unsigned int cmn_FastDirLst::m_bufSize [private]

Definition at line 61 of file cmn_FastDirLst.h.

char* cmn_FastDirLst::m_buffer [private]

used to store

Definition at line 63 of file cmn_FastDirLst.h.

buffer filled up to

Definition at line 66 of file cmn_FastDirLst.h.

char* cmn_FastDirLst::m_position [private]

buffer pos

Definition at line 69 of file cmn_FastDirLst.h.


The documentation for this class was generated from the following files:

Generated on Mon Feb 27 19:04:24 2012 for OPENARCHIVE by  doxygen 1.5.6