Doxygen
Loading...
Searching...
No Matches
filedef.h File Reference
#include <memory>
#include <unordered_set>
#include "definition.h"
#include "memberlist.h"
#include "containers.h"
+ Include dependency graph for filedef.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IncludeInfo
 Class representing the data associated with a #include statement. More...
 
class  IncludeInfoList
 
class  FileDef
 A model of a file symbol. More...
 
class  FileList
 
struct  FilesInDir
 

Typedefs

using FileDefSet = std::unordered_set<const FileDef*>
 

Enumerations

enum class  IncludeKind : uint32_t {
  IncludeSystem = 0x0001 , IncludeLocal = 0x0002 , ImportSystemObjC = 0x0004 , ImportLocalObjC = 0x0008 ,
  ImportSystem = 0x0010 , ImportLocal = 0x0020 , ImportModule = 0x0040
}
 

Functions

constexpr uint32_t operator| (IncludeKind a, IncludeKind b)
 
constexpr uint32_t operator| (uint32_t a, IncludeKind b)
 
constexpr uint32_t operator& (IncludeKind a, uint32_t mask)
 
QCString includeStatement (SrcLangExt lang, IncludeKind kind)
 
QCString includeOpen (SrcLangExt lang, IncludeKind kind)
 
QCString includeClose (SrcLangExt lang, IncludeKind kind)
 
bool compareFileDefs (const FileDef *fd1, const FileDef *fd2)
 
std::unique_ptr< FileDefcreateFileDef (const QCString &p, const QCString &n, const QCString &ref=QCString(), const QCString &dn=QCString())
 
FileDeftoFileDef (Definition *d)
 
const FileDeftoFileDef (const Definition *d)
 

Variables

constexpr uint32_t IncludeKind_LocalMask = IncludeKind::IncludeLocal | IncludeKind::ImportLocalObjC | IncludeKind::ImportLocal
 
constexpr uint32_t IncludeKind_SystemMask = IncludeKind::IncludeSystem | IncludeKind::ImportSystemObjC | IncludeKind::ImportSystem
 
constexpr uint32_t IncludeKind_ImportMask
 
constexpr uint32_t IncludeKind_ObjCMask = IncludeKind::ImportSystemObjC | IncludeKind::ImportLocalObjC
 

Typedef Documentation

◆ FileDefSet

using FileDefSet = std::unordered_set<const FileDef*>

Definition at line 44 of file filedef.h.

Enumeration Type Documentation

◆ IncludeKind

enum class IncludeKind : uint32_t
strong
Enumerator
IncludeSystem 
IncludeLocal 
ImportSystemObjC 
ImportLocalObjC 
ImportSystem 
ImportLocal 
ImportModule 

Definition at line 46 of file filedef.h.

47{
48 // bits
49 IncludeSystem = 0x0001,
50 IncludeLocal = 0x0002,
51 ImportSystemObjC = 0x0004,
52 ImportLocalObjC = 0x0008,
53 ImportSystem = 0x0010, // C++20 header import
54 ImportLocal = 0x0020, // C++20 header import
55 ImportModule = 0x0040 // C++20/Java module import
56};
@ ImportLocal
Definition filedef.h:54
@ ImportModule
Definition filedef.h:55
@ IncludeLocal
Definition filedef.h:50
@ ImportSystemObjC
Definition filedef.h:51
@ ImportLocalObjC
Definition filedef.h:52
@ IncludeSystem
Definition filedef.h:49
@ ImportSystem
Definition filedef.h:53

Function Documentation

◆ compareFileDefs()

bool compareFileDefs ( const FileDef * fd1,
const FileDef * fd2 )

Definition at line 1887 of file filedef.cpp.

1888{
1889 return qstricmp_sort(fd1->name(),fd2->name()) < 0;
1890}
virtual const QCString & name() const =0
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86

References Definition::name(), and qstricmp_sort().

Referenced by DirDefImpl::sort(), and writeFileIndex().

◆ createFileDef()

◆ includeClose()

QCString includeClose ( SrcLangExt lang,
IncludeKind kind )

Definition at line 86 of file filedef.cpp.

