jazzy 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +59 -0
  3. data/LICENSE +21 -0
  4. data/README.md +62 -0
  5. data/Rakefile +1 -0
  6. data/bin/ASTDump +0 -0
  7. data/bin/SwiftHeader +22 -0
  8. data/bin/jazzy +42 -0
  9. data/jazzy.gemspec +27 -0
  10. data/lib/assets/CSS/style-1.1.15.css +3366 -0
  11. data/lib/assets/Images/apple2.png +0 -0
  12. data/lib/assets/Images/carat_2x.png +0 -0
  13. data/lib/assets/Images/check.png +0 -0
  14. data/lib/assets/Images/class_node_parent_and_child_2x.png +0 -0
  15. data/lib/assets/Images/class_node_subclass_last_child_2x.png +0 -0
  16. data/lib/assets/Images/class_node_subclass_with_siblings_2x.png +0 -0
  17. data/lib/assets/Images/closebox_2x.png +0 -0
  18. data/lib/assets/Images/collection_last_child_2x.png +0 -0
  19. data/lib/assets/Images/collection_last_child_orphan_grandparent_2x.png +0 -0
  20. data/lib/assets/Images/collection_last_child_orphan_parent_2x.png +0 -0
  21. data/lib/assets/Images/collection_last_child_orphan_parent_and_grandparent_2x.png +0 -0
  22. data/lib/assets/Images/collection_node_2x.png +0 -0
  23. data/lib/assets/Images/collection_node_orphan_grandparent_2x.png +0 -0
  24. data/lib/assets/Images/collection_node_orphan_parent_2x.png +0 -0
  25. data/lib/assets/Images/collection_node_orphan_parent_and_grandparent_2x.png +0 -0
  26. data/lib/assets/Images/collection_node_parent_2x.png +0 -0
  27. data/lib/assets/Images/collection_node_parent_last_child_orphan_parent_2x.png +0 -0
  28. data/lib/assets/Images/collection_node_parent_orphan_parent_2x.png +0 -0
  29. data/lib/assets/Images/collection_parent_last_child_2x.png +0 -0
  30. data/lib/assets/Images/download_2x.png +0 -0
  31. data/lib/assets/Images/left_arrow_2x.png +0 -0
  32. data/lib/assets/Images/magnify_2x.png +0 -0
  33. data/lib/assets/Images/minus_2x.png +0 -0
  34. data/lib/assets/Images/playbutton.svg +15 -0
  35. data/lib/assets/Images/plus_2x.png +0 -0
  36. data/lib/assets/Images/right_arrow_2x.png +0 -0
  37. data/lib/assets/Images/search_2x.png +0 -0
  38. data/lib/assets/Images/shortstack_2x.png +0 -0
  39. data/lib/assets/JavaScript/devpubs-1.1.15.js +1293 -0
  40. data/lib/jazzy.rb +133 -0
  41. data/lib/jazzy/jazzhtml.rb +7 -0
  42. data/lib/jazzy/klass.mustache +325 -0
  43. data/lib/jazzy/klass.rb +27 -0
  44. data/lib/jazzy/partials/klass-method.mustache +84 -0
  45. data/lib/jazzy/partials/klass-overview.mustache +6 -0
  46. data/lib/jazzy/partials/klass-property.mustache +52 -0
  47. data/parser/ASTDump.xcodeproj/project.pbxproj +288 -0
  48. data/parser/ASTDump.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  49. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcshareddata/ASTDump.xccheckout +41 -0
  50. data/parser/ASTDump.xcodeproj/project.xcworkspace/xcuserdata/ta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  51. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/ASTDump.xcscheme +86 -0
  52. data/parser/ASTDump.xcodeproj/xcuserdata/ta.xcuserdatad/xcschemes/xcschememanagement.plist +22 -0
  53. data/parser/ASTDump/JAZMusician.h +38 -0
  54. data/parser/ASTDump/JAZMusician.m +19 -0
  55. data/parser/ASTDump/main.cpp +71 -0
  56. data/parser/clang-c/BuildSystem.h +148 -0
  57. data/parser/clang-c/CXCompilationDatabase.h +170 -0
  58. data/parser/clang-c/CXErrorCode.h +64 -0
  59. data/parser/clang-c/CXString.h +61 -0
  60. data/parser/clang-c/Documentation.h +554 -0
  61. data/parser/clang-c/Index.h +5438 -0
  62. data/parser/clang-c/Platform.h +45 -0
  63. metadata +190 -0
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:ASTDump.xcodeproj">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,41 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDESourceControlProjectFavoriteDictionaryKey</key>
6
+ <false/>
7
+ <key>IDESourceControlProjectIdentifier</key>
8
+ <string>F844CCD6-9859-41B0-A56D-6CE71EC1028B</string>
9
+ <key>IDESourceControlProjectName</key>
10
+ <string>ASTDump</string>
11
+ <key>IDESourceControlProjectOriginsDictionary</key>
12
+ <dict>
13
+ <key>66FD7FE3-3E84-4A39-B98D-6C26A4D647F2</key>
14
+ <string>ssh://github.com/realm/jazzy.git</string>
15
+ </dict>
16
+ <key>IDESourceControlProjectPath</key>
17
+ <string>parser/ASTDump.xcodeproj/project.xcworkspace</string>
18
+ <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
19
+ <dict>
20
+ <key>66FD7FE3-3E84-4A39-B98D-6C26A4D647F2</key>
21
+ <string>../../..</string>
22
+ </dict>
23
+ <key>IDESourceControlProjectURL</key>
24
+ <string>ssh://github.com/realm/jazzy.git</string>
25
+ <key>IDESourceControlProjectVersion</key>
26
+ <integer>110</integer>
27
+ <key>IDESourceControlProjectWCCIdentifier</key>
28
+ <string>66FD7FE3-3E84-4A39-B98D-6C26A4D647F2</string>
29
+ <key>IDESourceControlProjectWCConfigurations</key>
30
+ <array>
31
+ <dict>
32
+ <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
33
+ <string>public.vcs.git</string>
34
+ <key>IDESourceControlWCCIdentifierKey</key>
35
+ <string>66FD7FE3-3E84-4A39-B98D-6C26A4D647F2</string>
36
+ <key>IDESourceControlWCCName</key>
37
+ <string>jazzy</string>
38
+ </dict>
39
+ </array>
40
+ </dict>
41
+ </plist>
@@ -0,0 +1,86 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "0510"
4
+ version = "1.3">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "YES"
13
+ buildForArchiving = "YES"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "E80E07D0194125DB00E2B0B5"
18
+ BuildableName = "ASTDump"
19
+ BlueprintName = "ASTDump"
20
+ ReferencedContainer = "container:ASTDump.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28
+ shouldUseLaunchSchemeArgsEnv = "YES"
29
+ buildConfiguration = "Debug">
30
+ <Testables>
31
+ </Testables>
32
+ <MacroExpansion>
33
+ <BuildableReference
34
+ BuildableIdentifier = "primary"
35
+ BlueprintIdentifier = "E80E07D0194125DB00E2B0B5"
36
+ BuildableName = "ASTDump"
37
+ BlueprintName = "ASTDump"
38
+ ReferencedContainer = "container:ASTDump.xcodeproj">
39
+ </BuildableReference>
40
+ </MacroExpansion>
41
+ </TestAction>
42
+ <LaunchAction
43
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
44
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45
+ launchStyle = "0"
46
+ useCustomWorkingDirectory = "NO"
47
+ buildConfiguration = "Debug"
48
+ ignoresPersistentStateOnLaunch = "NO"
49
+ debugDocumentVersioning = "YES"
50
+ allowLocationSimulation = "YES">
51
+ <BuildableProductRunnable>
52
+ <BuildableReference
53
+ BuildableIdentifier = "primary"
54
+ BlueprintIdentifier = "E80E07D0194125DB00E2B0B5"
55
+ BuildableName = "ASTDump"
56
+ BlueprintName = "ASTDump"
57
+ ReferencedContainer = "container:ASTDump.xcodeproj">
58
+ </BuildableReference>
59
+ </BuildableProductRunnable>
60
+ <AdditionalOptions>
61
+ </AdditionalOptions>
62
+ </LaunchAction>
63
+ <ProfileAction
64
+ shouldUseLaunchSchemeArgsEnv = "YES"
65
+ savedToolIdentifier = ""
66
+ useCustomWorkingDirectory = "NO"
67
+ buildConfiguration = "Release"
68
+ debugDocumentVersioning = "YES">
69
+ <BuildableProductRunnable>
70
+ <BuildableReference
71
+ BuildableIdentifier = "primary"
72
+ BlueprintIdentifier = "E80E07D0194125DB00E2B0B5"
73
+ BuildableName = "ASTDump"
74
+ BlueprintName = "ASTDump"
75
+ ReferencedContainer = "container:ASTDump.xcodeproj">
76
+ </BuildableReference>
77
+ </BuildableProductRunnable>
78
+ </ProfileAction>
79
+ <AnalyzeAction
80
+ buildConfiguration = "Debug">
81
+ </AnalyzeAction>
82
+ <ArchiveAction
83
+ buildConfiguration = "Release"
84
+ revealArchiveInOrganizer = "YES">
85
+ </ArchiveAction>
86
+ </Scheme>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>ASTDump.xcscheme</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ <key>SuppressBuildableAutocreation</key>
14
+ <dict>
15
+ <key>E80E07D0194125DB00E2B0B5</key>
16
+ <dict>
17
+ <key>primary</key>
18
+ <true/>
19
+ </dict>
20
+ </dict>
21
+ </dict>
22
+ </plist>
@@ -0,0 +1,38 @@
1
+ //
2
+ // JAZMusician.h
3
+ // JazzyApp
4
+ //
5
+
6
+ #import <Foundation/Foundation.h>
7
+
8
+ /**
9
+ JAZMusician models, you guessed it... Jazz Musicians!
10
+ From Ellington to Marsalis, this class has you covered.
11
+ */
12
+ @interface JAZMusician : NSObject
13
+
14
+ /**
15
+ The name of the musician. i.e. "John Coltrane"
16
+ */
17
+ @property (nonatomic, readonly) NSString *name;
18
+
19
+ /**
20
+ The year the musician was born. i.e. 1926
21
+ */
22
+ @property (nonatomic, readonly) NSUInteger birthyear;
23
+
24
+ /**
25
+ Initialize a JAZMusician.
26
+ Don't forget to have a name and an birthyear.
27
+
28
+ @warning Jazz can be addicting.
29
+ Please be careful out there.
30
+
31
+ @param name The name of the musician.
32
+ @param birthyear The year the musician was born.
33
+
34
+ @return An initialized JAZMusician instance.
35
+ */
36
+ - (instancetype)initWithName:(NSString *)name birthyear:(NSUInteger)birthyear;
37
+
38
+ @end
@@ -0,0 +1,19 @@
1
+ //
2
+ // JAZMusician.m
3
+ // JazzyApp
4
+ //
5
+
6
+ #import "JAZMusician.h"
7
+
8
+ @implementation JAZMusician
9
+
10
+ - (instancetype)initWithName:(NSString *)name birthyear:(NSUInteger)birthyear {
11
+ self = [super init];
12
+ if (self) {
13
+ _name = [name copy];
14
+ _birthyear = birthyear;
15
+ }
16
+ return self;
17
+ }
18
+
19
+ @end
@@ -0,0 +1,71 @@
1
+ //
2
+ // main.cpp
3
+ // ASTDump
4
+ //
5
+ // Created by JP Simard on 6/5/14.
6
+ // Copyright (c) 2014 Realm. All rights reserved.
7
+ //
8
+
9
+ #include <iostream>
10
+ #include "clang-c/Index.h"
11
+
12
+ //////////////////////////////////////////
13
+ // Print XML from translation unit
14
+ //////////////////////////////////////////
15
+
16
+ void printXMLFromTU(CXTranslationUnit tu)
17
+ {
18
+ printf("<?xml version=\"1.0\"?>\n<jazz>");
19
+ clang_visitChildrenWithBlock(clang_getTranslationUnitCursor(tu), ^enum CXChildVisitResult(CXCursor cursor, CXCursor parent) {
20
+ CXComment comment = clang_Cursor_getParsedComment(cursor);
21
+ if (clang_Comment_getKind(comment) == CXComment_FullComment) {
22
+ printf("%s\n", clang_getCString(clang_FullComment_getAsXML(comment)));
23
+ }
24
+ return CXChildVisit_Recurse;
25
+ });
26
+ printf("</jazz>");
27
+ }
28
+
29
+ //////////////////////////////////////////
30
+ // Make translation unit from index/file
31
+ //////////////////////////////////////////
32
+
33
+ CXTranslationUnit tuFromIndexAndFile(CXIndex index, const char *filename)
34
+ {
35
+ const char *args[] = {
36
+ "-x",
37
+ "objective-c",
38
+ "-isysroot",
39
+ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"
40
+ };
41
+
42
+ int numArgs = sizeof(args) / sizeof(*args);
43
+
44
+ return clang_createTranslationUnitFromSourceFile(index, filename, numArgs, args, 0, NULL);
45
+ }
46
+
47
+ //////////////////////////////////////////
48
+ // Print XML from filename
49
+ //////////////////////////////////////////
50
+
51
+ void printXMLFromFile(const char *filename)
52
+ {
53
+ CXIndex index = clang_createIndex(0, 1);
54
+
55
+ CXTranslationUnit tu = tuFromIndexAndFile(index, filename);
56
+
57
+ printXMLFromTU(tu);
58
+
59
+ clang_disposeTranslationUnit(tu);
60
+ clang_disposeIndex(index);
61
+ }
62
+
63
+ //////////////////////////////////////////
64
+ // Program entry
65
+ //////////////////////////////////////////
66
+
67
+ int main(int argc, const char * argv[])
68
+ {
69
+ printXMLFromFile(argv[1]);
70
+ return 0;
71
+ }
@@ -0,0 +1,148 @@
1
+ /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
2
+ |* *|
3
+ |* The LLVM Compiler Infrastructure *|
4
+ |* *|
5
+ |* This file is distributed under the University of Illinois Open Source *|
6
+ |* License. See LICENSE.TXT for details. *|
7
+ |* *|
8
+ |*===----------------------------------------------------------------------===*|
9
+ |* *|
10
+ |* This header provides various utilities for use by build systems. *|
11
+ |* *|
12
+ \*===----------------------------------------------------------------------===*/
13
+
14
+ #ifndef CLANG_C_BUILD_SYSTEM_H
15
+ #define CLANG_C_BUILD_SYSTEM_H
16
+
17
+ #include "clang-c/Platform.h"
18
+ #include "clang-c/CXErrorCode.h"
19
+ #include "clang-c/CXString.h"
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ /**
26
+ * \defgroup BUILD_SYSTEM Build system utilities
27
+ * @{
28
+ */
29
+
30
+ /**
31
+ * \brief Return the timestamp for use with Clang's
32
+ * \c -fbuild-session-timestamp= option.
33
+ */
34
+ CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
35
+
36
+ /**
37
+ * \brief Object encapsulating information about overlaying virtual
38
+ * file/directories over the real file system.
39
+ */
40
+ typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
41
+
42
+ /**
43
+ * \brief Create a \c CXVirtualFileOverlay object.
44
+ * Must be disposed with \c clang_VirtualFileOverlay_dispose().
45
+ *
46
+ * \param options is reserved, always pass 0.
47
+ */
48
+ CINDEX_LINKAGE CXVirtualFileOverlay
49
+ clang_VirtualFileOverlay_create(unsigned options);
50
+
51
+ /**
52
+ * \brief Map an absolute virtual file path to an absolute real one.
53
+ * The virtual path must be canonicalized (not contain "."/"..").
54
+ * \returns 0 for success, non-zero to indicate an error.
55
+ */
56
+ CINDEX_LINKAGE enum CXErrorCode
57
+ clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
58
+ const char *virtualPath,
59
+ const char *realPath);
60
+
61
+ /**
62
+ * \brief Set the case sensitivity for the \c CXVirtualFileOverlay object.
63
+ * The \c CXVirtualFileOverlay object is case-sensitive by default, this
64
+ * option can be used to override the default.
65
+ * \returns 0 for success, non-zero to indicate an error.
66
+ */
67
+ CINDEX_LINKAGE enum CXErrorCode
68
+ clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay,
69
+ int caseSensitive);
70
+
71
+ /**
72
+ * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
73
+ *
74
+ * \param options is reserved, always pass 0.
75
+ * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
76
+ * disposed using \c free().
77
+ * \param out_buffer_size pointer to receive the buffer size.
78
+ * \returns 0 for success, non-zero to indicate an error.
79
+ */
80
+ CINDEX_LINKAGE enum CXErrorCode
81
+ clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
82
+ char **out_buffer_ptr,
83
+ unsigned *out_buffer_size);
84
+
85
+ /**
86
+ * \brief Dispose a \c CXVirtualFileOverlay object.
87
+ */
88
+ CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
89
+
90
+ /**
91
+ * \brief Object encapsulating information about a module.map file.
92
+ */
93
+ typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor;
94
+
95
+ /**
96
+ * \brief Create a \c CXModuleMapDescriptor object.
97
+ * Must be disposed with \c clang_ModuleMapDescriptor_dispose().
98
+ *
99
+ * \param options is reserved, always pass 0.
100
+ */
101
+ CINDEX_LINKAGE CXModuleMapDescriptor
102
+ clang_ModuleMapDescriptor_create(unsigned options);
103
+
104
+ /**
105
+ * \brief Sets the framework module name that the module.map describes.
106
+ * \returns 0 for success, non-zero to indicate an error.
107
+ */
108
+ CINDEX_LINKAGE enum CXErrorCode
109
+ clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor,
110
+ const char *name);
111
+
112
+ /**
113
+ * \brief Sets the umbrealla header name that the module.map describes.
114
+ * \returns 0 for success, non-zero to indicate an error.
115
+ */
116
+ CINDEX_LINKAGE enum CXErrorCode
117
+ clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor,
118
+ const char *name);
119
+
120
+ /**
121
+ * \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
122
+ *
123
+ * \param options is reserved, always pass 0.
124
+ * \param out_buffer_ptr pointer to receive the buffer pointer, which should be
125
+ * disposed using \c free().
126
+ * \param out_buffer_size pointer to receive the buffer size.
127
+ * \returns 0 for success, non-zero to indicate an error.
128
+ */
129
+ CINDEX_LINKAGE enum CXErrorCode
130
+ clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options,
131
+ char **out_buffer_ptr,
132
+ unsigned *out_buffer_size);
133
+
134
+ /**
135
+ * \brief Dispose a \c CXModuleMapDescriptor object.
136
+ */
137
+ CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor);
138
+
139
+ /**
140
+ * @}
141
+ */
142
+
143
+ #ifdef __cplusplus
144
+ }
145
+ #endif
146
+
147
+ #endif /* CLANG_C_BUILD_SYSTEM_H */
148
+
@@ -0,0 +1,170 @@
1
+ /*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\
2
+ |* *|
3
+ |* The LLVM Compiler Infrastructure *|
4
+ |* *|
5
+ |* This file is distributed under the University of Illinois Open Source *|
6
+ |* License. See LICENSE.TXT for details. *|
7
+ |* *|
8
+ |*===----------------------------------------------------------------------===*|
9
+ |* *|
10
+ |* This header provides a public inferface to use CompilationDatabase without *|
11
+ |* the full Clang C++ API. *|
12
+ |* *|
13
+ \*===----------------------------------------------------------------------===*/
14
+
15
+ #ifndef CLANG_CXCOMPILATIONDATABASE_H
16
+ #define CLANG_CXCOMPILATIONDATABASE_H
17
+
18
+ #include "clang-c/Platform.h"
19
+ #include "clang-c/CXString.h"
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ /** \defgroup COMPILATIONDB CompilationDatabase functions
26
+ * \ingroup CINDEX
27
+ *
28
+ * @{
29
+ */
30
+
31
+ /**
32
+ * A compilation database holds all information used to compile files in a
33
+ * project. For each file in the database, it can be queried for the working
34
+ * directory or the command line used for the compiler invocation.
35
+ *
36
+ * Must be freed by \c clang_CompilationDatabase_dispose
37
+ */
38
+ typedef void * CXCompilationDatabase;
39
+
40
+ /**
41
+ * \brief Contains the results of a search in the compilation database
42
+ *
43
+ * When searching for the compile command for a file, the compilation db can
44
+ * return several commands, as the file may have been compiled with
45
+ * different options in different places of the project. This choice of compile
46
+ * commands is wrapped in this opaque data structure. It must be freed by
47
+ * \c clang_CompileCommands_dispose.
48
+ */
49
+ typedef void * CXCompileCommands;
50
+
51
+ /**
52
+ * \brief Represents the command line invocation to compile a specific file.
53
+ */
54
+ typedef void * CXCompileCommand;
55
+
56
+ /**
57
+ * \brief Error codes for Compilation Database
58
+ */
59
+ typedef enum {
60
+ /*
61
+ * \brief No error occurred
62
+ */
63
+ CXCompilationDatabase_NoError = 0,
64
+
65
+ /*
66
+ * \brief Database can not be loaded
67
+ */
68
+ CXCompilationDatabase_CanNotLoadDatabase = 1
69
+
70
+ } CXCompilationDatabase_Error;
71
+
72
+ /**
73
+ * \brief Creates a compilation database from the database found in directory
74
+ * buildDir. For example, CMake can output a compile_commands.json which can
75
+ * be used to build the database.
76
+ *
77
+ * It must be freed by \c clang_CompilationDatabase_dispose.
78
+ */
79
+ CINDEX_LINKAGE CXCompilationDatabase
80
+ clang_CompilationDatabase_fromDirectory(const char *BuildDir,
81
+ CXCompilationDatabase_Error *ErrorCode);
82
+
83
+ /**
84
+ * \brief Free the given compilation database
85
+ */
86
+ CINDEX_LINKAGE void
87
+ clang_CompilationDatabase_dispose(CXCompilationDatabase);
88
+
89
+ /**
90
+ * \brief Find the compile commands used for a file. The compile commands
91
+ * must be freed by \c clang_CompileCommands_dispose.
92
+ */
93
+ CINDEX_LINKAGE CXCompileCommands
94
+ clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase,
95
+ const char *CompleteFileName);
96
+
97
+ /**
98
+ * \brief Get all the compile commands in the given compilation database.
99
+ */
100
+ CINDEX_LINKAGE CXCompileCommands
101
+ clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase);
102
+
103
+ /**
104
+ * \brief Free the given CompileCommands
105
+ */
106
+ CINDEX_LINKAGE void clang_CompileCommands_dispose(CXCompileCommands);
107
+
108
+ /**
109
+ * \brief Get the number of CompileCommand we have for a file
110
+ */
111
+ CINDEX_LINKAGE unsigned
112
+ clang_CompileCommands_getSize(CXCompileCommands);
113
+
114
+ /**
115
+ * \brief Get the I'th CompileCommand for a file
116
+ *
117
+ * Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands)
118
+ */
119
+ CINDEX_LINKAGE CXCompileCommand
120
+ clang_CompileCommands_getCommand(CXCompileCommands, unsigned I);
121
+
122
+ /**
123
+ * \brief Get the working directory where the CompileCommand was executed from
124
+ */
125
+ CINDEX_LINKAGE CXString
126
+ clang_CompileCommand_getDirectory(CXCompileCommand);
127
+
128
+ /**
129
+ * \brief Get the number of arguments in the compiler invocation.
130
+ *
131
+ */
132
+ CINDEX_LINKAGE unsigned
133
+ clang_CompileCommand_getNumArgs(CXCompileCommand);
134
+
135
+ /**
136
+ * \brief Get the I'th argument value in the compiler invocations
137
+ *
138
+ * Invariant :
139
+ * - argument 0 is the compiler executable
140
+ */
141
+ CINDEX_LINKAGE CXString
142
+ clang_CompileCommand_getArg(CXCompileCommand, unsigned I);
143
+
144
+ /**
145
+ * \brief Get the number of source mappings for the compiler invocation.
146
+ */
147
+ CINDEX_LINKAGE unsigned
148
+ clang_CompileCommand_getNumMappedSources(CXCompileCommand);
149
+
150
+ /**
151
+ * \brief Get the I'th mapped source path for the compiler invocation.
152
+ */
153
+ CINDEX_LINKAGE CXString
154
+ clang_CompileCommand_getMappedSourcePath(CXCompileCommand, unsigned I);
155
+
156
+ /**
157
+ * \brief Get the I'th mapped source content for the compiler invocation.
158
+ */
159
+ CINDEX_LINKAGE CXString
160
+ clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I);
161
+
162
+ /**
163
+ * @}
164
+ */
165
+
166
+ #ifdef __cplusplus
167
+ }
168
+ #endif
169
+ #endif
170
+