Public Member Functions | Public Attributes | Private Attributes

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

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

#include <cmn_FastDirLst.h>

Collaboration diagram for cmn_FastDirLst:
Collaboration graph
[legend]

List of all members.

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

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 49 of file cmn_FastDirLst.h.


Constructor & Destructor Documentation

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

Definition at line 48 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m, and Reset().

        :
        m_dirList(cmn_UTF8ToLocale(a_pathUTF8), ""),
        m_path(a_pathUTF8)
{
    log_FUNC_m(cmn_FastDirLst);

    Reset();
}

Here is the call graph for this function:

cmn_FastDirLst::~cmn_FastDirLst (  ) 

Definition at line 62 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m.


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 69 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(), hsm_HL7CacheFile::hsm_HL7CacheFile(), hsm_HL7MessageProxy::hsm_HL7MessageProxy(), ParseDiskMedium(), ParseDiskMediumVolume(), cmn_TreeWalk::PushDentries(), TreeWalk::Walk(), and i_MediumDupl_i::~i_MediumDupl_i().

{
    log_FUNC_m(GetNextName);

    // DirLst works with locale name, convert it to UTF-8
    string name = cmn_LocaleToUTF8(m_dirList.GetNextName());

    if (name.empty()) {
        return name;
    }

    cmn_File f(m_path+name);
    ivd_FileInfo_t info;

    f.StatF(info);

    a_inode = info.idOnFS;
    a_fileType = info.type;

    return name;

}

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 94 of file cmn_FastDir_HPUX.cpp.

References log_FUNC_m.

Referenced by cmn_FastDirLst().

{
    log_FUNC_m(Reset);

    m_dirList.Reset(); 
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 57 of file cmn_FastDirLst.h.

char* cmn_FastDirLst::m_buffer [private]

used to store

Definition at line 77 of file cmn_FastDirLst.h.

buffer filled up to

Definition at line 80 of file cmn_FastDirLst.h.

unsigned int cmn_FastDirLst::m_bufSize [private]

Definition at line 75 of file cmn_FastDirLst.h.

Find handler.

Definition at line 73 of file cmn_FastDirLst.h.

Definition at line 59 of file cmn_FastDirLst.h.

Referenced by GetNextName().

char* cmn_FastDirLst::m_position [private]

buffer pos

Definition at line 83 of file cmn_FastDirLst.h.


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