87{
88 if (lang==SrcLangExt::IDL) return "\";";
89 else if (lang==SrcLangExt::Java) return ";";
90
91 switch (kind)
92 {
93 case IncludeKind::ImportLocal: return "\";";
94 case IncludeKind::ImportLocalObjC: return "\"";
95 case IncludeKind::IncludeLocal: return "\"";
96 case IncludeKind::ImportSystem: return ">;";
97 case IncludeKind::ImportSystemObjC: return ">";
98 case IncludeKind::IncludeSystem: return ">";
99 case IncludeKind::ImportModule: return ";";
100 }
101 return "";
102}

References IDL, ImportLocal, ImportLocalObjC, ImportModule, ImportSystem, ImportSystemObjC, IncludeLocal, IncludeSystem, and Java.

Referenced by ClassDefImpl::writeIncludeFiles(), ConceptDefImpl::writeIncludeFiles(), and FileDefImpl::writeIncludeFiles().

◆ includeOpen()

QCString includeOpen ( SrcLangExt lang,
IncludeKind kind )

Definition at line 73 of file filedef.cpp.

74{
75 if (lang==SrcLangExt::Java || kind==IncludeKind::ImportModule) return "";
76 if ((kind & IncludeKind_LocalMask) || (lang==SrcLangExt::IDL))
77 {
78 return "\"";
79 }
80 else
81 {
82 return "<";
83 }
84}
constexpr uint32_t IncludeKind_LocalMask
Definition filedef.h:63

References IDL, ImportModule, IncludeKind_LocalMask, and Java.

Referenced by ClassDefImpl::writeIncludeFiles(), ConceptDefImpl::writeIncludeFiles(), and FileDefImpl::writeIncludeFiles().

◆ includeStatement()

QCString includeStatement ( SrcLangExt lang,
IncludeKind kind )

Definition at line 56 of file filedef.cpp.

57{
58 bool isIDLorJava = lang==SrcLangExt::IDL || lang==SrcLangExt::Java;
59 if (isIDLorJava || (kind & IncludeKind_ImportMask))
60 {
61 return "import ";
62 }
63 else if (kind & IncludeKind_ObjCMask)
64 {
65 return "#import ";
66 }
67 else
68 {
69 return "#include ";
70 }
71}
constexpr uint32_t IncludeKind_ObjCMask
Definition filedef.h:67
constexpr uint32_t IncludeKind_ImportMask
Definition filedef.h:65

References IDL, IncludeKind_ImportMask, IncludeKind_ObjCMask, and Java.

Referenced by ClassDefImpl::writeIncludeFiles(), ConceptDefImpl::writeIncludeFiles(), and FileDefImpl::writeIncludeFiles().

◆ operator&()

uint32_t operator& ( IncludeKind a,
uint32_t mask )
inlineconstexpr

Definition at line 60 of file filedef.h.

60{ return static_cast<uint32_t>(a) & mask; }

◆ operator|() [1/2]

uint32_t operator| ( IncludeKind a,
IncludeKind b )
inlineconstexpr

Definition at line 58 of file filedef.h.

58{ return static_cast<uint32_t>(a) | static_cast<uint32_t>(b); }

◆ operator|() [2/2]

uint32_t operator| ( uint32_t a,
IncludeKind b )
inlineconstexpr

Definition at line 59 of file filedef.h.

59{ return a | static_cast<uint32_t>(b); }

◆ toFileDef() [1/2]

const FileDef * toFileDef ( const Definition * d)

Definition at line 1907 of file filedef.cpp.

1908{
1909 if (d==nullptr) return nullptr;
1910 if (d && typeid(*d)==typeid(FileDefImpl))
1911 {
1912 return static_cast<const FileDef*>(d);
1913 }
1914 else
1915 {
1916 return nullptr;
1917 }
1918}
A model of a file symbol.
Definition filedef.h:99

◆ toFileDef() [2/2]

Variable Documentation

◆ IncludeKind_ImportMask

◆ IncludeKind_LocalMask

◆ IncludeKind_ObjCMask

uint32_t IncludeKind_ObjCMask = IncludeKind::ImportSystemObjC | IncludeKind::ImportLocalObjC
constexpr

Definition at line 67 of file filedef.h.

Referenced by includeStatement(), and includeTagFileAttributes().

◆ IncludeKind_SystemMask

Definition at line 64 of file filedef.h.