Skip to main content

The UsedDir Class Reference

Usage information of a directory. More...

Declaration

class UsedDir { ... }

Included Headers

#include <src/dirdef.h>

Public Constructors Index

UsedDir (const DirDef *dir)

Public Member Functions Index

voidaddFileDep (const FileDef *srcFd, const FileDef *dstFd, bool srcDirect, bool dstDirect)

Take up dependency between files. More...

FilePair *findFilePair (const QCString &name)
const FilePairLinkedMap &filePairs () const
const DirDef *dir () const
boolhasDirectDeps () const

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

boolhasDirectSrcDeps () 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. More...

boolhasDirectDstDeps () 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. More...

voidsort ()

Private Member Attributes Index

const DirDef *m_dir
FilePairLinkedMapm_filePairs
boolm_hasDirectDeps = false
boolm_hasDirectSrcDeps = false
boolm_hasDirectDstDeps = false

Description

Usage information of a directory.

Definition at line 63 of file dirdef.h.

Public Constructors

UsedDir()

UsedDir::UsedDir (const DirDef * dir)

Declaration at line 66 of file dirdef.h, definition at line 815 of file dirdef.cpp.

816 m_dir(dir)
817{
818}

References dir and m_dir.

Public Member Functions

addFileDep()

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

Take up dependency between files.

Parameters
[in] srcFd

dependent file which depends on dstFd

[in] dstFd

dependee file on which srcFd depends on

[in] srcDirect

true iff the source dependency was the direct (not inherited from a sub dir)

[in] dstDirect

true iff the destination dependency was direct (not inherited from a sub dir)

Declaration at line 75 of file dirdef.h, definition at line 820 of file dirdef.cpp.

820void UsedDir::addFileDep(const FileDef *srcFd,const FileDef *dstFd, bool srcDirect, bool dstDirect)
821{
822 m_filePairs.add(FilePair::key(srcFd,dstFd),std::make_unique<FilePair>(srcFd,dstFd));
823 m_hasDirectDeps = m_hasDirectDeps || (srcDirect && dstDirect);
826}

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

Referenced by DirDefImpl::addUsesDependency.

dir()

const DirDef * UsedDir::dir ()
inline

Definition at line 78 of file dirdef.h.

78 const DirDef *dir() const { return m_dir; }

Reference m_dir.

Referenced by UsedDir.

filePairs()

const FilePairLinkedMap & UsedDir::filePairs ()
inline

Definition at line 77 of file dirdef.h.

77 const FilePairLinkedMap &filePairs() const { return m_filePairs; }

Reference m_filePairs.

findFilePair()

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

Declaration at line 76 of file dirdef.h, definition at line 841 of file dirdef.cpp.

842{
843 return m_filePairs.find(name);
844}

Reference m_filePairs.

Referenced by DirDefImpl::addUsesDependency.

hasDirectDeps()

bool UsedDir::hasDirectDeps ()
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 bool hasDirectDeps() const { return m_hasDirectDeps; }

Reference m_hasDirectDeps.

hasDirectDstDeps()

bool UsedDir::hasDirectDstDeps ()
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 bool hasDirectDstDeps() const { return m_hasDirectDstDeps; }

Reference m_hasDirectDstDeps.

hasDirectSrcDeps()

bool UsedDir::hasDirectSrcDeps ()
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 bool hasDirectSrcDeps() const { return m_hasDirectSrcDeps; }

Reference m_hasDirectSrcDeps.

sort()

void UsedDir::sort ()

Declaration at line 95 of file dirdef.h, definition at line 828 of file dirdef.cpp.

829{
830 std::stable_sort(m_filePairs.begin(),
831 m_filePairs.end(),
832 [](const auto &left,const auto &right)
833 {
834 int orderHi = qstricmp_sort(left->source()->name(),right->source()->name());
835 if (orderHi!=0) return orderHi<0;
836 int orderLo = qstricmp_sort(left->destination()->name(),right->destination()->name());
837 return orderLo<0;
838 });
839}

Reference m_filePairs.

Private Member Attributes

m_dir

const DirDef* UsedDir::m_dir

Definition at line 98 of file dirdef.h.

98 const DirDef *m_dir;

Referenced by dir and UsedDir.

m_filePairs

FilePairLinkedMap UsedDir::m_filePairs

Definition at line 99 of file dirdef.h.

Referenced by addFileDep, filePairs, findFilePair and sort.

m_hasDirectDeps

bool UsedDir::m_hasDirectDeps = false

Definition at line 101 of file dirdef.h.

101 bool m_hasDirectDeps = false;

Referenced by addFileDep and hasDirectDeps.

m_hasDirectDstDeps

bool UsedDir::m_hasDirectDstDeps = false

Definition at line 103 of file dirdef.h.

103 bool m_hasDirectDstDeps = false;

Referenced by addFileDep and hasDirectDstDeps.

m_hasDirectSrcDeps

bool UsedDir::m_hasDirectSrcDeps = false

Definition at line 102 of file dirdef.h.

102 bool m_hasDirectSrcDeps = false;

Referenced by addFileDep and hasDirectSrcDeps.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.