Module: FFIGen::Clang
- Extended by:
- FFI::Library
- Defined in:
- lib/ffi_gen/clang.rb
Defined Under Namespace
Classes: CodeCompleteResults, CompletionResult, Cursor, CursorAndRangeVisitor, CursorSetImpl, SourceLocation, SourceRange, TUResourceUsage, TUResourceUsageEntry, Token, TranslationUnitImpl, Type, UnsavedFile
Class Method Summary collapse
-
._callback_cursor_visitor_(cursor, parent, client_data) ⇒ Symbol from _enum_child_visit_result_
Visitor invoked for each cursor found by a traversal.
-
._callback_inclusion_visitor_(inclusion_stack, include_len, client_data) ⇒ FFI::Pointer(File)
Visitor invoked for each file in a translation unit (used with clang_getInclusions()).
-
._enum_availability_kind_ ⇒ Symbol
Describes the availability of a particular entity, which indicates whether the use of this entity will result in a warning or error due to it being deprecated or unavailable.
-
._enum_child_visit_result_ ⇒ Symbol
Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor.
-
._enum_code_complete_flags_ ⇒ Symbol
Flags that can be passed to c clang_codeCompleteAt() to modify its behavior.
-
._enum_completion_chunk_kind_ ⇒ Symbol
Describes a single piece of text within a code-completion string.
-
._enum_completion_context_ ⇒ Symbol
Bits that represent the context under which completion is occurring.
-
._enum_cursor_kind_ ⇒ Symbol
Describes the kind of entity that a cursor refers to.
-
._enum_cxx_access_specifier_ ⇒ Symbol
Represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier.
-
._enum_diagnostic_display_options_ ⇒ Symbol
Options to control the display of diagnostics.
-
._enum_diagnostic_severity_ ⇒ Symbol
Describes the severity of a particular diagnostic.
-
._enum_language_kind_ ⇒ Symbol
Describe the “language” of the entity referred to by a cursor.
-
._enum_linkage_kind_ ⇒ Symbol
Describe the linkage of the entity referred to by a cursor.
-
._enum_name_ref_flags_ ⇒ Symbol
(Not documented).
-
._enum_reparse_flags_ ⇒ Symbol
Flags that control the reparsing of translation units.
-
._enum_save_error_ ⇒ Symbol
Describes the kind of error that occurred (if any) in a call to c clang_saveTranslationUnit().
-
._enum_save_translation_unit_flags_ ⇒ Symbol
Flags that control how translation units are saved.
-
._enum_token_kind_ ⇒ Symbol
Describes a kind of token.
-
._enum_translation_unit_flags_ ⇒ Symbol
Flags that control the creation of translation units.
-
._enum_tu_resource_usage_kind_ ⇒ Symbol
Categorizes how memory is being used by a translation unit.
-
._enum_type_kind_ ⇒ Symbol
Describes the kind of type.
-
._enum_visitor_result_ ⇒ Symbol
defgroup CINDEX_HIGH Higher level API functions.
-
.annotate_tokens(tu, tokens, num_tokens, cursors) ⇒ nil
Annotate the given set of tokens by providing cursors for each token that can be mapped to a specific entity within the abstract syntax tree.
-
.code_complete_at(tu, complete_filename, complete_line, complete_column, unsaved_files, num_unsaved_files, options) ⇒ FFI::Pointer(*CodeCompleteResults)
Perform code completion at a given location in a translation unit.
-
.code_complete_get_container_kind(results, is_incomplete) ⇒ Symbol from _enum_cursor_kind_
Returns the cursor kind for the container for the current code completion context.
-
.code_complete_get_container_usr(results) ⇒ String
Returns the USR for the container for the current code completion context.
-
.code_complete_get_contexts(results) ⇒ Integer
Determines what compeltions are appropriate for the context the given code completion.
-
.code_complete_get_diagnostic(results, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given code completion.
-
.code_complete_get_num_diagnostics(results) ⇒ Integer
Determine the number of diagnostics produced prior to the location where code completion was performed.
-
.code_complete_get_obj_c_selector(results) ⇒ String
Returns the currently-entered selector for an Objective-C message send, formatted like “initWithFoo:bar:”.
-
.construct_usr_obj_c_category(class_name, category_name) ⇒ String
Construct a USR for a specified Objective-C category.
-
.construct_usr_obj_c_class(class_name) ⇒ String
Construct a USR for a specified Objective-C class.
-
.construct_usr_obj_c_ivar(name, class_usr) ⇒ String
Construct a USR for a specified Objective-C instance variable and the USR for its containing class.
-
.construct_usr_obj_c_method(name, is_instance_method, class_usr) ⇒ String
Construct a USR for a specified Objective-C method and the USR for its containing class.
-
.construct_usr_obj_c_property(property, class_usr) ⇒ String
Construct a USR for a specified Objective-C property and the USR for its containing class.
-
.construct_usr_obj_c_protocol(protocol_name) ⇒ String
Construct a USR for a specified Objective-C protocol.
-
.create_cx_cursor_set ⇒ CursorSetImpl
Creates an empty CXCursorSet.
-
.create_index(exclude_declarations_from_pch, display_diagnostics) ⇒ FFI::Pointer(Index)
clang_createIndex() provides a shared context for creating translation units.
-
.create_translation_unit(index, ast_filename) ⇒ TranslationUnitImpl
Create a translation unit from an AST file (-emit-ast).
-
.create_translation_unit_from_source_file(c_idx, source_filename, num_clang_command_line_args, command_line_args, num_unsaved_files, unsaved_files) ⇒ TranslationUnitImpl
Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler.
-
.cursor_get_translation_unit(cursor) ⇒ TranslationUnitImpl
Returns the translation unit that a cursor originated from.
-
.cursor_is_null(cursor) ⇒ Integer
Returns non-zero if arg cursor is null.
-
.cx_cursor_set_contains(cset, cursor) ⇒ Integer
Queries a CXCursorSet to see if it contains a specific CXCursor.
-
.cx_cursor_set_insert(cset, cursor) ⇒ Integer
Inserts a CXCursor into a CXCursorSet.
-
.cxx_method_is_static(c) ⇒ Integer
Determine if a C++ member function or member function template is declared ‘static’.
-
.cxx_method_is_virtual(c) ⇒ Integer
Determine if a C++ member function or member function template is explicitly declared ‘virtual’ or if it overrides a virtual method from one of the base classes.
-
.default_code_complete_options ⇒ Integer
Returns a default set of code-completion options that can be passed toc clang_codeCompleteAt().
-
.default_diagnostic_display_options ⇒ Integer
Retrieve the set of display options most similar to the default behavior of the clang compiler.
-
.default_editing_translation_unit_options ⇒ Integer
Returns the set of flags that is suitable for parsing a translation unit that is being edited.
-
.default_reparse_options(tu) ⇒ Integer
Returns the set of flags that is suitable for reparsing a translation unit.
-
.default_save_options(tu) ⇒ Integer
Returns the set of flags that is suitable for saving a translation unit.
-
.dispose_code_complete_results(results) ⇒ nil
Free the given set of code-completion results.
-
.dispose_cx_cursor_set(cset) ⇒ nil
Disposes a CXCursorSet and releases its associated memory.
-
.dispose_cxtu_resource_usage(usage) ⇒ nil
(Not documented).
-
.dispose_diagnostic(diagnostic) ⇒ nil
Destroy a diagnostic.
-
.dispose_index(index) ⇒ nil
Destroy the given index.
-
.dispose_overridden_cursors(overridden) ⇒ nil
Free the set of overridden cursors returned by c clang_getOverriddenCursors().
-
.dispose_string(string) ⇒ nil
Free the given string,.
-
.dispose_tokens(tu, tokens, num_tokens) ⇒ nil
Free the given set of tokens.
-
.dispose_translation_unit(translation_unit_impl) ⇒ nil
Destroy the specified CXTranslationUnit object.
-
.enable_stack_traces ⇒ nil
(Not documented).
-
.equal_cursors(cursor, cursor) ⇒ Integer
Determine whether two cursors are equivalent.
-
.equal_locations(loc1, loc2) ⇒ Integer
Determine whether two source locations, which must refer into the same translation unit, refer to exactly the same point in the source code.
-
.equal_ranges(range1, range2) ⇒ Integer
Determine whether two ranges are equivalent.
-
.equal_types(a, b) ⇒ Integer
Determine whether two CXTypes represent the same type.
-
.execute_on_thread(fn, user_data, stack_size) ⇒ nil
(Not documented).
-
.find_references_in_file(cursor, file, visitor) ⇒ nil
Find references of a declaration in a specific file.
-
.format_diagnostic(diagnostic, options) ⇒ String
Format the given diagnostic in a manner that is suitable for display.
-
.get_array_element_type(t) ⇒ Type
Return the element type of an array type.
-
.get_array_size(t) ⇒ Integer
Return the the array size of a constant array.
-
.get_c_string(string) ⇒ String
Retrieve the character data associated with the given string.
-
.get_canonical_cursor(cursor) ⇒ Cursor
Retrieve the canonical cursor corresponding to the given cursor.
-
.get_canonical_type(t) ⇒ Type
Return the canonical type for a CXType.
-
.get_clang_version ⇒ String
Return a version string, suitable for showing to a user, but not intended to be parsed (the format is not guaranteed to be stable).
-
.get_completion_annotation(completion_string, annotation_number) ⇒ String
Retrieve the annotation associated with the given completion string.
-
.get_completion_availability(completion_string) ⇒ Symbol from _enum_availability_kind_
Determine the availability of the entity that this code-completion string refers to.
-
.get_completion_chunk_completion_string(completion_string, chunk_number) ⇒ FFI::Pointer(CompletionString)
Retrieve the completion string associated with a particular chunk within a completion string.
-
.get_completion_chunk_kind(completion_string, chunk_number) ⇒ Symbol from _enum_completion_chunk_kind_
Determine the kind of a particular chunk within a completion string.
-
.get_completion_chunk_text(completion_string, chunk_number) ⇒ String
Retrieve the text associated with a particular chunk within a completion string.
-
.get_completion_num_annotations(completion_string) ⇒ Integer
Retrieve the number of annotations associated with the given completion string.
-
.get_completion_priority(completion_string) ⇒ Integer
Determine the priority of this code completion.
-
.get_cursor(translation_unit_impl, source_location) ⇒ Cursor
Map a source location to the cursor that describes the entity at that location in the source code.
-
.get_cursor_availability(cursor) ⇒ Symbol from _enum_availability_kind_
Determine the availability of the entity that this cursor refers to.
-
.get_cursor_completion_string(cursor) ⇒ FFI::Pointer(CompletionString)
Retrieve a completion string for an arbitrary declaration or macro definition cursor.
-
.get_cursor_definition(cursor) ⇒ Cursor
For a cursor that is either a reference to or a declaration of some entity, retrieve a cursor that describes the definition of that entity.
-
.get_cursor_display_name(cursor) ⇒ String
Retrieve the display name for the entity referenced by this cursor.
-
.get_cursor_extent(cursor) ⇒ SourceRange
Retrieve the physical extent of the source construct referenced by the given cursor.
-
.get_cursor_kind(cursor) ⇒ Symbol from _enum_cursor_kind_
Retrieve the kind of the given cursor.
-
.get_cursor_kind_spelling(kind) ⇒ String
for debug/testing.
-
.get_cursor_language(cursor) ⇒ Symbol from _enum_language_kind_
Determine the “language” of the entity referred to by a given cursor.
-
.get_cursor_lexical_parent(cursor) ⇒ Cursor
Determine the lexical parent of the given cursor.
-
.get_cursor_linkage(cursor) ⇒ Symbol from _enum_linkage_kind_
Determine the linkage of the entity referred to by a given cursor.
-
.get_cursor_location(cursor) ⇒ SourceLocation
Retrieve the physical location of the source constructor referenced by the given cursor.
-
.get_cursor_reference_name_range(c, name_flags, piece_index) ⇒ SourceRange
Given a cursor that references something else, return the source range covering that reference.
-
.get_cursor_referenced(cursor) ⇒ Cursor
For a cursor that is a reference, retrieve a cursor representing the entity that it references.
-
.get_cursor_result_type(c) ⇒ Type
Retrieve the result type associated with a given cursor.
-
.get_cursor_semantic_parent(cursor) ⇒ Cursor
Determine the semantic parent of the given cursor.
-
.get_cursor_spelling(cursor) ⇒ String
Retrieve a name for the entity referenced by this cursor.
-
.get_cursor_type(c) ⇒ Type
Retrieve the type of a CXCursor (if any).
-
.get_cursor_usr(cursor) ⇒ String
Retrieve a Unified Symbol Resolution (USR) for the entity referenced by the given cursor.
-
.get_cxtu_resource_usage(tu) ⇒ TUResourceUsage
Return the memory usage of a translation unit.
-
.get_cxx_access_specifier(cursor) ⇒ Symbol from _enum_cxx_access_specifier_
Returns the access control level for the C++ base specifier represented by a cursor with kind CXCursor_CXXBaseSpecifier or CXCursor_AccessSpecifier.
-
.get_decl_obj_c_type_encoding(c) ⇒ String
Returns the Objective-C type encoding for the specified declaration.
-
.get_definition_spelling_and_extent(cursor, start_buf, end_buf, start_line, start_column, end_line, end_column) ⇒ nil
(Not documented).
-
.get_diagnostic(unit, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given translation unit.
-
.get_diagnostic_category(diagnostic) ⇒ Integer
Retrieve the category number for this diagnostic.
-
.get_diagnostic_category_name(category) ⇒ String
Retrieve the name of a particular diagnostic category.
-
.get_diagnostic_fix_it(diagnostic, fix_it, replacement_range) ⇒ String
Retrieve the replacement information for a given fix-it.
-
.get_diagnostic_location(diagnostic) ⇒ SourceLocation
Retrieve the source location of the given diagnostic.
-
.get_diagnostic_num_fix_its(diagnostic) ⇒ Integer
Determine the number of fix-it hints associated with the given diagnostic.
-
.get_diagnostic_num_ranges(diagnostic) ⇒ Integer
Determine the number of source ranges associated with the given diagnostic.
-
.get_diagnostic_option(diag, disable) ⇒ String
Retrieve the name of the command-line option that enabled this diagnostic.
-
.get_diagnostic_range(diagnostic, range) ⇒ SourceRange
Retrieve a source range associated with the diagnostic.
-
.get_diagnostic_severity(diagnostic) ⇒ Symbol from _enum_diagnostic_severity_
Determine the severity of the given diagnostic.
-
.get_diagnostic_spelling(diagnostic) ⇒ String
Retrieve the text of the given diagnostic.
-
.get_file(tu, file_name) ⇒ FFI::Pointer(File)
Retrieve a file handle within the given translation unit.
-
.get_file_name(s_file) ⇒ String
Retrieve the complete file and path name of the given file.
-
.get_file_time(s_file) ⇒ Integer
Retrieve the last modification time of the given file.
-
.get_ib_outlet_collection_type(cursor) ⇒ Type
For cursors representing an iboutletcollection attribute, this function returns the collection element type.
-
.get_included_file(cursor) ⇒ FFI::Pointer(File)
Retrieve the file that is included by the given inclusion directive cursor.
-
.get_inclusions(tu, visitor, client_data) ⇒ nil
Visit the set of preprocessor inclusions in a translation unit.
-
.get_instantiation_location(location, file, line, column, offset) ⇒ nil
Legacy API to retrieve the file, line, column, and offset represented by the given source location.
-
.get_location(tu, file, line, column) ⇒ SourceLocation
Retrieves the source location associated with a given file/line/column in a particular translation unit.
-
.get_location_for_offset(tu, file, offset) ⇒ SourceLocation
Retrieves the source location associated with a given character offset in a particular translation unit.
-
.get_null_cursor ⇒ Cursor
Retrieve the NULL cursor, which represents no entity.
-
.get_null_location ⇒ SourceLocation
Retrieve a NULL (invalid) source location.
-
.get_null_range ⇒ SourceRange
Retrieve a NULL (invalid) source range.
-
.get_num_completion_chunks(completion_string) ⇒ Integer
Retrieve the number of chunks in the given code-completion string.
-
.get_num_diagnostics(unit) ⇒ Integer
Determine the number of diagnostics produced for the given translation unit.
-
.get_num_overloaded_decls(cursor) ⇒ Integer
Determine the number of overloaded declarations referenced by a c CXCursor_OverloadedDeclRef cursor.
-
.get_overloaded_decl(cursor, index) ⇒ Cursor
Retrieve a cursor for one of the overloaded declarations referenced by a c CXCursor_OverloadedDeclRef cursor.
-
.get_overridden_cursors(cursor, overridden, num_overridden) ⇒ nil
Determine the set of methods that are overridden by the given method.
-
.get_pointee_type(t) ⇒ Type
For pointer types, returns the type of the pointee.
-
.get_presumed_location(location, filename, line, column) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location, as specified in a # line directive.
-
.get_range ⇒ SourceRange
Retrieve a source range given the beginning and ending source locations.
-
.get_range_end(range) ⇒ SourceLocation
Retrieve a source location representing the last character within a source range.
-
.get_range_start(range) ⇒ SourceLocation
Retrieve a source location representing the first character within a source range.
-
.get_remappings(path) ⇒ FFI::Pointer(Remapping)
Retrieve a remapping.
-
.get_result_type(t) ⇒ Type
Retrieve the result type associated with a function type.
-
.get_specialized_cursor_template(c) ⇒ Cursor
Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated.
-
.get_spelling_location(location, file, line, column, offset) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location.
-
.get_template_cursor_kind(c) ⇒ Symbol from _enum_cursor_kind_
Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.
-
.get_token_extent(translation_unit_impl, token) ⇒ SourceRange
Retrieve a source range that covers the given token.
-
.get_token_kind(token) ⇒ Symbol from _enum_token_kind_
Determine the kind of the given token.
-
.get_token_location(translation_unit_impl, token) ⇒ SourceLocation
Retrieve the source location of the given token.
-
.get_token_spelling(translation_unit_impl, token) ⇒ String
Determine the spelling of the given token.
-
.get_translation_unit_cursor(translation_unit_impl) ⇒ Cursor
Retrieve the cursor that represents the given translation unit.
-
.get_translation_unit_spelling(ct_unit) ⇒ String
Get the original translation unit source file name.
-
.get_tu_resource_usage_name(kind) ⇒ String
Returns the human-readable null-terminated C string that represents the name of the memory category.
-
.get_type_declaration(t) ⇒ Cursor
Return the cursor for the declaration of the given type.
-
.get_type_kind_spelling(k) ⇒ String
Retrieve the spelling of a given CXTypeKind.
-
.hash_cursor(cursor) ⇒ Integer
Compute a hash value for the given cursor.
-
.is_attribute(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an attribute.
-
.is_const_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “const” qualifier set, without looking through typedefs that may have added “const” at a different level.
-
.is_cursor_definition(cursor) ⇒ Integer
Determine whether the declaration pointed to by this cursor is also a definition of that entity.
-
.is_declaration(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a declaration.
-
.is_expression(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an expression.
-
.is_file_multiple_include_guarded(tu, file) ⇒ Integer
Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once.
-
.is_invalid(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an invalid cursor.
-
.is_pod_type(t) ⇒ Integer
Return 1 if the CXType is a POD (plain old data) type, and 0 otherwise.
-
.is_preprocessing(cursor_kind) ⇒ Integer
Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation.
-
.is_reference(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a simple reference.
-
.is_restrict_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “restrict” qualifier set, without looking through typedefs that may have added “restrict” at a different level.
-
.is_statement(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a statement.
-
.is_translation_unit(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a translation unit.
-
.is_unexposed(cursor_kind) ⇒ Integer
Determine whether the given cursor represents a currently unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
-
.is_virtual_base(cursor) ⇒ Integer
Returns 1 if the base class specified by the cursor with kind CX_CXXBaseSpecifier is virtual.
-
.is_volatile_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “volatile” qualifier set, without looking through typedefs that may have added “volatile” at a different level.
-
.parse_translation_unit(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options) ⇒ TranslationUnitImpl
Parse the given source file and the translation unit corresponding to that file.
-
.range_is_null(range) ⇒ Integer
Returns non-zero if arg range is null.
-
.remap_dispose(remapping) ⇒ nil
Dispose the remapping.
-
.remap_get_filenames(remapping, index, original, transformed) ⇒ nil
Get the original and the associated filename from the remapping.
-
.remap_get_num_files(remapping) ⇒ Integer
Determine the number of remappings.
-
.reparse_translation_unit(tu, num_unsaved_files, unsaved_files, options) ⇒ Integer
Reparse the source files that produced this translation unit.
-
.save_translation_unit(tu, file_name, options) ⇒ Integer
Saves a translation unit into a serialized representation of that translation unit on disk.
-
.sort_code_completion_results(results, num_results) ⇒ nil
Sort the code-completion results in case-insensitive alphabetical order.
-
.toggle_crash_recovery(is_enabled) ⇒ nil
Enable/disable crash recovery.
-
.tokenize(tu, range, tokens, num_tokens) ⇒ nil
Tokenize the source code described by the given range into raw lexical tokens.
-
.visit_children(parent, visitor, client_data) ⇒ Integer
Visit the children of a particular cursor.
Class Method Details
._callback_cursor_visitor_(cursor, parent, client_data) ⇒ Symbol from _enum_child_visit_result_
Visitor invoked for each cursor found by a traversal.
This visitor function will be invoked for each cursor found by clang_visitCursorChildren(). Its first argument is the cursor being visited, its second argument is the parent visitor for that cursor, and its third argument is the client data provided to clang_visitCursorChildren().
The visitor should return one of the c CXChildVisitResult values to direct clang_visitCursorChildren().
This entry is only for documentation and no real method.
2600 |
# File 'lib/ffi_gen/clang.rb', line 2600 callback :cursor_visitor, [Cursor.by_value, Cursor.by_value, :pointer], :child_visit_result |
._callback_inclusion_visitor_(inclusion_stack, include_len, client_data) ⇒ FFI::Pointer(File)
Visitor invoked for each file in a translation unit
(used with clang_getInclusions()).
This visitor function will be invoked by clang_getInclusions() for each file included (either at the top-level or by #include directives) within a translation unit. The first argument is the file being included, and the second and third arguments provide the inclusion stack. The array is sorted in order of immediate inclusion. For example, the first element refers to the location that included ‘included_file’.
This entry is only for documentation and no real method.
3609 |
# File 'lib/ffi_gen/clang.rb', line 3609 callback :inclusion_visitor, [:pointer, :uint, :pointer], :pointer |
._enum_availability_kind_ ⇒ Symbol
Describes the availability of a particular entity, which indicates whether the use of this entity will result in a warning or error due to it being deprecated or unavailable.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:availability_kind).
Options:
- :available
-
The entity is available.
- :deprecated
-
The entity is available, but has been deprecated (and its use is not recommended).
- :not_available
-
The entity is not available; any use of it will be an error.
- :not_accessible
-
The entity is available, but not accessible; any use of it will be an error.
55 56 57 58 59 60 |
# File 'lib/ffi_gen/clang.rb', line 55 enum :availability_kind, [ :available, :deprecated, :not_available, :not_accessible ] |
._enum_child_visit_result_ ⇒ Symbol
Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor.
A value of this enumeration type should be returned by each c CXCursorVisitor to indicate how clang_visitChildren() proceed.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:child_visit_result).
Options:
- :break
-
Terminates the cursor traversal.
- :continue
-
Continues the cursor traversal with the next sibling of the cursor just visited, without visiting its children.
- :recurse
-
Recursively traverse the children of this cursor, using the same visitor and client data.
2575 2576 2577 2578 2579 |
# File 'lib/ffi_gen/clang.rb', line 2575 enum :child_visit_result, [ :break, :continue, :recurse ] |
._enum_code_complete_flags_ ⇒ Symbol
Flags that can be passed to c clang_codeCompleteAt() to modify its behavior.
The enumerators in this enumeration can be bitwise-OR’d together to provide multiple options to c clang_codeCompleteAt().
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:code_complete_flags).
Options:
- :include_macros
-
Whether to include macros within the set of code completions returned.
- :include_code_patterns
-
Whether to include code patterns for language constructs within the set of code completions, e.g., for loops.
3388 3389 3390 3391 |
# File 'lib/ffi_gen/clang.rb', line 3388 enum :code_complete_flags, [ :include_macros, 0x01, :include_code_patterns, 0x02 ] |
._enum_completion_chunk_kind_ ⇒ Symbol
Describes a single piece of text within a code-completion string.
Each “chunk” within a code-completion string (c CXCompletionString) is either a piece of text with a specific “kind” that describes how that text should be interpreted by the client or is another completion string.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:completion_chunk_kind).
Options:
- :optional
-
A code-completion string that describes “optional” text that could be a part of the template (but is not required).
The Optional chunk is the only kind of chunk that has a code-completion string for its representation, which is accessible via c clang_getCompletionChunkCompletionString(). The code-completion string describes an additional part of the template that is completely optional. For example, optional chunks can be used to describe the placeholders for arguments that match up with defaulted function parameters, e.g. given:
code void f(int x, float y = 3.14, double z = 2.71828); endcode
The code-completion string for this function would contain:
- a TypedText chunk for "f". - a LeftParen chunk for "(". - a Placeholder chunk for "int x" - an Optional chunk containing the remaining defaulted arguments, e.g., - a Comma chunk for "," - a Placeholder chunk for "float y" - an Optional chunk containing the last defaulted argument: - a Comma chunk for "," - a Placeholder chunk for "double z" - a RightParen chunk for ")"There are many ways to handle Optional chunks. Two simple approaches are:
- Completely ignore optional chunks, in which case the template for the function "f" would only include the first parameter ("int x"). - Fully expand all optional chunks, in which case the template for the function "f" would have all of the parameters. - :typed_text
-
Text that a user would be expected to type to get this code-completion result.
There will be exactly one “typed text” chunk in a semantic string, which will typically provide the spelling of a keyword or the name of a declaration that could be used at the current code point. Clients are expected to filter the code-completion results based on the text in this chunk.
- :text
-
Text that should be inserted as part of a code-completion result.
A “text” chunk represents text that is part of the template to be inserted into user code should this particular code-completion result be selected.
- :placeholder
-
Placeholder text that should be replaced by the user.
A “placeholder” chunk marks a place where the user should insert text into the code-completion template. For example, placeholders might mark the function parameters for a function declaration, to indicate that the user should provide arguments for each of those parameters. The actual text in a placeholder is a suggestion for the text to display before the user replaces the placeholder with real code.
- :informative
-
Informative text that should be displayed but never inserted as part of the template.
An “informative” chunk contains annotations that can be displayed to help the user decide whether a particular code-completion result is the right option, but which is not part of the actual template to be inserted by code completion.
- :current_parameter
-
Text that describes the current parameter when code-completion is referring to function call, message send, or template specialization.
A “current parameter” chunk occurs when code-completion is providing information about a parameter corresponding to the argument at the code-completion point. For example, given a function
code int add(int x, int y); endcode
and the source code c add(, where the code-completion point is after the “(”, the code-completion string will contain a “current parameter” chunk for “int x”, indicating that the current argument will initialize that parameter. After typing further, to c add(17, (where the code-completion point is after the “,”), the code-completion string will contain a “current paremeter” chunk to “int y”.
- :left_paren
-
A left parenthesis (‘(’), used to initiate a function call or signal the beginning of a function parameter list.
- :right_paren
-
A right parenthesis (‘)’), used to finish a function call or signal the end of a function parameter list.
- :left_bracket
-
A left bracket (‘(’).
- :right_bracket
-
A right bracket (‘)’).
- :left_brace
-
A left brace (‘
- :right_brace
-
A right brace (‘’).
- :left_angle
-
A left angle bracket (‘<’).
- :right_angle
-
A right angle bracket (‘>’).
- :comma
-
A comma separator (‘,’).
- :result_type
-
Text that specifies the result type of a given result.
This special kind of informative chunk is not meant to be inserted into the text buffer. Rather, it is meant to illustrate the type that an expression using the given completion string would have.
- :colon
-
A colon (‘:’).
- :semi_colon
-
A semicolon (‘;’).
- :equal
-
An ‘=’ sign.
- :horizontal_space
-
Horizontal space (‘ ’).
- :vertical_space
-
Vertical space (‘n’), after which it is generally a good idea to perform indentation.
3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 |
# File 'lib/ffi_gen/clang.rb', line 3237 enum :completion_chunk_kind, [ :optional, :typed_text, :text, :placeholder, :informative, :current_parameter, :left_paren, :right_paren, :left_bracket, :right_bracket, :left_brace, :right_brace, :left_angle, :right_angle, :comma, :result_type, :colon, :semi_colon, :equal, :horizontal_space, :vertical_space ] |
._enum_completion_context_ ⇒ Symbol
Bits that represent the context under which completion is occurring.
The enumerators in this enumeration may be bitwise-OR’d together if multiple contexts are occurring simultaneously.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:completion_context).
Options:
- :completion_context_unexposed
-
The context for completions is unexposed, as only Clang results should be included. (This is equivalent to having no context bits set.)
3408 3409 3410 |
# File 'lib/ffi_gen/clang.rb', line 3408 enum :completion_context, [ :completion_context_unexposed, 0 ] |
._enum_cursor_kind_ ⇒ Symbol
Describes the kind of entity that a cursor refers to.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:cursor_kind).
Options:
- :unexposed_decl
-
A declaration whose specific kind is not exposed via this interface.
Unexposed declarations have the same operations as any other kind of declaration; one can extract their location information, spelling, find their definitions, etc. However, the specific kind of the declaration is not reported.
- :struct_decl
-
A C or C++ struct.
- :union_decl
-
A C or C++ union.
- :class_decl
-
A C++ class.
- :enum_decl
-
An enumeration.
- :field_decl
-
A field (in C) or non-static data member (in C++) in a struct, union, or C++ class.
- :enum_constant_decl
-
An enumerator constant.
- :function_decl
-
A function.
- :var_decl
-
A variable.
- :parm_decl
-
A function or method parameter.
- :obj_c_interface_decl
-
An Objective-C @interface.
- :obj_c_category_decl
-
An Objective-C @interface for a category.
- :obj_c_protocol_decl
-
An Objective-C @protocol declaration.
- :obj_c_property_decl
-
An Objective-C @property declaration.
- :obj_c_ivar_decl
-
An Objective-C instance variable.
- :obj_c_instance_method_decl
-
An Objective-C instance method.
- :obj_c_class_method_decl
-
An Objective-C class method.
- :obj_c_implementation_decl
-
An Objective-C @implementation.
- :obj_c_category_impl_decl
-
An Objective-C @implementation for a category.
- :typedef_decl
-
A typedef
- :x_method
-
A C++ class method.
- :namespace
-
A C++ namespace.
- :linkage_spec
-
A linkage specification, e.g. ‘extern “C”’.
- :constructor
-
A C++ constructor.
- :destructor
-
A C++ destructor.
- :conversion_function
-
A C++ conversion function.
- :template_type_parameter
-
A C++ template type parameter.
- :non_type_template_parameter
-
A C++ non-type template parameter.
- :template_template_parameter
-
A C++ template template parameter.
- :function_template
-
A C++ function template.
- :class_template
-
A C++ class template.
- :class_template_partial_specialization
-
A C++ class template partial specialization.
- :namespace_alias
-
A C++ namespace alias declaration.
- :using_directive
-
A C++ using directive.
- :using_declaration
-
A C++ using declaration.
- :type_alias_decl
-
A C++ alias declaration
- :obj_c_synthesize_decl
-
An Objective-C @synthesize definition.
- :obj_c_dynamic_decl
-
An Objective-C @dynamic definition.
- :x_access_specifier
-
An access specifier.
- :first_ref
-
References
- :obj_c_super_class_ref
-
Decl references
- :obj_c_protocol_ref
- :obj_c_class_ref
- :type_ref
-
A reference to a type declaration.
A type reference occurs anywhere where a type is named but not declared. For example, given:
code typedef unsigned size_type; size_type size; endcode
The typedef is a declaration of size_type (CXCursor_TypedefDecl), while the type of the variable “size” is referenced. The cursor referenced by the type of size is the typedef for size_type.
- :x_base_specifier
- :template_ref
-
A reference to a class template, function template, template template parameter, or class template partial specialization.
- :namespace_ref
-
A reference to a namespace or namespace alias.
- :member_ref
-
A reference to a member of a struct, union, or class that occurs in some non-expression context, e.g., a designated initializer.
- :label_ref
-
A reference to a labeled statement.
This cursor kind is used to describe the jump to “start_over” in the goto statement in the following example:
code
start_over: ++counter; goto start_over;endcode
A label reference cursor refers to a label statement.
- :overloaded_decl_ref
-
A reference to a set of overloaded functions or function templates that has not yet been resolved to a specific function or function template.
An overloaded declaration reference cursor occurs in C++ templates where a dependent name refers to a function. For example:
code template<typename T> void swap(T&, T&);
struct X { … }; void swap(X&, X&);
template<typename T> void reverse(T* first, T* last) {
while (first < last - 1) { swap(*first, *--last); ++first; }}
struct Y { }; void swap(Y&, Y&); endcode
Here, the identifier “swap” is associated with an overloaded declaration reference. In the template definition, “swap” refers to either of the two “swap” functions declared above, so both results will be available. At instantiation time, “swap” may also refer to other functions found via argument-dependent lookup (e.g., the “swap” function at the end of the example).
The functions c clang_getNumOverloadedDecls() and c clang_getOverloadedDecl() can be used to retrieve the definitions referenced by this cursor.
- :first_invalid
-
Error conditions
- :invalid_file
- :no_decl_found
- :not_implemented
- :invalid_code
- :first_expr
-
Expressions
- :unexposed_expr
-
An expression whose specific kind is not exposed via this interface.
Unexposed expressions have the same operations as any other kind of expression; one can extract their location information, spelling, children, etc. However, the specific kind of the expression is not reported.
- :decl_ref_expr
-
An expression that refers to some value declaration, such as a function, varible, or enumerator.
- :member_ref_expr
-
An expression that refers to a member of a struct, union, class, Objective-C class, etc.
- :call_expr
-
An expression that calls a function.
- :obj_c_message_expr
-
An expression that sends a message to an Objective-C
object or class. - :block_expr
-
An expression that represents a block literal.
- :integer_literal
-
An integer literal.
- :floating_literal
-
A floating point number literal.
- :imaginary_literal
-
An imaginary number literal.
- :string_literal
-
A string literal.
- :character_literal
-
A character literal.
- :paren_expr
-
A parenthesized expression, e.g. “(1)”.
This AST node is only formed if full location information is requested.
- :unary_operator
-
This represents the unary-expression’s (except sizeof and alignof).
- :array_subscript_expr
-
(C99 6.5.2.1) Array Subscripting.
- :binary_operator
-
A builtin binary operation expression such as “x + y” or “x <= y”.
- :compound_assign_operator
-
Compound assignment such as “+=”.
- :conditional_operator
-
The ?: ternary operator.
- :c_style_cast_expr
-
An explicit cast in C (C99 6.5.4) or a C-style cast in C++ (C++ (expr.cast)), which uses the syntax (Type)expr.
For example: (int)f.
- :compound_literal_expr
-
(C99 6.5.2.5)
- :init_list_expr
-
Describes an C or C++ initializer list.
- :addr_label_expr
-
The GNU address of label extension, representing &&label.
- :stmt_expr
-
This is the GNU Statement Expression extension: (X=4; X;)
- :generic_selection_expr
-
Represents a C1X generic selection.
- :gnu_null_expr
-
Implements the GNU __null extension, which is a name for a null pointer constant that has integral type (e.g., int or long) and is the same size and alignment as a pointer.
The __null extension is typically only used by system headers, which define NULL as __null in C++ rather than using 0 (which is an integer that may not match the size of a pointer).
- :x_static_cast_expr
-
C++‘s static_cast<> expression.
- :x_dynamic_cast_expr
-
C++‘s dynamic_cast<> expression.
- :x_reinterpret_cast_expr
-
C++‘s reinterpret_cast<> expression.
- :x_const_cast_expr
-
C++‘s const_cast<> expression.
- :x_functional_cast_expr
-
Represents an explicit C++ type conversion that uses “functional” notion (C++ (expr.type.conv)).
Example: code
x = int(0.5);endcode
- :x_typeid_expr
-
A C++ typeid expression (C++ (expr.typeid)).
- :x_bool_literal_expr
-
(C++ 2.13.5) C++ Boolean Literal.
- :x_null_ptr_literal_expr
-
(C++0x 2.14.7) C++ Pointer Literal.
- :x_this_expr
-
Represents the “this” expression in C++
- :x_throw_expr
-
(C++ 15) C++ Throw Expression.
This handles ‘throw’ and ‘throw’ assignment-expression. When assignment-expression isn’t present, Op will be null.
- :x_new_expr
-
A new expression for memory allocation and constructor calls, e.g: “new CXXNewExpr(foo)”.
- :x_delete_expr
-
A delete expression for memory deallocation and destructor calls, e.g. “delete() pArray”.
- :unary_expr
-
A unary expression.
- :obj_c_string_literal
-
ObjCStringLiteral, used for Objective-C string literals i.e. “foo”.
- :obj_c_encode_expr
-
ObjCEncodeExpr, used for in Objective-C.
- :obj_c_selector_expr
-
ObjCSelectorExpr used for in Objective-C.
- :obj_c_protocol_expr
-
Objective-C’s protocol expression.
- :obj_c_bridged_cast_expr
-
An Objective-C “bridged” cast expression, which casts between Objective-C pointers and C pointers, transferring ownership in the process.
code
NSString *str = (__bridge_transfer NSString *)CFCreateString();endcode
- :pack_expansion_expr
-
Represents a C++0x pack expansion that produces a sequence of expressions.
A pack expansion expression contains a pattern (which itself is an expression) followed by an ellipsis. For example:
code template<typename F, typename …Types> void forward(F f, Types &&…args)
f(static_cast<Types&&>(args)...);endcode
- :size_of_pack_expr
-
Represents an expression that computes the length of a parameter pack.
code template<typename …Types> struct count
static const unsigned value = sizeof...(Types);; endcode
- :first_stmt
-
Statements
- :unexposed_stmt
-
A statement whose specific kind is not exposed via this interface.
Unexposed statements have the same operations as any other kind of statement; one can extract their location information, spelling, children, etc. However, the specific kind of the statement is not reported.
- :label_stmt
-
A labelled statement in a function.
This cursor kind is used to describe the “start_over:” label statement in the following example:
code
start_over: ++counter;endcode
- :compound_stmt
-
A group of statements like { stmt stmt }.
This cursor kind is used to describe compound statements, e.g. function bodies.
- :case_stmt
-
A case statment.
- :default_stmt
-
A default statement.
- :if_stmt
-
An if statement
- :switch_stmt
-
A switch statement.
- :while_stmt
-
A while statement.
- :do_stmt
-
A do statement.
- :for_stmt
-
A for statement.
- :goto_stmt
-
A goto statement.
- :indirect_goto_stmt
-
An indirect goto statement.
- :continue_stmt
-
A continue statement.
- :break_stmt
-
A break statement.
- :return_stmt
-
A return statement.
- :asm_stmt
-
A GNU inline assembly statement extension.
- :obj_c_at_try_stmt
-
Objective-C’s overall @try-@catc-@finall statement.
- :obj_c_at_catch_stmt
-
Objective-C’s @catch statement.
- :obj_c_at_finally_stmt
-
Objective-C’s @finally statement.
- :obj_c_at_throw_stmt
-
Objective-C’s @throw statement.
- :obj_c_at_synchronized_stmt
-
Objective-C’s @synchronized statement.
- :obj_c_autorelease_pool_stmt
-
Objective-C’s autorelease pool statement.
- :obj_c_for_collection_stmt
-
Objective-C’s collection statement.
- :x_catch_stmt
-
C++‘s catch statement.
- :x_try_stmt
-
C++‘s try statement.
- :x_for_range_stmt
-
C++‘s for (* : *) statement.
- :seh_try_stmt
-
Windows Structured Exception Handling’s try statement.
- :seh_except_stmt
-
Windows Structured Exception Handling’s except statement.
- :seh_finally_stmt
-
Windows Structured Exception Handling’s finally statement.
- :null_stmt
-
The null satement “;”: C99 6.8.3p3.
This cursor kind is used to describe the null statement.
- :decl_stmt
-
Adaptor class for mixing declarations with statements and expressions.
- :translation_unit
-
Cursor that represents the translation unit itself.
The translation unit cursor exists primarily to act as the root cursor for traversing the contents of a translation unit.
- :first_attr
-
Attributes
- :unexposed_attr
-
An attribute whose specific kind is not exposed via this interface.
- :ib_action_attr
- :ib_outlet_attr
- :ib_outlet_collection_attr
- :x_final_attr
- :x_override_attr
- :annotate_attr
- :preprocessing_directive
-
Preprocessing
- :macro_definition
- :macro_expansion
- :inclusion_directive
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 |
# File 'lib/ffi_gen/clang.rb', line 1566 enum :cursor_kind, [ :unexposed_decl, 1, :struct_decl, 2, :union_decl, 3, :class_decl, 4, :enum_decl, 5, :field_decl, 6, :enum_constant_decl, 7, :function_decl, 8, :var_decl, 9, :parm_decl, 10, :obj_c_interface_decl, 11, :obj_c_category_decl, 12, :obj_c_protocol_decl, 13, :obj_c_property_decl, 14, :obj_c_ivar_decl, 15, :obj_c_instance_method_decl, 16, :obj_c_class_method_decl, 17, :obj_c_implementation_decl, 18, :obj_c_category_impl_decl, 19, :typedef_decl, 20, :x_method, 21, :namespace, 22, :linkage_spec, 23, :constructor, 24, :destructor, 25, :conversion_function, 26, :template_type_parameter, 27, :non_type_template_parameter, 28, :template_template_parameter, 29, :function_template, 30, :class_template, 31, :class_template_partial_specialization, 32, :namespace_alias, 33, :using_directive, 34, :using_declaration, 35, :type_alias_decl, 36, :obj_c_synthesize_decl, 37, :obj_c_dynamic_decl, 38, :x_access_specifier, 39, :first_ref, 40, :obj_c_super_class_ref, 40, :obj_c_protocol_ref, 41, :obj_c_class_ref, 42, :type_ref, 43, :x_base_specifier, 44, :template_ref, 45, :namespace_ref, 46, :member_ref, 47, :label_ref, 48, :overloaded_decl_ref, 49, :first_invalid, 70, :invalid_file, 70, :no_decl_found, 71, :not_implemented, 72, :invalid_code, 73, :first_expr, 100, :unexposed_expr, 100, :decl_ref_expr, 101, :member_ref_expr, 102, :call_expr, 103, :obj_c_message_expr, 104, :block_expr, 105, :integer_literal, 106, :floating_literal, 107, :imaginary_literal, 108, :string_literal, 109, :character_literal, 110, :paren_expr, 111, :unary_operator, 112, :array_subscript_expr, 113, :binary_operator, 114, :compound_assign_operator, 115, :conditional_operator, 116, :c_style_cast_expr, 117, :compound_literal_expr, 118, :init_list_expr, 119, :addr_label_expr, 120, :stmt_expr, 121, :generic_selection_expr, 122, :gnu_null_expr, 123, :x_static_cast_expr, 124, :x_dynamic_cast_expr, 125, :x_reinterpret_cast_expr, 126, :x_const_cast_expr, 127, :x_functional_cast_expr, 128, :x_typeid_expr, 129, :x_bool_literal_expr, 130, :x_null_ptr_literal_expr, 131, :x_this_expr, 132, :x_throw_expr, 133, :x_new_expr, 134, :x_delete_expr, 135, :unary_expr, 136, :obj_c_string_literal, 137, :obj_c_encode_expr, 138, :obj_c_selector_expr, 139, :obj_c_protocol_expr, 140, :obj_c_bridged_cast_expr, 141, :pack_expansion_expr, 142, :size_of_pack_expr, 143, :first_stmt, 200, :unexposed_stmt, 200, :label_stmt, 201, :compound_stmt, 202, :case_stmt, 203, :default_stmt, 204, :if_stmt, 205, :switch_stmt, 206, :while_stmt, 207, :do_stmt, 208, :for_stmt, 209, :goto_stmt, 210, :indirect_goto_stmt, 211, :continue_stmt, 212, :break_stmt, 213, :return_stmt, 214, :asm_stmt, 215, :obj_c_at_try_stmt, 216, :obj_c_at_catch_stmt, 217, :obj_c_at_finally_stmt, 218, :obj_c_at_throw_stmt, 219, :obj_c_at_synchronized_stmt, 220, :obj_c_autorelease_pool_stmt, 221, :obj_c_for_collection_stmt, 222, :x_catch_stmt, 223, :x_try_stmt, 224, :x_for_range_stmt, 225, :seh_try_stmt, 226, :seh_except_stmt, 227, :seh_finally_stmt, 228, :null_stmt, 230, :decl_stmt, 231, :translation_unit, 300, :first_attr, 400, :unexposed_attr, 400, :ib_action_attr, 401, :ib_outlet_attr, 402, :ib_outlet_collection_attr, 403, :x_final_attr, 404, :x_override_attr, 405, :annotate_attr, 406, :preprocessing_directive, 500, :macro_definition, 501, :macro_expansion, 502, :inclusion_directive, 503 ] |
._enum_cxx_access_specifier_ ⇒ Symbol
Represents the C++ access control level to a base class for a cursor with kind CX_CXXBaseSpecifier.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:cxx_access_specifier).
Options:
- :x_invalid_access_specifier
- :x_public
- :x_protected
- :x_private
2504 2505 2506 2507 2508 2509 |
# File 'lib/ffi_gen/clang.rb', line 2504 enum :cxx_access_specifier, [ :x_invalid_access_specifier, :x_public, :x_protected, :x_private ] |
._enum_diagnostic_display_options_ ⇒ Symbol
Options to control the display of diagnostics.
The values in this enum are meant to be combined to customize the behavior of c clang_displayDiagnostic().
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:diagnostic_display_options).
Options:
- :display_source_location
-
Display the source-location information where the diagnostic was located.
When set, diagnostics will be prefixed by the file, line, and (optionally) column to which the diagnostic refers. For example,
code test.c:28: warning: extra tokens at end of #endif directive endcode
This option corresponds to the clang flag c -fshow-source-location.
- :display_column
-
If displaying the source-location information of the diagnostic, also include the column number.
This option corresponds to the clang flag c -fshow-column.
- :display_source_ranges
-
If displaying the source-location information of the diagnostic, also include information about source ranges in a machine-parsable format.
This option corresponds to the clang flag c -fdiagnostics-print-source-range-info.
- :display_option
-
Display the option name associated with this diagnostic, if any.
The option name displayed (e.g., -Wconversion) will be placed in brackets after the diagnostic text. This option corresponds to the clang flag c -fdiagnostics-show-option.
- :display_category_id
-
Display the category number associated with this diagnostic, if any.
The category number is displayed within brackets after the diagnostic text. This option corresponds to the clang flag c -fdiagnostics-show-category=id.
- :display_category_name
-
Display the category name associated with this diagnostic, if any.
The category name is displayed within brackets after the diagnostic text. This option corresponds to the clang flag c -fdiagnostics-show-category=name.
503 504 505 506 507 508 509 510 |
# File 'lib/ffi_gen/clang.rb', line 503 enum :diagnostic_display_options, [ :display_source_location, 0x01, :display_column, 0x02, :display_source_ranges, 0x04, :display_option, 0x08, :display_category_id, 0x10, :display_category_name, 0x20 ] |
._enum_diagnostic_severity_ ⇒ Symbol
Describes the severity of a particular diagnostic.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:diagnostic_severity).
Options:
- :ignored
-
A diagnostic that has been suppressed, e.g., by a command-line option.
- :note
-
This diagnostic is a note that should be attached to the previous (non-note) diagnostic.
- :warning
-
This diagnostic indicates suspicious code that may not be wrong.
- :error
-
This diagnostic indicates that the code is ill-formed.
- :fatal
-
This diagnostic indicates that the code is ill-formed such that future parser recovery is unlikely to produce useful results.
414 415 416 417 418 419 420 |
# File 'lib/ffi_gen/clang.rb', line 414 enum :diagnostic_severity, [ :ignored, 0, :note, 1, :warning, 2, :error, 3, :fatal, 4 ] |
._enum_language_kind_ ⇒ Symbol
Describe the “language” of the entity referred to by a cursor.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:language_kind).
Options:
- :invalid
- :c
- :obj_c
- :c_plus_plus
1939 1940 1941 1942 1943 1944 |
# File 'lib/ffi_gen/clang.rb', line 1939 enum :language_kind, [ :invalid, 0, :c, :obj_c, :c_plus_plus ] |
._enum_linkage_kind_ ⇒ Symbol
Describe the linkage of the entity referred to by a cursor.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:linkage_kind).
Options:
- :invalid
-
This value indicates that no linkage information is available for a provided CXCursor.
- :no_linkage
-
This is the linkage for variables, parameters, and so on that
have automatic storage. This covers normal (non-extern) local variables. - :internal
-
This is the linkage for static variables and static functions.
- :unique_external
-
This is the linkage for entities with external linkage that live in C++ anonymous namespaces.
- :external
-
This is the linkage for entities with true, external linkage.
1898 1899 1900 1901 1902 1903 1904 |
# File 'lib/ffi_gen/clang.rb', line 1898 enum :linkage_kind, [ :invalid, :no_linkage, :internal, :unique_external, :external ] |
._enum_name_ref_flags_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:name_ref_flags).
Options:
- :want_qualifier
- Include the nested-name-specifier, e.g. Foo
-
in x.Foo::y, in the
range.
- :want_template_args
-
Include the explicit template arguments, e.g. <int> in x.f<int>, in the range.
- :want_single_piece
-
If the name is non-contiguous, return the full spanning range.
Non-contiguous names occur in Objective-C when a selector with two or more parameters is used, or in C++ when using an operator: code (object doSomething:here withValue:there); // ObjC return some_vector(1); // C++ endcode
2907 2908 2909 2910 2911 |
# File 'lib/ffi_gen/clang.rb', line 2907 enum :name_ref_flags, [ :want_qualifier, 0x1, :want_template_args, 0x2, :want_single_piece, 0x4 ] |
._enum_reparse_flags_ ⇒ Symbol
Flags that control the reparsing of translation units.
The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when reparsing the translation unit.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:reparse_flags).
Options:
- :reparse_none
-
Used to indicate that no special reparsing options are needed.
956 957 958 |
# File 'lib/ffi_gen/clang.rb', line 956 enum :reparse_flags, [ :reparse_none, 0x0 ] |
._enum_save_error_ ⇒ Symbol
Describes the kind of error that occurred (if any) in a call to c clang_saveTranslationUnit().
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:save_error).
Options:
- :none
-
Indicates that no error occurred while saving a translation unit.
- :unknown
-
Indicates that an unknown error occurred while attempting to save the file.
This error typically indicates that file I/O failed when attempting to write the file.
- :translation_errors
-
Indicates that errors during translation prevented this attempt to save the translation unit.
Errors that prevent the translation unit from being saved can be extracted using c clang_getNumDiagnostics() and c clang_getDiagnostic().
- :invalid_tu
-
Indicates that the translation unit to be saved was somehow invalid (e.g., NULL).
904 905 906 907 908 909 |
# File 'lib/ffi_gen/clang.rb', line 904 enum :save_error, [ :none, 0, :unknown, 1, :translation_errors, 2, :invalid_tu, 3 ] |
._enum_save_translation_unit_flags_ ⇒ Symbol
Flags that control how translation units are saved.
The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when saving the translation unit.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:save_translation_unit_flags).
Options:
- :save_translation_unit_none
-
Used to indicate that no special saving options are needed.
859 860 861 |
# File 'lib/ffi_gen/clang.rb', line 859 enum :save_translation_unit_flags, [ :save_translation_unit_none, 0x0 ] |
._enum_token_kind_ ⇒ Symbol
Describes a kind of token.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:token_kind).
Options:
- :punctuation
-
A token that contains some kind of punctuation.
- :keyword
-
A language keyword.
- :identifier
-
An identifier (that is not a keyword).
- :literal
-
A numeric, string, or character literal.
- :comment
-
A comment.
2932 2933 2934 2935 2936 2937 2938 |
# File 'lib/ffi_gen/clang.rb', line 2932 enum :token_kind, [ :punctuation, :keyword, :identifier, :literal, :comment ] |
._enum_translation_unit_flags_ ⇒ Symbol
Flags that control the creation of translation units.
The enumerators in this enumeration type are meant to be bitwise ORed together to specify which options should be used when constructing the translation unit.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:translation_unit_flags).
Options:
- :none
-
Used to indicate that no special translation-unit options are needed.
- :detailed_preprocessing_record
-
Used to indicate that the parser should construct a “detailed” preprocessing record, including all macro definitions and instantiations.
Constructing a detailed preprocessing record requires more memory and time to parse, since the information contained in the record is usually not retained. However, it can be useful for applications that require more detailed information about the behavior of the preprocessor.
- :incomplete
-
Used to indicate that the translation unit is incomplete.
When a translation unit is considered “incomplete”, semantic analysis that is typically performed at the end of the translation unit will be suppressed. For example, this suppresses the completion of tentative declarations in C and of instantiation of implicitly-instantiation function templates in C++. This option is typically used when parsing a header with the intent of producing a precompiled header.
- :precompiled_preamble
-
Used to indicate that the translation unit should be built with an implicit precompiled header for the preamble.
An implicit precompiled header is used as an optimization when a particular translation unit is likely to be reparsed many times when the sources aren’t changing that often. In this case, an implicit precompiled header will be built containing all of the initial includes at the top of the main file (what we refer to as the “preamble” of the file). In subsequent parses, if the preamble or the files in it have not changed, c clang_reparseTranslationUnit() will re-use the implicit precompiled header to improve parsing performance.
- :cache_completion_results
-
Used to indicate that the translation unit should cache some code-completion results with each reparse of the source file.
Caching of code-completion results is a performance optimization that introduces some overhead to reparsing but improves the performance of code-completion operations.
- :x_precompiled_preamble
-
DEPRECATED: Enable precompiled preambles in C++.
Note: this is a temporary option that is available only while we are testing C++ precompiled preamble support. It is deprecated.
- :x_chained_pch
-
DEPRECATED: Enabled chained precompiled preambles in C++.
Note: this is a temporary option that is available only while we are testing C++ precompiled preamble support. It is deprecated.
- :nested_macro_expansions
-
Used to indicate that the “detailed” preprocessing record, if requested, should also contain nested macro expansions.
Nested macro expansions (i.e., macro expansions that occur inside another macro expansion) can, in some code bases, require a large amount of storage to due preprocessor metaprogramming. Moreover, its fairly rare that this information is useful for libclang clients.
780 781 782 783 784 785 786 787 788 789 |
# File 'lib/ffi_gen/clang.rb', line 780 enum :translation_unit_flags, [ :none, 0x0, :detailed_preprocessing_record, 0x01, :incomplete, 0x02, :precompiled_preamble, 0x04, :cache_completion_results, 0x08, :x_precompiled_preamble, 0x10, :x_chained_pch, 0x20, :nested_macro_expansions, 0x40 ] |
._enum_tu_resource_usage_kind_ ⇒ Symbol
Categorizes how memory is being used by a translation unit.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:tu_resource_usage_kind).
Options:
- :ast
- :identifiers
- :selectors
- :global_completion_results
- :source_manager_content_cache
- :ast_side_tables
- :source_manager_membuffer_malloc
- :source_manager_membuffer_m_map
- :external_ast_source_membuffer_malloc
- :external_ast_source_membuffer_m_map
- :preprocessor
- :preprocessing_record
- :source_manager_data_structures
- :preprocessor_header_search
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 |
# File 'lib/ffi_gen/clang.rb', line 1048 enum :tu_resource_usage_kind, [ :ast, 1, :identifiers, 2, :selectors, 3, :global_completion_results, 4, :source_manager_content_cache, 5, :ast_side_tables, 6, :source_manager_membuffer_malloc, 7, :source_manager_membuffer_m_map, 8, :external_ast_source_membuffer_malloc, 9, :external_ast_source_membuffer_m_map, 10, :preprocessor, 11, :preprocessing_record, 12, :source_manager_data_structures, 13, :preprocessor_header_search, 14 ] |
._enum_type_kind_ ⇒ Symbol
Describes the kind of type
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:type_kind).
Options:
- :invalid
-
Reprents an invalid type (e.g., where no type is available).
- :unexposed
-
A type whose specific kind is not exposed via this interface.
- :void
-
Builtin types
- :bool
- :char_u
- :u_char
- :char16
- :char32
- :u_short
- :u_int
- :u_long
- :u_long_long
- :u_int128
- :char_s
- :s_char
- :w_char
- :short
- :int
- :long
- :long_long
- :int128
- :float
- :double
- :long_double
- :null_ptr
- :overload
- :dependent
- :obj_c_id
- :obj_c_class
- :obj_c_sel
- :complex
- :pointer
- :block_pointer
- :l_value_reference
- :r_value_reference
- :record
- :enum
- :typedef
- :obj_c_interface
- :obj_c_object_pointer
- :function_no_proto
- :function_proto
- :constant_array
2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 |
# File 'lib/ffi_gen/clang.rb', line 2283 enum :type_kind, [ :invalid, 0, :unexposed, 1, :void, 2, :bool, 3, :char_u, 4, :u_char, 5, :char16, 6, :char32, 7, :u_short, 8, :u_int, 9, :u_long, 10, :u_long_long, 11, :u_int128, 12, :char_s, 13, :s_char, 14, :w_char, 15, :short, 16, :int, 17, :long, 18, :long_long, 19, :int128, 20, :float, 21, :double, 22, :long_double, 23, :null_ptr, 24, :overload, 25, :dependent, 26, :obj_c_id, 27, :obj_c_class, 28, :obj_c_sel, 29, :complex, 100, :pointer, 101, :block_pointer, 102, :l_value_reference, 103, :r_value_reference, 104, :record, 105, :enum, 106, :typedef, 107, :obj_c_interface, 108, :obj_c_object_pointer, 109, :function_no_proto, 110, :function_proto, 111, :constant_array, 112 ] |
._enum_visitor_result_ ⇒ Symbol
defgroup CINDEX_HIGH Higher level API functions
@{
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:visitor_result).
Options:
- :break
- :continue
3676 3677 3678 3679 |
# File 'lib/ffi_gen/clang.rb', line 3676 enum :visitor_result, [ :break, :continue ] |
.annotate_tokens(tu, tokens, num_tokens, cursors) ⇒ nil
Annotate the given set of tokens by providing cursors for each token that can be mapped to a specific entity within the abstract syntax tree.
This token-annotation routine is equivalent to invoking clang_getCursor() for the source locations of each of the tokens. The cursors provided are filtered, so that only those cursors that have a direct correspondence to the token are accepted. For example, given a function call c f(x), clang_getCursor() would provide the following cursors:
* when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'.
* when the cursor is over the '(' or the ')', a CallExpr referring to 'f'.
* when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'.
Only the first and last of these cursors will occur within the annotate, since the tokens “f” and “x’ directly refer to a function and a variable, respectively, but the parentheses are just a small part of the full syntax of the function call expression, which is not provided as an annotation.
3034 |
# File 'lib/ffi_gen/clang.rb', line 3034 attach_function :annotate_tokens, :clang_annotateTokens, [TranslationUnitImpl, :pointer, :uint, :pointer], :void |
.code_complete_at(tu, complete_filename, complete_line, complete_column, unsaved_files, num_unsaved_files, options) ⇒ FFI::Pointer(*CodeCompleteResults)
Perform code completion at a given location in a translation unit.
This function performs code completion at a particular file, line, and column within source code, providing results that suggest potential code snippets based on the context of the completion. The basic model for code completion is that Clang will parse a complete source file, performing syntax checking up to the location where code-completion has been requested. At that point, a special code-completion token is passed to the parser, which recognizes this token and determines, based on the current location in the C/Objective-C/C++ grammar and the state of semantic analysis, what completions to provide. These completions are returned via a new c CXCodeCompleteResults structure.
Code completion itself is meant to be triggered by the client when the user types punctuation characters or whitespace, at which point the code-completion location will coincide with the cursor. For example, if c p is a pointer, code-completion might be triggered after the “-” and then after the “>” in c p->. When the code-completion location is afer the “>”, the completion results will provide, e.g., the members of the struct that “p” points to. The client is responsible for placing the cursor at the beginning of the token currently being typed, then filtering the results based on the contents of the token. For example, when code-completing for the expression c p->get, the client should provide the location just after the “>” (e.g., pointing at the “g”) to this code-completion hook. Then, the client can filter the results based on the current token text (“get”), only showing those results that start with “get”. The intent of this interface is to separate the relatively high-latency acquisition of code-completion results from the filtering of results on a per-character basis, which must have a lower latency.
3481 |
# File 'lib/ffi_gen/clang.rb', line 3481 attach_function :code_complete_at, :clang_codeCompleteAt, [TranslationUnitImpl, :string, :uint, :uint, UnsavedFile, :uint, :uint], :pointer |
.code_complete_get_container_kind(results, is_incomplete) ⇒ Symbol from _enum_cursor_kind_
Returns the cursor kind for the container for the current code completion context. The container is only guaranteed to be set for contexts where a container exists (i.e. member accesses or Objective-C message sends); if there is not a container, this function will return CXCursor_InvalidCode.
3547 |
# File 'lib/ffi_gen/clang.rb', line 3547 attach_function :code_complete_get_container_kind, :clang_codeCompleteGetContainerKind, [:pointer, :pointer], :cursor_kind |
.code_complete_get_container_usr(results) ⇒ String
Returns the USR for the container for the current code completion context. If there is not a container for the current context, this function will return the empty string.
3557 |
# File 'lib/ffi_gen/clang.rb', line 3557 attach_function :code_complete_get_container_usr, :clang_codeCompleteGetContainerUSR, [:pointer], String.by_value |
.code_complete_get_contexts(results) ⇒ Integer
Determines what compeltions are appropriate for the context the given code completion.
3531 |
# File 'lib/ffi_gen/clang.rb', line 3531 attach_function :code_complete_get_contexts, :clang_codeCompleteGetContexts, [:pointer], :ulong_long |
.code_complete_get_diagnostic(results, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given code completion.
Result: the code completion results to query.
3521 |
# File 'lib/ffi_gen/clang.rb', line 3521 attach_function :code_complete_get_diagnostic, :clang_codeCompleteGetDiagnostic, [:pointer, :uint], :pointer |
.code_complete_get_num_diagnostics(results) ⇒ Integer
Determine the number of diagnostics produced prior to the location where code completion was performed.
3508 |
# File 'lib/ffi_gen/clang.rb', line 3508 attach_function :code_complete_get_num_diagnostics, :clang_codeCompleteGetNumDiagnostics, [:pointer], :uint |
.code_complete_get_obj_c_selector(results) ⇒ String
Returns the currently-entered selector for an Objective-C message send, formatted like “initWithFoo:bar:”. Only guaranteed to return a non-empty string for CXCompletionContext_ObjCInstanceMessage and CXCompletionContext_ObjCClassMessage.
3569 |
# File 'lib/ffi_gen/clang.rb', line 3569 attach_function :code_complete_get_obj_c_selector, :clang_codeCompleteGetObjCSelector, [:pointer], String.by_value |
.construct_usr_obj_c_category(class_name, category_name) ⇒ String
Construct a USR for a specified Objective-C category.
2652 |
# File 'lib/ffi_gen/clang.rb', line 2652 attach_function :construct_usr_obj_c_category, :clang_constructUSR_ObjCCategory, [:string, :string], String.by_value |
.construct_usr_obj_c_class(class_name) ⇒ String
Construct a USR for a specified Objective-C class.
2643 |
# File 'lib/ffi_gen/clang.rb', line 2643 attach_function :construct_usr_obj_c_class, :clang_constructUSR_ObjCClass, [:string], String.by_value |
.construct_usr_obj_c_ivar(name, class_usr) ⇒ String
Construct a USR for a specified Objective-C instance variable and
the USR for its containing class.
2670 |
# File 'lib/ffi_gen/clang.rb', line 2670 attach_function :construct_usr_obj_c_ivar, :clang_constructUSR_ObjCIvar, [:string, String.by_value], String.by_value |
.construct_usr_obj_c_method(name, is_instance_method, class_usr) ⇒ String
Construct a USR for a specified Objective-C method and
the USR for its containing class.
2681 |
# File 'lib/ffi_gen/clang.rb', line 2681 attach_function :construct_usr_obj_c_method, :clang_constructUSR_ObjCMethod, [:string, :uint, String.by_value], String.by_value |
.construct_usr_obj_c_property(property, class_usr) ⇒ String
Construct a USR for a specified Objective-C property and the USR
for its containing class.
2691 |
# File 'lib/ffi_gen/clang.rb', line 2691 attach_function :construct_usr_obj_c_property, :clang_constructUSR_ObjCProperty, [:string, String.by_value], String.by_value |
.construct_usr_obj_c_protocol(protocol_name) ⇒ String
Construct a USR for a specified Objective-C protocol.
2660 |
# File 'lib/ffi_gen/clang.rb', line 2660 attach_function :construct_usr_obj_c_protocol, :clang_constructUSR_ObjCProtocol, [:string], String.by_value |
.create_cx_cursor_set ⇒ CursorSetImpl
Creates an empty CXCursorSet.
1971 |
# File 'lib/ffi_gen/clang.rb', line 1971 attach_function :create_cx_cursor_set, :clang_createCXCursorSet, [], CursorSetImpl |
.create_index(exclude_declarations_from_pch, display_diagnostics) ⇒ FFI::Pointer(Index)
clang_createIndex() provides a shared context for creating translation units. It provides two options:
-
excludeDeclarationsFromPCH: When non-zero, allows enumeration of “local”
declarations (when loading any new translation units). A “local” declaration is one that belongs in the translation unit itself and not in a precompiled header that was used by the translation unit. If zero, all declarations will be enumerated.
Here is an example:
// excludeDeclsFromPCH = 1, displayDiagnostics=1
Idx = clang_createIndex(1, 1);
// IndexTest.pch was produced with the following command:
// "clang -x c IndexTest.h -emit-ast -o IndexTest.pch"
TU = clang_createTranslationUnit(Idx, "IndexTest.pch");
// This will load all the symbols from 'IndexTest.pch'
clang_visitChildren(clang_getTranslationUnitCursor(TU),
TranslationUnitVisitor, 0);
clang_disposeTranslationUnit(TU);
// This will load all the symbols from 'IndexTest.c', excluding symbols
// from 'IndexTest.pch'.
char *args() = { "-Xclang", "-include-pch=IndexTest.pch" };
TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args,
0, 0);
clang_visitChildren(clang_getTranslationUnitCursor(TU),
TranslationUnitVisitor, 0);
clang_disposeTranslationUnit(TU);
This process of creating the ‘pch’, loading it separately, and using it (via -include-pch) allows ‘excludeDeclsFromPCH’ to remove redundant callbacks (which gives the indexer the same performance benefit as the compiler).
136 |
# File 'lib/ffi_gen/clang.rb', line 136 attach_function :create_index, :clang_createIndex, [:int, :int], :pointer |
.create_translation_unit(index, ast_filename) ⇒ TranslationUnitImpl
Create a translation unit from an AST file (-emit-ast).
705 |
# File 'lib/ffi_gen/clang.rb', line 705 attach_function :create_translation_unit, :clang_createTranslationUnit, [:pointer, :string], TranslationUnitImpl |
.create_translation_unit_from_source_file(c_idx, source_filename, num_clang_command_line_args, command_line_args, num_unsaved_files, unsaved_files) ⇒ TranslationUnitImpl
Return the CXTranslationUnit for a given source file and the provided command line arguments one would pass to the compiler.
Note: The ‘source_filename’ argument is optional. If the caller provides a NULL pointer, the name of the source file is expected to reside in the specified command line arguments.
Note: When encountered in ‘clang_command_line_args’, the following options are ignored:
'-c'
'-emit-ast'
'-fsyntax-only'
'-o <output file>' (both '-o' and '<output file>' are ignored)
696 |
# File 'lib/ffi_gen/clang.rb', line 696 attach_function :create_translation_unit_from_source_file, :clang_createTranslationUnitFromSourceFile, [:pointer, :string, :int, :pointer, :uint, UnsavedFile], TranslationUnitImpl |
.cursor_get_translation_unit(cursor) ⇒ TranslationUnitImpl
Returns the translation unit that a cursor originated from.
1960 |
# File 'lib/ffi_gen/clang.rb', line 1960 attach_function :cursor_get_translation_unit, :clang_Cursor_getTranslationUnit, [Cursor.by_value], TranslationUnitImpl |
.cursor_is_null(cursor) ⇒ Integer
Returns non-zero if arg cursor is null.
1777 |
# File 'lib/ffi_gen/clang.rb', line 1777 attach_function :cursor_is_null, :clang_Cursor_isNull, [Cursor.by_value], :int |
.cx_cursor_set_contains(cset, cursor) ⇒ Integer
Queries a CXCursorSet to see if it contains a specific CXCursor.
1988 |
# File 'lib/ffi_gen/clang.rb', line 1988 attach_function :cx_cursor_set_contains, :clang_CXCursorSet_contains, [CursorSetImpl, Cursor.by_value], :uint |
.cx_cursor_set_insert(cset, cursor) ⇒ Integer
Inserts a CXCursor into a CXCursorSet.
1997 |
# File 'lib/ffi_gen/clang.rb', line 1997 attach_function :cx_cursor_set_insert, :clang_CXCursorSet_insert, [CursorSetImpl, Cursor.by_value], :uint |
.cxx_method_is_static(c) ⇒ Integer
Determine if a C++ member function or member function template is declared ‘static’.
2805 |
# File 'lib/ffi_gen/clang.rb', line 2805 attach_function :cxx_method_is_static, :clang_CXXMethod_isStatic, [Cursor.by_value], :uint |
.cxx_method_is_virtual(c) ⇒ Integer
Determine if a C++ member function or member function template is explicitly declared ‘virtual’ or if it overrides a virtual method from one of the base classes.
2815 |
# File 'lib/ffi_gen/clang.rb', line 2815 attach_function :cxx_method_is_virtual, :clang_CXXMethod_isVirtual, [Cursor.by_value], :uint |
.default_code_complete_options ⇒ Integer
Returns a default set of code-completion options that can be passed toc clang_codeCompleteAt().
3418 |
# File 'lib/ffi_gen/clang.rb', line 3418 attach_function :default_code_complete_options, :clang_defaultCodeCompleteOptions, [], :uint |
.default_diagnostic_display_options ⇒ Integer
Retrieve the set of display options most similar to the default behavior of the clang compiler.
534 |
# File 'lib/ffi_gen/clang.rb', line 534 attach_function :default_diagnostic_display_options, :clang_defaultDiagnosticDisplayOptions, [], :uint |
.default_editing_translation_unit_options ⇒ Integer
Returns the set of flags that is suitable for parsing a translation unit that is being edited.
The set of flags returned provide options for c clang_parseTranslationUnit() to indicate that the translation unit is likely to be reparsed many times, either explicitly (via c clang_reparseTranslationUnit()) or implicitly (e.g., by code completion (c clang_codeCompletionAt())). The returned flag set contains an unspecified set of optimizations (e.g., the precompiled preamble) geared toward improving the performance of these routines. The set of optimizations enabled may change from one version to the next.
805 |
# File 'lib/ffi_gen/clang.rb', line 805 attach_function :default_editing_translation_unit_options, :clang_defaultEditingTranslationUnitOptions, [], :uint |
.default_reparse_options(tu) ⇒ Integer
Returns the set of flags that is suitable for reparsing a translation unit.
The set of flags returned provide options for c clang_reparseTranslationUnit() by default. The returned flag set contains an unspecified set of optimizations geared toward common uses of reparsing. The set of optimizations enabled may change from one version to the next.
973 |
# File 'lib/ffi_gen/clang.rb', line 973 attach_function :default_reparse_options, :clang_defaultReparseOptions, [TranslationUnitImpl], :uint |
.default_save_options(tu) ⇒ Integer
Returns the set of flags that is suitable for saving a translation unit.
The set of flags returned provide options for c clang_saveTranslationUnit() by default. The returned flag set contains an unspecified set of options that save translation units with the most commonly-requested data.
875 |
# File 'lib/ffi_gen/clang.rb', line 875 attach_function :default_save_options, :clang_defaultSaveOptions, [TranslationUnitImpl], :uint |
.dispose_code_complete_results(results) ⇒ nil
Free the given set of code-completion results.
3499 |
# File 'lib/ffi_gen/clang.rb', line 3499 attach_function :dispose_code_complete_results, :clang_disposeCodeCompleteResults, [:pointer], :void |
.dispose_cx_cursor_set(cset) ⇒ nil
Disposes a CXCursorSet and releases its associated memory.
1979 |
# File 'lib/ffi_gen/clang.rb', line 1979 attach_function :dispose_cx_cursor_set, :clang_disposeCXCursorSet, [CursorSetImpl], :void |
.dispose_cxtu_resource_usage(usage) ⇒ nil
(Not documented)
1118 |
# File 'lib/ffi_gen/clang.rb', line 1118 attach_function :dispose_cxtu_resource_usage, :clang_disposeCXTUResourceUsage, [TUResourceUsage.by_value], :void |
.dispose_diagnostic(diagnostic) ⇒ nil
Destroy a diagnostic.
447 |
# File 'lib/ffi_gen/clang.rb', line 447 attach_function :dispose_diagnostic, :clang_disposeDiagnostic, [:pointer], :void |
.dispose_index(index) ⇒ nil
Destroy the given index.
The index must not be destroyed until all of the translation units created within that index have been destroyed.
147 |
# File 'lib/ffi_gen/clang.rb', line 147 attach_function :dispose_index, :clang_disposeIndex, [:pointer], :void |
.dispose_overridden_cursors(overridden) ⇒ nil
Free the set of overridden cursors returned by c clang_getOverriddenCursors().
2126 |
# File 'lib/ffi_gen/clang.rb', line 2126 attach_function :dispose_overridden_cursors, :clang_disposeOverriddenCursors, [:pointer], :void |
.dispose_string(string) ⇒ nil
Free the given string,
93 |
# File 'lib/ffi_gen/clang.rb', line 93 attach_function :dispose_string, :clang_disposeString, [String.by_value], :void |
.dispose_tokens(tu, tokens, num_tokens) ⇒ nil
Free the given set of tokens.
3044 |
# File 'lib/ffi_gen/clang.rb', line 3044 attach_function :dispose_tokens, :clang_disposeTokens, [TranslationUnitImpl, :pointer, :uint], :void |
.dispose_translation_unit(translation_unit_impl) ⇒ nil
Destroy the specified CXTranslationUnit object.
939 |
# File 'lib/ffi_gen/clang.rb', line 939 attach_function :dispose_translation_unit, :clang_disposeTranslationUnit, [TranslationUnitImpl], :void |
.enable_stack_traces ⇒ nil
(Not documented)
3073 |
# File 'lib/ffi_gen/clang.rb', line 3073 attach_function :enable_stack_traces, :clang_enableStackTraces, [], :void |
.equal_cursors(cursor, cursor) ⇒ Integer
Determine whether two cursors are equivalent.
1769 |
# File 'lib/ffi_gen/clang.rb', line 1769 attach_function :equal_cursors, :clang_equalCursors, [Cursor.by_value, Cursor.by_value], :uint |
.equal_locations(loc1, loc2) ⇒ Integer
Determine whether two source locations, which must refer into the same translation unit, refer to exactly the same point in the source code.
237 |
# File 'lib/ffi_gen/clang.rb', line 237 attach_function :equal_locations, :clang_equalLocations, [SourceLocation.by_value, SourceLocation.by_value], :uint |
.equal_ranges(range1, range2) ⇒ Integer
Determine whether two ranges are equivalent.
286 |
# File 'lib/ffi_gen/clang.rb', line 286 attach_function :equal_ranges, :clang_equalRanges, [SourceRange.by_value, SourceRange.by_value], :uint |
.equal_types(a, b) ⇒ Integer
Determine whether two CXTypes represent the same type.
2357 |
# File 'lib/ffi_gen/clang.rb', line 2357 attach_function :equal_types, :clang_equalTypes, [Type.by_value, Type.by_value], :uint |
.execute_on_thread(fn, user_data, stack_size) ⇒ nil
(Not documented)
3083 |
# File 'lib/ffi_gen/clang.rb', line 3083 attach_function :execute_on_thread, :clang_executeOnThread, [:pointer, :pointer, :uint], :void |
.find_references_in_file(cursor, file, visitor) ⇒ nil
Find references of a declaration in a specific file.
3706 |
# File 'lib/ffi_gen/clang.rb', line 3706 attach_function :find_references_in_file, :clang_findReferencesInFile, [Cursor.by_value, :pointer, CursorAndRangeVisitor.by_value], :void |
.format_diagnostic(diagnostic, options) ⇒ String
Format the given diagnostic in a manner that is suitable for display.
This routine will format the given diagnostic to a string, rendering the diagnostic according to the various options given. The c clang_defaultDiagnosticDisplayOptions() function returns the set of options that most closely mimics the behavior of the clang compiler.
525 |
# File 'lib/ffi_gen/clang.rb', line 525 attach_function :format_diagnostic, :clang_formatDiagnostic, [:pointer, :uint], String.by_value |
.get_array_element_type(t) ⇒ Type
Return the element type of an array type.
If a non-array type is passed in, an invalid type is returned.
2465 |
# File 'lib/ffi_gen/clang.rb', line 2465 attach_function :get_array_element_type, :clang_getArrayElementType, [Type.by_value], Type.by_value |
.get_array_size(t) ⇒ Integer
Return the the array size of a constant array.
If a non-array type is passed in, -1 is returned.
2475 |
# File 'lib/ffi_gen/clang.rb', line 2475 attach_function :get_array_size, :clang_getArraySize, [Type.by_value], :long_long |
.get_c_string(string) ⇒ String
Retrieve the character data associated with the given string.
85 |
# File 'lib/ffi_gen/clang.rb', line 85 attach_function :get_c_string, :clang_getCString, [String.by_value], :string |
.get_canonical_cursor(cursor) ⇒ Cursor
Retrieve the canonical cursor corresponding to the given cursor.
In the C family of languages, many kinds of entities can be declared several times within a single translation unit. For example, a structure type can be forward-declared (possibly multiple times) and later defined:
code struct X; struct X; struct X
int member;
; endcode
The declarations and the definition of c X are represented by three different cursors, all of which are declarations of the same underlying entity. One of these cursor is considered the “canonical” cursor, which is effectively the representative for the underlying entity. One can determine if two cursors are declarations of the same underlying entity by comparing their canonical cursors.
2796 |
# File 'lib/ffi_gen/clang.rb', line 2796 attach_function :get_canonical_cursor, :clang_getCanonicalCursor, [Cursor.by_value], Cursor.by_value |
.get_canonical_type(t) ⇒ Type
Return the canonical type for a CXType.
Clang’s type system explicitly models typedefs and all the ways a specific type can be represented. The canonical type is the underlying type with all the “sugar” removed. For example, if ‘T’ is a typedef for ‘int’, the canonical type for ‘T’ would be ‘int’.
2370 |
# File 'lib/ffi_gen/clang.rb', line 2370 attach_function :get_canonical_type, :clang_getCanonicalType, [Type.by_value], Type.by_value |
.get_clang_version ⇒ String
Return a version string, suitable for showing to a user, but not
intended to be parsed (the format is not guaranteed to be stable).
3577 |
# File 'lib/ffi_gen/clang.rb', line 3577 attach_function :get_clang_version, :clang_getClangVersion, [], String.by_value |
.get_completion_annotation(completion_string, annotation_number) ⇒ String
Retrieve the annotation associated with the given completion string.
3340 |
# File 'lib/ffi_gen/clang.rb', line 3340 attach_function :get_completion_annotation, :clang_getCompletionAnnotation, [:pointer, :uint], String.by_value |
.get_completion_availability(completion_string) ⇒ Symbol from _enum_availability_kind_
Determine the availability of the entity that this code-completion string refers to.
3319 |
# File 'lib/ffi_gen/clang.rb', line 3319 attach_function :get_completion_availability, :clang_getCompletionAvailability, [:pointer], :availability_kind |
.get_completion_chunk_completion_string(completion_string, chunk_number) ⇒ FFI::Pointer(CompletionString)
Retrieve the completion string associated with a particular chunk within a completion string.
3289 |
# File 'lib/ffi_gen/clang.rb', line 3289 attach_function :get_completion_chunk_completion_string, :clang_getCompletionChunkCompletionString, [:pointer, :uint], :pointer |
.get_completion_chunk_kind(completion_string, chunk_number) ⇒ Symbol from _enum_completion_chunk_kind_
Determine the kind of a particular chunk within a completion string.
3268 |
# File 'lib/ffi_gen/clang.rb', line 3268 attach_function :get_completion_chunk_kind, :clang_getCompletionChunkKind, [:pointer, :uint], :completion_chunk_kind |
.get_completion_chunk_text(completion_string, chunk_number) ⇒ String
Retrieve the text associated with a particular chunk within a completion string.
3278 |
# File 'lib/ffi_gen/clang.rb', line 3278 attach_function :get_completion_chunk_text, :clang_getCompletionChunkText, [:pointer, :uint], String.by_value |
.get_completion_num_annotations(completion_string) ⇒ Integer
Retrieve the number of annotations associated with the given completion string.
3329 |
# File 'lib/ffi_gen/clang.rb', line 3329 attach_function :get_completion_num_annotations, :clang_getCompletionNumAnnotations, [:pointer], :uint |
.get_completion_priority(completion_string) ⇒ Integer
Determine the priority of this code completion.
The priority of a code completion indicates how likely it is that this particular completion is the completion that the user will select. The priority is selected by various internal heuristics.
3310 |
# File 'lib/ffi_gen/clang.rb', line 3310 attach_function :get_completion_priority, :clang_getCompletionPriority, [:pointer], :uint |
.get_cursor(translation_unit_impl, source_location) ⇒ Cursor
Map a source location to the cursor that describes the entity at that location in the source code.
clang_getCursor() maps an arbitrary source location within a translation unit down to the most specific cursor that describes the entity at that location. For example, given an expression c x + y, invoking clang_getCursor() with a source location pointing to “x” will return the cursor for “x”; similarly for “y”. If the cursor points anywhere between “x” or “y” (e.g., on the + or the whitespace around it), clang_getCursor() will return a cursor referring to the “+” expression.
2154 |
# File 'lib/ffi_gen/clang.rb', line 2154 attach_function :get_cursor, :clang_getCursor, [TranslationUnitImpl, SourceLocation.by_value], Cursor.by_value |
.get_cursor_availability(cursor) ⇒ Symbol from _enum_availability_kind_
Determine the availability of the entity that this cursor refers to.
1920 |
# File 'lib/ffi_gen/clang.rb', line 1920 attach_function :get_cursor_availability, :clang_getCursorAvailability, [Cursor.by_value], :availability_kind |
.get_cursor_completion_string(cursor) ⇒ FFI::Pointer(CompletionString)
Retrieve a completion string for an arbitrary declaration or macro definition cursor.
3350 |
# File 'lib/ffi_gen/clang.rb', line 3350 attach_function :get_cursor_completion_string, :clang_getCursorCompletionString, [Cursor.by_value], :pointer |
.get_cursor_definition(cursor) ⇒ Cursor
For a cursor that is either a reference to or a declaration
of some entity, retrieve a cursor that describes the definition of
that entity.
Some entities can be declared multiple times within a translation
unit, but only one of those declarations can also be a
definition. For example, given:
\code
int f(int, int);
int g(int x, int y) { return f(x, y); }
int f(int a, int b) { return a + b; }
int f(int, int);
\endcode
there are three declarations of the function "f", but only the
second one is a definition. The clang_getCursorDefinition()
function will take any cursor pointing to a declaration of "f"
(the first or fourth lines of the example) or a cursor referenced
that uses "f" (the call to "f' inside "g") and will return a
declaration cursor pointing to the definition (the second "f"
declaration).
If given a cursor for which there is no corresponding definition,
e.g., because there is no definition of that entity within this
translation unit, returns a NULL cursor.
2760 |
# File 'lib/ffi_gen/clang.rb', line 2760 attach_function :get_cursor_definition, :clang_getCursorDefinition, [Cursor.by_value], Cursor.by_value |
.get_cursor_display_name(cursor) ⇒ String
Retrieve the display name for the entity referenced by this cursor.
The display name contains extra information that helps identify the cursor, such as the parameters of a function or template or the arguments of a class template specialization.
2711 |
# File 'lib/ffi_gen/clang.rb', line 2711 attach_function :get_cursor_display_name, :clang_getCursorDisplayName, [Cursor.by_value], String.by_value |
.get_cursor_extent(cursor) ⇒ SourceRange
Retrieve the physical extent of the source construct referenced by the given cursor.
The extent of a cursor starts with the file/line/column pointing at the first character within the source construct that the cursor refers to and ends with the last character withinin that source construct. For a declaration, the extent covers the declaration itself. For a reference, the extent covers the location of the reference (e.g., where the referenced entity was actually used).
2185 |
# File 'lib/ffi_gen/clang.rb', line 2185 attach_function :get_cursor_extent, :clang_getCursorExtent, [Cursor.by_value], SourceRange.by_value |
.get_cursor_kind(cursor) ⇒ Symbol from _enum_cursor_kind_
Retrieve the kind of the given cursor.
1793 |
# File 'lib/ffi_gen/clang.rb', line 1793 attach_function :get_cursor_kind, :clang_getCursorKind, [Cursor.by_value], :cursor_kind |
.get_cursor_kind_spelling(kind) ⇒ String
for debug/testing
3052 |
# File 'lib/ffi_gen/clang.rb', line 3052 attach_function :get_cursor_kind_spelling, :clang_getCursorKindSpelling, [:cursor_kind], String.by_value |
.get_cursor_language(cursor) ⇒ Symbol from _enum_language_kind_
Determine the “language” of the entity referred to by a given cursor.
1952 |
# File 'lib/ffi_gen/clang.rb', line 1952 attach_function :get_cursor_language, :clang_getCursorLanguage, [Cursor.by_value], :language_kind |
.get_cursor_lexical_parent(cursor) ⇒ Cursor
Determine the lexical parent of the given cursor.
The lexical parent of a cursor is the cursor in which the given p cursor was actually written. For many declarations, the lexical and semantic parents are equivalent (the semantic parent is returned by c clang_getCursorSemanticParent()). They diverge when declarations or definitions are provided out-of-line. For example:
code class C
void f();
;
void C::f() { } endcode
In the out-of-line definition of c C::f, the semantic parent is the the class c C, of which this function is a member. The lexical parent is the place where the declaration actually occurs in the source code; in this case, the definition occurs in the translation unit. In general, the lexical parent for a given entity can change without affecting the semantics of the program, and the lexical parent of different declarations of the same entity may be different. Changing the semantic parent of a declaration, on the other hand, can have a major impact on semantics, and redeclarations of a particular entity should all have the same semantic context.
In the example above, both declarations of c C::f have c C as their semantic context, while the lexical context of the first c C::f is c C and the lexical context of the second c C::f is the translation unit.
For declarations written in the global scope, the lexical parent is the translation unit.
2074 |
# File 'lib/ffi_gen/clang.rb', line 2074 attach_function :get_cursor_lexical_parent, :clang_getCursorLexicalParent, [Cursor.by_value], Cursor.by_value |
.get_cursor_linkage(cursor) ⇒ Symbol from _enum_linkage_kind_
Determine the linkage of the entity referred to by a given cursor.
1912 |
# File 'lib/ffi_gen/clang.rb', line 1912 attach_function :get_cursor_linkage, :clang_getCursorLinkage, [Cursor.by_value], :linkage_kind |
.get_cursor_location(cursor) ⇒ SourceLocation
Retrieve the physical location of the source constructor referenced by the given cursor.
The location of a declaration is typically the location of the name of that declaration, where the name of that declaration would occur if it is unnamed, or some keyword that introduces that particular declaration. The location of a reference is where that reference occurs within the source code.
2169 |
# File 'lib/ffi_gen/clang.rb', line 2169 attach_function :get_cursor_location, :clang_getCursorLocation, [Cursor.by_value], SourceLocation.by_value |
.get_cursor_reference_name_range(c, name_flags, piece_index) ⇒ SourceRange
Given a cursor that references something else, return the source range covering that reference.
2881 |
# File 'lib/ffi_gen/clang.rb', line 2881 attach_function :get_cursor_reference_name_range, :clang_getCursorReferenceNameRange, [Cursor.by_value, :uint, :uint], SourceRange.by_value |
.get_cursor_referenced(cursor) ⇒ Cursor
For a cursor that is a reference, retrieve a cursor representing the entity that it references.
Reference cursors refer to other entities in the AST. For example, an Objective-C superclass reference cursor refers to an Objective-C class. This function produces the cursor for the Objective-C class from the cursor for the superclass reference. If the input cursor is a declaration or definition, it returns that declaration or definition unchanged. Otherwise, returns the NULL cursor.
2727 |
# File 'lib/ffi_gen/clang.rb', line 2727 attach_function :get_cursor_referenced, :clang_getCursorReferenced, [Cursor.by_value], Cursor.by_value |
.get_cursor_result_type(c) ⇒ Type
Retrieve the result type associated with a given cursor. This only
returns a valid type of the cursor refers to a function or method.
2446 |
# File 'lib/ffi_gen/clang.rb', line 2446 attach_function :get_cursor_result_type, :clang_getCursorResultType, [Cursor.by_value], Type.by_value |
.get_cursor_semantic_parent(cursor) ⇒ Cursor
Determine the semantic parent of the given cursor.
The semantic parent of a cursor is the cursor that semantically contains the given p cursor. For many declarations, the lexical and semantic parents are equivalent (the lexical parent is returned by c clang_getCursorLexicalParent()). They diverge when declarations or definitions are provided out-of-line. For example:
code class C
void f();
;
void C::f() { } endcode
In the out-of-line definition of c C::f, the semantic parent is the the class c C, of which this function is a member. The lexical parent is the place where the declaration actually occurs in the source code; in this case, the definition occurs in the translation unit. In general, the lexical parent for a given entity can change without affecting the semantics of the program, and the lexical parent of different declarations of the same entity may be different. Changing the semantic parent of a declaration, on the other hand, can have a major impact on semantics, and redeclarations of a particular entity should all have the same semantic context.
In the example above, both declarations of c C::f have c C as their semantic context, while the lexical context of the first c C::f is c C and the lexical context of the second c C::f is the translation unit.
For global declarations, the semantic parent is the translation unit.
2035 |
# File 'lib/ffi_gen/clang.rb', line 2035 attach_function :get_cursor_semantic_parent, :clang_getCursorSemanticParent, [Cursor.by_value], Cursor.by_value |
.get_cursor_spelling(cursor) ⇒ String
Retrieve a name for the entity referenced by this cursor.
2699 |
# File 'lib/ffi_gen/clang.rb', line 2699 attach_function :get_cursor_spelling, :clang_getCursorSpelling, [Cursor.by_value], String.by_value |
.get_cursor_type(c) ⇒ Type
Retrieve the type of a CXCursor (if any).
2347 |
# File 'lib/ffi_gen/clang.rb', line 2347 attach_function :get_cursor_type, :clang_getCursorType, [Cursor.by_value], Type.by_value |
.get_cursor_usr(cursor) ⇒ String
Retrieve a Unified Symbol Resolution (USR) for the entity referenced by the given cursor.
A Unified Symbol Resolution (USR) is a string that identifies a particular entity (function, class, variable, etc.) within a program. USRs can be compared across translation units to determine, e.g., when references in one translation refer to an entity defined in another translation unit.
2635 |
# File 'lib/ffi_gen/clang.rb', line 2635 attach_function :get_cursor_usr, :clang_getCursorUSR, [Cursor.by_value], String.by_value |
.get_cxtu_resource_usage(tu) ⇒ TUResourceUsage
Return the memory usage of a translation unit. This object
should be released with clang_disposeCXTUResourceUsage().
1110 |
# File 'lib/ffi_gen/clang.rb', line 1110 attach_function :get_cxtu_resource_usage, :clang_getCXTUResourceUsage, [TranslationUnitImpl], TUResourceUsage.by_value |
.get_cxx_access_specifier(cursor) ⇒ Symbol from _enum_cxx_access_specifier_
Returns the access control level for the C++ base specifier represented by a cursor with kind CXCursor_CXXBaseSpecifier or CXCursor_AccessSpecifier.
2519 |
# File 'lib/ffi_gen/clang.rb', line 2519 attach_function :get_cxx_access_specifier, :clang_getCXXAccessSpecifier, [Cursor.by_value], :cxx_access_specifier |
.get_decl_obj_c_type_encoding(c) ⇒ String
Returns the Objective-C type encoding for the specified declaration.
2421 |
# File 'lib/ffi_gen/clang.rb', line 2421 attach_function :get_decl_obj_c_type_encoding, :clang_getDeclObjCTypeEncoding, [Cursor.by_value], String.by_value |
.get_definition_spelling_and_extent(cursor, start_buf, end_buf, start_line, start_column, end_line, end_column) ⇒ nil
(Not documented)
3066 |
# File 'lib/ffi_gen/clang.rb', line 3066 attach_function :get_definition_spelling_and_extent, :clang_getDefinitionSpellingAndExtent, [Cursor.by_value, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :void |
.get_diagnostic(unit, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given translation unit.
439 |
# File 'lib/ffi_gen/clang.rb', line 439 attach_function :get_diagnostic, :clang_getDiagnostic, [TranslationUnitImpl, :uint], :pointer |
.get_diagnostic_category(diagnostic) ⇒ Integer
Retrieve the category number for this diagnostic.
Diagnostics can be categorized into groups along with other, related diagnostics (e.g., diagnostics under the same warning flag). This routine retrieves the category number for the given diagnostic.
586 |
# File 'lib/ffi_gen/clang.rb', line 586 attach_function :get_diagnostic_category, :clang_getDiagnosticCategory, [:pointer], :uint |
.get_diagnostic_category_name(category) ⇒ String
Retrieve the name of a particular diagnostic category.
595 |
# File 'lib/ffi_gen/clang.rb', line 595 attach_function :get_diagnostic_category_name, :clang_getDiagnosticCategoryName, [:uint], String.by_value |
.get_diagnostic_fix_it(diagnostic, fix_it, replacement_range) ⇒ String
Retrieve the replacement information for a given fix-it.
Fix-its are described in terms of a source range whose contents should be replaced by a string. This approach generalizes over three kinds of operations: removal of source code (the range covers the code to be removed and the replacement string is empty), replacement of source code (the range covers the code to be replaced and the replacement string provides the new code), and insertion (both the start and end of the range point at the insertion location, and the replacement string provides the text to insert).
650 |
# File 'lib/ffi_gen/clang.rb', line 650 attach_function :get_diagnostic_fix_it, :clang_getDiagnosticFixIt, [:pointer, :uint, :pointer], String.by_value |
.get_diagnostic_location(diagnostic) ⇒ SourceLocation
Retrieve the source location of the given diagnostic.
This location is where Clang would print the caret (‘^’) when displaying the diagnostic on the command line.
553 |
# File 'lib/ffi_gen/clang.rb', line 553 attach_function :get_diagnostic_location, :clang_getDiagnosticLocation, [:pointer], SourceLocation.by_value |
.get_diagnostic_num_fix_its(diagnostic) ⇒ Integer
Determine the number of fix-it hints associated with the given diagnostic.
626 |
# File 'lib/ffi_gen/clang.rb', line 626 attach_function :get_diagnostic_num_fix_its, :clang_getDiagnosticNumFixIts, [:pointer], :uint |
.get_diagnostic_num_ranges(diagnostic) ⇒ Integer
Determine the number of source ranges associated with the given diagnostic.
604 |
# File 'lib/ffi_gen/clang.rb', line 604 attach_function :get_diagnostic_num_ranges, :clang_getDiagnosticNumRanges, [:pointer], :uint |
.get_diagnostic_option(diag, disable) ⇒ String
Retrieve the name of the command-line option that enabled this diagnostic.
573 |
# File 'lib/ffi_gen/clang.rb', line 573 attach_function :get_diagnostic_option, :clang_getDiagnosticOption, [:pointer, :pointer], String.by_value |
.get_diagnostic_range(diagnostic, range) ⇒ SourceRange
Retrieve a source range associated with the diagnostic.
A diagnostic’s source ranges highlight important elements in the source code. On the command line, Clang displays source ranges by underlining them with ‘~’ characters.
617 |
# File 'lib/ffi_gen/clang.rb', line 617 attach_function :get_diagnostic_range, :clang_getDiagnosticRange, [:pointer, :uint], SourceRange.by_value |
.get_diagnostic_severity(diagnostic) ⇒ Symbol from _enum_diagnostic_severity_
Determine the severity of the given diagnostic.
542 |
# File 'lib/ffi_gen/clang.rb', line 542 attach_function :get_diagnostic_severity, :clang_getDiagnosticSeverity, [:pointer], :diagnostic_severity |
.get_diagnostic_spelling(diagnostic) ⇒ String
Retrieve the text of the given diagnostic.
561 |
# File 'lib/ffi_gen/clang.rb', line 561 attach_function :get_diagnostic_spelling, :clang_getDiagnosticSpelling, [:pointer], String.by_value |
.get_file(tu, file_name) ⇒ FFI::Pointer(File)
Retrieve a file handle within the given translation unit.
184 |
# File 'lib/ffi_gen/clang.rb', line 184 attach_function :get_file, :clang_getFile, [TranslationUnitImpl, :string], :pointer |
.get_file_name(s_file) ⇒ String
Retrieve the complete file and path name of the given file.
155 |
# File 'lib/ffi_gen/clang.rb', line 155 attach_function :get_file_name, :clang_getFileName, [:pointer], String.by_value |
.get_file_time(s_file) ⇒ Integer
Retrieve the last modification time of the given file.
163 |
# File 'lib/ffi_gen/clang.rb', line 163 attach_function :get_file_time, :clang_getFileTime, [:pointer], :long |
.get_ib_outlet_collection_type(cursor) ⇒ Type
For cursors representing an iboutletcollection attribute,
this function returns the collection element type.
2552 |
# File 'lib/ffi_gen/clang.rb', line 2552 attach_function :get_ib_outlet_collection_type, :clang_getIBOutletCollectionType, [Cursor.by_value], Type.by_value |
.get_included_file(cursor) ⇒ FFI::Pointer(File)
Retrieve the file that is included by the given inclusion directive cursor.
2135 |
# File 'lib/ffi_gen/clang.rb', line 2135 attach_function :get_included_file, :clang_getIncludedFile, [Cursor.by_value], :pointer |
.get_inclusions(tu, visitor, client_data) ⇒ nil
Visit the set of preprocessor inclusions in a translation unit.
The visitor function is called with the provided data for every included
file. This does not include headers included by the PCH file (unless one
is inspecting the inclusions in the PCH file itself).
3622 |
# File 'lib/ffi_gen/clang.rb', line 3622 attach_function :get_inclusions, :clang_getInclusions, [TranslationUnitImpl, :inclusion_visitor, :pointer], :void |
.get_instantiation_location(location, file, line, column, offset) ⇒ nil
Legacy API to retrieve the file, line, column, and offset represented by the given source location.
This interface has been replaced by the newer interface see clang_getExpansionLocation(). See that interface’s documentation for details.
349 |
# File 'lib/ffi_gen/clang.rb', line 349 attach_function :get_instantiation_location, :clang_getInstantiationLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void |
.get_location(tu, file, line, column) ⇒ SourceLocation
Retrieves the source location associated with a given file/line/column in a particular translation unit.
249 |
# File 'lib/ffi_gen/clang.rb', line 249 attach_function :get_location, :clang_getLocation, [TranslationUnitImpl, :pointer, :uint, :uint], SourceLocation.by_value |
.get_location_for_offset(tu, file, offset) ⇒ SourceLocation
Retrieves the source location associated with a given character offset in a particular translation unit.
260 |
# File 'lib/ffi_gen/clang.rb', line 260 attach_function :get_location_for_offset, :clang_getLocationForOffset, [TranslationUnitImpl, :pointer, :uint], SourceLocation.by_value |
.get_null_cursor ⇒ Cursor
Retrieve the NULL cursor, which represents no entity.
1749 |
# File 'lib/ffi_gen/clang.rb', line 1749 attach_function :get_null_cursor, :clang_getNullCursor, [], Cursor.by_value |
.get_null_location ⇒ SourceLocation
Retrieve a NULL (invalid) source location.
225 |
# File 'lib/ffi_gen/clang.rb', line 225 attach_function :get_null_location, :clang_getNullLocation, [], SourceLocation.by_value |
.get_null_range ⇒ SourceRange
Retrieve a NULL (invalid) source range.
267 |
# File 'lib/ffi_gen/clang.rb', line 267 attach_function :get_null_range, :clang_getNullRange, [], SourceRange.by_value |
.get_num_completion_chunks(completion_string) ⇒ Integer
Retrieve the number of chunks in the given code-completion string.
3297 |
# File 'lib/ffi_gen/clang.rb', line 3297 attach_function :get_num_completion_chunks, :clang_getNumCompletionChunks, [:pointer], :uint |
.get_num_diagnostics(unit) ⇒ Integer
Determine the number of diagnostics produced for the given translation unit.
429 |
# File 'lib/ffi_gen/clang.rb', line 429 attach_function :get_num_diagnostics, :clang_getNumDiagnostics, [TranslationUnitImpl], :uint |
.get_num_overloaded_decls(cursor) ⇒ Integer
Determine the number of overloaded declarations referenced by a c CXCursor_OverloadedDeclRef cursor.
2529 |
# File 'lib/ffi_gen/clang.rb', line 2529 attach_function :get_num_overloaded_decls, :clang_getNumOverloadedDecls, [Cursor.by_value], :uint |
.get_overloaded_decl(cursor, index) ⇒ Cursor
Retrieve a cursor for one of the overloaded declarations referenced by a c CXCursor_OverloadedDeclRef cursor.
2543 |
# File 'lib/ffi_gen/clang.rb', line 2543 attach_function :get_overloaded_decl, :clang_getOverloadedDecl, [Cursor.by_value, :uint], Cursor.by_value |
.get_overridden_cursors(cursor, overridden, num_overridden) ⇒ nil
Determine the set of methods that are overridden by the given method.
In both Objective-C and C++, a method (aka virtual member function, in C++) can override a virtual method in a base class. For Objective-C, a method is said to override any method in the class’s interface (if we’re coming from an implementation), its protocols, or its categories, that has the same selector and is of the same kind (class or instance). If no such method exists, the search continues to the class’s superclass, its protocols, and its categories, and so on.
For C++, a virtual member function overrides any virtual member function with the same signature that occurs in its base classes. With multiple inheritance, a virtual member function can override several virtual member functions coming from different base classes.
In all cases, this function determines the immediate overridden method, rather than all of the overridden methods. For example, if a method is originally declared in a class A, then overridden in B (which in inherits from A) and also in C (which inherited from B), then the only overridden method returned from this function when invoked on C’s method will be B’s method. The client may then invoke this function again, given the previously-found overridden methods, to map out the complete method-override set.
2117 |
# File 'lib/ffi_gen/clang.rb', line 2117 attach_function :get_overridden_cursors, :clang_getOverriddenCursors, [Cursor.by_value, :pointer, :pointer], :void |
.get_pointee_type(t) ⇒ Type
For pointer types, returns the type of the pointee.
2405 |
# File 'lib/ffi_gen/clang.rb', line 2405 attach_function :get_pointee_type, :clang_getPointeeType, [Type.by_value], Type.by_value |
.get_presumed_location(location, filename, line, column) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location, as specified in a # line directive.
Example: given the following source code in a file somefile.c
#123 “dummy.c” 1
static int func(void)
return 0;
the location information returned by this function would be
File: dummy.c Line: 124 Column: 12
whereas clang_getExpansionLocation would have returned
File: somefile.c Line: 3 Column: 12
332 |
# File 'lib/ffi_gen/clang.rb', line 332 attach_function :get_presumed_location, :clang_getPresumedLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer], :void |
.get_range ⇒ SourceRange
Retrieve a source range given the beginning and ending source locations.
277 |
# File 'lib/ffi_gen/clang.rb', line 277 attach_function :get_range, :clang_getRange, [SourceLocation.by_value, SourceLocation.by_value], SourceRange.by_value |
.get_range_end(range) ⇒ SourceLocation
Retrieve a source location representing the last character within a source range.
388 |
# File 'lib/ffi_gen/clang.rb', line 388 attach_function :get_range_end, :clang_getRangeEnd, [SourceRange.by_value], SourceLocation.by_value |
.get_range_start(range) ⇒ SourceLocation
Retrieve a source location representing the first character within a source range.
379 |
# File 'lib/ffi_gen/clang.rb', line 379 attach_function :get_range_start, :clang_getRangeStart, [SourceRange.by_value], SourceLocation.by_value |
.get_remappings(path) ⇒ FFI::Pointer(Remapping)
Retrieve a remapping.
3631 |
# File 'lib/ffi_gen/clang.rb', line 3631 attach_function :get_remappings, :clang_getRemappings, [:string], :pointer |
.get_result_type(t) ⇒ Type
Retrieve the result type associated with a function type.
2437 |
# File 'lib/ffi_gen/clang.rb', line 2437 attach_function :get_result_type, :clang_getResultType, [Type.by_value], Type.by_value |
.get_specialized_cursor_template(c) ⇒ Cursor
Given a cursor that may represent a specialization or instantiation of a template, retrieve the cursor that represents the template that it specializes or from which it was instantiated.
This routine determines the template involved both for explicit specializations of templates and for implicit instantiations of the template, both of which are referred to as “specializations”. For a class template specialization (e.g., c std::vector<bool>), this routine will return either the primary template (c std::vector) or, if the specialization was instantiated from a class template partial specialization, the class template partial specialization. For a class template partial specialization and a function template specialization (including instantiations), this this routine will return the specialized template.
For members of a class template (e.g., member functions, member classes, or static data members), returns the specialized or instantiated member. Although not strictly “templates” in the C++ language, members of class templates have the same notions of specializations and instantiations that templates do, so this routine treats them similarly.
2862 |
# File 'lib/ffi_gen/clang.rb', line 2862 attach_function :get_specialized_cursor_template, :clang_getSpecializedCursorTemplate, [Cursor.by_value], Cursor.by_value |
.get_spelling_location(location, file, line, column, offset) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location.
If the location refers into a macro instantiation, return where the location was originally spelled in the source file.
370 |
# File 'lib/ffi_gen/clang.rb', line 370 attach_function :get_spelling_location, :clang_getSpellingLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void |
.get_template_cursor_kind(c) ⇒ Symbol from _enum_cursor_kind_
Given a cursor that represents a template, determine the cursor kind of the specializations would be generated by instantiating the template.
This routine can be used to determine what flavor of function template, class template, or class template partial specialization is stored in the cursor. For example, it can describe whether a class template cursor is declared with “struct”, “class” or “union”.
2833 |
# File 'lib/ffi_gen/clang.rb', line 2833 attach_function :get_template_cursor_kind, :clang_getTemplateCursorKind, [Cursor.by_value], :cursor_kind |
.get_token_extent(translation_unit_impl, token) ⇒ SourceRange
Retrieve a source range that covers the given token.
2988 |
# File 'lib/ffi_gen/clang.rb', line 2988 attach_function :get_token_extent, :clang_getTokenExtent, [TranslationUnitImpl, Token.by_value], SourceRange.by_value |
.get_token_kind(token) ⇒ Symbol from _enum_token_kind_
Determine the kind of the given token.
2958 |
# File 'lib/ffi_gen/clang.rb', line 2958 attach_function :get_token_kind, :clang_getTokenKind, [Token.by_value], :token_kind |
.get_token_location(translation_unit_impl, token) ⇒ SourceLocation
Retrieve the source location of the given token.
2979 |
# File 'lib/ffi_gen/clang.rb', line 2979 attach_function :get_token_location, :clang_getTokenLocation, [TranslationUnitImpl, Token.by_value], SourceLocation.by_value |
.get_token_spelling(translation_unit_impl, token) ⇒ String
Determine the spelling of the given token.
The spelling of a token is the textual representation of that token, e.g., the text of an identifier or keyword.
2970 |
# File 'lib/ffi_gen/clang.rb', line 2970 attach_function :get_token_spelling, :clang_getTokenSpelling, [TranslationUnitImpl, Token.by_value], String.by_value |
.get_translation_unit_cursor(translation_unit_impl) ⇒ Cursor
Retrieve the cursor that represents the given translation unit.
The translation unit cursor can be used to start traversing the various declarations within the given translation unit.
1760 |
# File 'lib/ffi_gen/clang.rb', line 1760 attach_function :get_translation_unit_cursor, :clang_getTranslationUnitCursor, [TranslationUnitImpl], Cursor.by_value |
.get_translation_unit_spelling(ct_unit) ⇒ String
Get the original translation unit source file name.
658 |
# File 'lib/ffi_gen/clang.rb', line 658 attach_function :get_translation_unit_spelling, :clang_getTranslationUnitSpelling, [TranslationUnitImpl], String.by_value |
.get_tu_resource_usage_name(kind) ⇒ String
Returns the human-readable null-terminated C string that represents
the name of the memory category. This string should never be freed.
1072 |
# File 'lib/ffi_gen/clang.rb', line 1072 attach_function :get_tu_resource_usage_name, :clang_getTUResourceUsageName, [:tu_resource_usage_kind], :string |
.get_type_declaration(t) ⇒ Cursor
Return the cursor for the declaration of the given type.
2413 |
# File 'lib/ffi_gen/clang.rb', line 2413 attach_function :get_type_declaration, :clang_getTypeDeclaration, [Type.by_value], Cursor.by_value |
.get_type_kind_spelling(k) ⇒ String
Retrieve the spelling of a given CXTypeKind.
2429 |
# File 'lib/ffi_gen/clang.rb', line 2429 attach_function :get_type_kind_spelling, :clang_getTypeKindSpelling, [:type_kind], String.by_value |
.hash_cursor(cursor) ⇒ Integer
Compute a hash value for the given cursor.
1785 |
# File 'lib/ffi_gen/clang.rb', line 1785 attach_function :hash_cursor, :clang_hashCursor, [Cursor.by_value], :uint |
.is_attribute(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an attribute.
1838 |
# File 'lib/ffi_gen/clang.rb', line 1838 attach_function :is_attribute, :clang_isAttribute, [:cursor_kind], :uint |
.is_const_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “const” qualifier set,
without looking through typedefs that may have added "const" at a different level.
2379 |
# File 'lib/ffi_gen/clang.rb', line 2379 attach_function :is_const_qualified_type, :clang_isConstQualifiedType, [Type.by_value], :uint |
.is_cursor_definition(cursor) ⇒ Integer
Determine whether the declaration pointed to by this cursor is also a definition of that entity.
2769 |
# File 'lib/ffi_gen/clang.rb', line 2769 attach_function :is_cursor_definition, :clang_isCursorDefinition, [Cursor.by_value], :uint |
.is_declaration(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a declaration.
1801 |
# File 'lib/ffi_gen/clang.rb', line 1801 attach_function :is_declaration, :clang_isDeclaration, [:cursor_kind], :uint |
.is_expression(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an expression.
1822 |
# File 'lib/ffi_gen/clang.rb', line 1822 attach_function :is_expression, :clang_isExpression, [:cursor_kind], :uint |
.is_file_multiple_include_guarded(tu, file) ⇒ Integer
Determine whether the given header is guarded against multiple inclusions, either with the conventional #ifndef/#define/#endif macro guards or with #pragma once.
174 |
# File 'lib/ffi_gen/clang.rb', line 174 attach_function :is_file_multiple_include_guarded, :clang_isFileMultipleIncludeGuarded, [TranslationUnitImpl, :pointer], :uint |
.is_invalid(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an invalid cursor.
1847 |
# File 'lib/ffi_gen/clang.rb', line 1847 attach_function :is_invalid, :clang_isInvalid, [:cursor_kind], :uint |
.is_pod_type(t) ⇒ Integer
Return 1 if the CXType is a POD (plain old data) type, and 0
otherwise.
2455 |
# File 'lib/ffi_gen/clang.rb', line 2455 attach_function :is_pod_type, :clang_isPODType, [Type.by_value], :uint |
.is_preprocessing(cursor_kind) ⇒ Integer
Determine whether the given cursor represents a preprocessing element, such as a preprocessor directive or macro instantiation.
1865 |
# File 'lib/ffi_gen/clang.rb', line 1865 attach_function :is_preprocessing, :clang_isPreprocessing, [:cursor_kind], :uint |
.is_reference(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a simple reference.
Note that other kinds of cursors (such as expressions) can also refer to other cursors. Use clang_getCursorReferenced() to determine whether a particular cursor refers to another entity.
1814 |
# File 'lib/ffi_gen/clang.rb', line 1814 attach_function :is_reference, :clang_isReference, [:cursor_kind], :uint |
.is_restrict_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “restrict” qualifier set,
without looking through typedefs that may have added "restrict" at a different level.
2397 |
# File 'lib/ffi_gen/clang.rb', line 2397 attach_function :is_restrict_qualified_type, :clang_isRestrictQualifiedType, [Type.by_value], :uint |
.is_statement(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a statement.
1830 |
# File 'lib/ffi_gen/clang.rb', line 1830 attach_function :is_statement, :clang_isStatement, [:cursor_kind], :uint |
.is_translation_unit(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents a translation unit.
1856 |
# File 'lib/ffi_gen/clang.rb', line 1856 attach_function :is_translation_unit, :clang_isTranslationUnit, [:cursor_kind], :uint |
.is_unexposed(cursor_kind) ⇒ Integer
Determine whether the given cursor represents a currently
unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
1874 |
# File 'lib/ffi_gen/clang.rb', line 1874 attach_function :is_unexposed, :clang_isUnexposed, [:cursor_kind], :uint |
.is_virtual_base(cursor) ⇒ Integer
Returns 1 if the base class specified by the cursor with kind
CX_CXXBaseSpecifier is virtual.
2484 |
# File 'lib/ffi_gen/clang.rb', line 2484 attach_function :is_virtual_base, :clang_isVirtualBase, [Cursor.by_value], :uint |
.is_volatile_qualified_type(t) ⇒ Integer
Determine whether a CXType has the “volatile” qualifier set,
without looking through typedefs that may have added "volatile" at a different level.
2388 |
# File 'lib/ffi_gen/clang.rb', line 2388 attach_function :is_volatile_qualified_type, :clang_isVolatileQualifiedType, [Type.by_value], :uint |
.parse_translation_unit(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options) ⇒ TranslationUnitImpl
Parse the given source file and the translation unit corresponding to that file.
This routine is the main entry point for the Clang C API, providing the ability to parse a source file into a translation unit that can then be queried by other functions in the API. This routine accepts a set of command-line arguments so that the compilation can be configured in the same way that the compiler is configured on the command line.
842 |
# File 'lib/ffi_gen/clang.rb', line 842 attach_function :parse_translation_unit, :clang_parseTranslationUnit, [:pointer, :string, :pointer, :int, UnsavedFile, :uint, :uint], TranslationUnitImpl |
.range_is_null(range) ⇒ Integer
Returns non-zero if arg range is null.
294 |
# File 'lib/ffi_gen/clang.rb', line 294 attach_function :range_is_null, :clang_Range_isNull, [SourceRange.by_value], :int |
.remap_dispose(remapping) ⇒ nil
Dispose the remapping.
3659 |
# File 'lib/ffi_gen/clang.rb', line 3659 attach_function :remap_dispose, :clang_remap_dispose, [:pointer], :void |
.remap_get_filenames(remapping, index, original, transformed) ⇒ nil
Get the original and the associated filename from the remapping.
3651 |
# File 'lib/ffi_gen/clang.rb', line 3651 attach_function :remap_get_filenames, :clang_remap_getFilenames, [:pointer, :uint, :pointer, :pointer], :void |
.remap_get_num_files(remapping) ⇒ Integer
Determine the number of remappings.
3639 |
# File 'lib/ffi_gen/clang.rb', line 3639 attach_function :remap_get_num_files, :clang_remap_getNumFiles, [:pointer], :uint |
.reparse_translation_unit(tu, num_unsaved_files, unsaved_files, options) ⇒ Integer
Reparse the source files that produced this translation unit.
This routine can be used to re-parse the source files that originally created the given translation unit, for example because those source files have changed (either on disk or as passed via p unsaved_files). The source code will be reparsed with the same command-line options as it was originally parsed.
Reparsing a translation unit invalidates all cursors and source locations that refer into that translation unit. This makes reparsing a translation unit semantically equivalent to destroying the translation unit and then creating a new translation unit with the same command-line arguments. However, it may be more efficient to reparse a translation unit using this routine.
1009 |
# File 'lib/ffi_gen/clang.rb', line 1009 attach_function :reparse_translation_unit, :clang_reparseTranslationUnit, [TranslationUnitImpl, :uint, UnsavedFile, :uint], :int |
.save_translation_unit(tu, file_name, options) ⇒ Integer
Saves a translation unit into a serialized representation of that translation unit on disk.
Any translation unit that was parsed without error can be saved into a file. The translation unit can then be deserialized into a new c CXTranslationUnit with c clang_createTranslationUnit() or, if it is an incomplete translation unit that corresponds to a header, used as a precompiled header when parsing other translation units.
931 |
# File 'lib/ffi_gen/clang.rb', line 931 attach_function :save_translation_unit, :clang_saveTranslationUnit, [TranslationUnitImpl, :string, :uint], :int |
.sort_code_completion_results(results, num_results) ⇒ nil
Sort the code-completion results in case-insensitive alphabetical order.
3491 |
# File 'lib/ffi_gen/clang.rb', line 3491 attach_function :sort_code_completion_results, :clang_sortCodeCompletionResults, [:pointer, :uint], :void |
.toggle_crash_recovery(is_enabled) ⇒ nil
Enable/disable crash recovery.
Flag: to indicate if crash recovery is enabled. A non-zero value
enables crash recovery, while 0 disables it.
3589 |
# File 'lib/ffi_gen/clang.rb', line 3589 attach_function :toggle_crash_recovery, :clang_toggleCrashRecovery, [:uint], :void |
.tokenize(tu, range, tokens, num_tokens) ⇒ nil
Tokenize the source code described by the given range into raw lexical tokens.
3004 |
# File 'lib/ffi_gen/clang.rb', line 3004 attach_function :tokenize, :clang_tokenize, [TranslationUnitImpl, SourceRange.by_value, :pointer, :pointer], :void |
.visit_children(parent, visitor, client_data) ⇒ Integer
Visit the children of a particular cursor.
This function visits all the direct children of the given cursor, invoking the given p visitor function with the cursors of each visited child. The traversal may be recursive, if the visitor returns c CXChildVisit_Recurse. The traversal may also be ended prematurely, if the visitor returns c CXChildVisit_Break.
2621 |
# File 'lib/ffi_gen/clang.rb', line 2621 attach_function :visit_children, :clang_visitChildren, [Cursor.by_value, :cursor_visitor, :pointer], :uint |