Doxygen
Loading...
Searching...
No Matches
UsedDir Class Reference

Usage information of a directory. More...

#include <src/dirdef.h>

+ Collaboration diagram for UsedDir:

Public Member Functions

 UsedDir (const DirDef *dir)
 
void addFileDep (const FileDef *srcFd, const FileDef *dstFd, bool srcDirect, bool dstDirect)
 Take up dependency between files.
 
FilePairfindFilePair (const QCString &name)
 
const FilePairLinkedMapfilePairs () const
 
const DirDefdir () const
 
bool hasDirectDeps () const
 Returns true iff any of the dependencies between source and destination files are direct (i.e.
 
bool hasDirectSrcDeps () const
 Returns true iff any of the dependencies from the source file to the destination file are directly coming from a file in the source directory (i.e.
 
bool hasDirectDstDeps () const
 Returns true iff any of the dependencies from the source file to the destination file are directly targeting a file in the destination directory (i.e.
 
void sort ()
 

Private Attributes

const DirDefm_dir
 
FilePairLinkedMap m_filePairs
 
bool m_hasDirectDeps = false
 
bool m_hasDirectSrcDeps = false
 
bool m_hasDirectDstDeps = false
 

Detailed Description

Usage information of a directory.

Definition at line 63 of file dirdef.h.

Constructor & Destructor Documentation

◆ UsedDir()

UsedDir::UsedDir ( const DirDef * dir)

Definition at line 792 of file dirdef.cpp.

792 :
793 m_dir(dir)
794{
795}
const DirDef * dir() const
Definition dirdef.h:78
const DirDef * m_dir
Definition dirdef.h:98

References dir(), and m_dir.

Member Function Documentation

◆ addFileDep()

void UsedDir::addFileDep ( const FileDef * srcFd,
const FileDef * dstFd,
bool srcDirect,
bool dstDirect )

Take up dependency between files.

Parameters
[in]srcFddependent file which depends on dstFd
[in]dstFddependee file on which srcFd depends on
[in]srcDirecttrue iff the source dependency was the direct (not inherited from a sub dir)
[in]dstDirecttrue iff the destination dependency was direct (not inherited from a sub dir)

Definition at line 797 of file dirdef.cpp.

798{
799 m_filePairs.add(FilePair::key(srcFd,dstFd),std::make_unique<FilePair>(srcFd,dstFd));
800 m_hasDirectDeps = m_hasDirectDeps || (srcDirect && dstDirect);
803}
static QCString key(const FileDef *srcFd, const FileDef *dstFd)
Definition dirdef.cpp:883
bool m_hasDirectDstDeps
Definition dirdef.h:103
FilePairLinkedMap m_filePairs
Definition dirdef.h:99
bool m_hasDirectDeps
Definition dirdef.h:101
bool m_hasDirectSrcDeps
Definition dirdef.h:102

References FilePair::key(), m_filePairs, m_hasDirectDeps, m_hasDirectDstDeps, and m_hasDirectSrcDeps.

Referenced by DirDefImpl::addUsesDependency().

◆ dir()

const DirDef * UsedDir::dir ( ) const
inline

Definition at line 78 of file dirdef.h.

78{ return m_dir; }

References m_dir.

Referenced by UsedDir().

◆ filePairs()

const FilePairLinkedMap & UsedDir::filePairs ( ) const
inline

Definition at line 77 of file dirdef.h.

77{ return m_filePairs; }

References m_filePairs.

◆ findFilePair()

FilePair * UsedDir::findFilePair ( const QCString & name)

Definition at line 818 of file dirdef.cpp.

819{
820 return m_filePairs.find(name);
821}

References m_filePairs.

Referenced by DirDefImpl::addUsesDependency().

◆ hasDirectDeps()

bool UsedDir::hasDirectDeps ( ) const
inline

Returns true iff any of the dependencies between source and destination files are direct (i.e.

not "inherited" from sub directories)

Definition at line 83 of file dirdef.h.

83{ return m_hasDirectDeps; }

References m_hasDirectDeps.

◆ hasDirectDstDeps()

bool UsedDir::hasDirectDstDeps ( ) const
inline

Returns true iff any of the dependencies from the source file to the destination file are directly targeting a file in the destination directory (i.e.

not inherited via sub directories)

Definition at line 93 of file dirdef.h.

93{ return m_hasDirectDstDeps; }

References m_hasDirectDstDeps.

◆ hasDirectSrcDeps()

bool UsedDir::hasDirectSrcDeps ( ) const
inline

Returns true iff any of the dependencies from the source file to the destination file are directly coming from a file in the source directory (i.e.

not inherited via sub directories)

Definition at line 88 of file dirdef.h.

88{ return m_hasDirectSrcDeps; }

References m_hasDirectSrcDeps.

◆ sort()

void UsedDir::sort ( )

Definition at line 805 of file dirdef.cpp.

806{
807 std::stable_sort(m_filePairs.begin(),
808 m_filePairs.end(),
809 [](const auto &left,const auto &right)
810 {
811 int orderHi = qstricmp_sort(left->source()->name(),right->source()->name());
812 if (orderHi!=0) return orderHi<0;
813 int orderLo = qstricmp_sort(left->destination()->name(),right->destination()->name());
814 return orderLo<0;
815 });
816}

References m_filePairs.

Member Data Documentation

◆ m_dir

const DirDef* UsedDir::m_dir
private

Definition at line 98 of file dirdef.h.

Referenced by dir(), and UsedDir().

◆ m_filePairs

FilePairLinkedMap UsedDir::m_filePairs
private

Definition at line 99 of file dirdef.h.

Referenced by addFileDep(), filePairs(), findFilePair(), and sort().

◆ m_hasDirectDeps

bool UsedDir::m_hasDirectDeps = false
private

Definition at line 101 of file dirdef.h.

Referenced by addFileDep(), and hasDirectDeps().

◆ m_hasDirectDstDeps

bool UsedDir::m_hasDirectDstDeps = false
private

Definition at line 103 of file dirdef.h.

Referenced by addFileDep(), and hasDirectDstDeps().

◆ m_hasDirectSrcDeps

bool UsedDir::m_hasDirectSrcDeps = false
private

Definition at line 102 of file dirdef.h.

Referenced by addFileDep(), and hasDirectSrcDeps().


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