Module: FFIGen::Clang
- Extended by:
- FFI::Library
- Defined in:
- lib/ffi_gen/clang.rb
Defined Under Namespace
Classes: CodeCompleteResults, CompletionResult, CursorAndRangeVisitor, CursorSetImpl, FileUniqueID, IdxAttrInfo, IdxBaseClassInfo, IdxCXXClassDeclInfo, IdxContainerInfo, IdxDeclInfo, IdxEntityInfo, IdxEntityRefInfo, IdxIBOutletCollectionAttrInfo, IdxImportedASTFileInfo, IdxIncludedFileInfo, IdxLoc, IdxObjCCategoryDeclInfo, IdxObjCContainerDeclInfo, IdxObjCInterfaceDeclInfo, IdxObjCPropertyDeclInfo, IdxObjCProtocolRefInfo, IdxObjCProtocolRefListInfo, IndexerCallbacks, PlatformAvailability, SourceLocation, SourceRange, SourceRangeList, TUResourceUsage, TUResourceUsageEntry, Token, TranslationUnitImpl, UnsavedFile, Version
Constant Summary collapse
- CINDEX_VERSION_MAJOR =
0
- CINDEX_VERSION_MINOR =
27
Class Method Summary collapse
-
._callback_cursor_visitor_(enumcx_child_visit_result, cursor, parent, client_data) ⇒ Symbol from _enum_child_visit_result_
Visitor invoked for each cursor found by a traversal.
-
._callback_inclusion_visitor_(included_file, 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_calling_conv_ ⇒ Symbol
Describes the calling convention of a function type.
-
._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_error_code_ ⇒ Symbol
(Not documented).
-
._enum_global_opt_flags_ ⇒ Symbol
(Not documented).
-
._enum_idx_attr_kind_ ⇒ Symbol
(Not documented).
-
._enum_idx_decl_info_flags_ ⇒ Symbol
(Not documented).
-
._enum_idx_entity_cxx_template_kind_ ⇒ Symbol
Extra C++ template information for an entity.
-
._enum_idx_entity_kind_ ⇒ Symbol
(Not documented).
-
._enum_idx_entity_language_ ⇒ Symbol
(Not documented).
-
._enum_idx_entity_ref_kind_ ⇒ Symbol
Data for IndexerCallbacks#indexEntityReference.
-
._enum_idx_obj_c_container_kind_ ⇒ Symbol
(Not documented).
-
._enum_index_opt_flags_ ⇒ Symbol
(Not documented).
-
._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_load_diag_error_ ⇒ Symbol
Describes the kind of error that occurred (if any) in a call to c clang_loadDiagnostics.
-
._enum_name_ref_flags_ ⇒ Symbol
(Not documented).
-
._enum_obj_c_decl_qualifier_kind_ ⇒ Symbol
‘Qualifiers’ written next to the return and parameter types in Objective-C method declarations.
-
._enum_obj_c_property_attr_kind_ ⇒ Symbol
Property attributes for a c CXCursor_ObjCPropertyDecl.
-
._enum_ref_qualifier_kind_ ⇒ Symbol
(Not documented).
-
._enum_reparse_flags_ ⇒ Symbol
Flags that control the reparsing of translation units.
-
._enum_result_ ⇒ Symbol
(Not documented).
-
._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_type_layout_error_ ⇒ Symbol
List the possible error codes for c clang_Type_getSizeOf, c clang_Type_getAlignOf, c clang_Type_getOffsetOf and c clang_Cursor_getOffsetOf.
-
._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.
- .attach_function(name, *_) ⇒ Object
-
.code_complete_at(tu, complete_filename, complete_line, complete_column, unsaved_files, num_unsaved_files, options) ⇒ 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 completions 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)
Provides a shared context for creating translation units.
-
.create_translation_unit(c_idx, ast_filename) ⇒ TranslationUnitImpl
Same as c clang_createTranslationUnit2, but returns the c CXTranslationUnit instead of an error code.
-
.create_translation_unit2(c_idx, ast_filename, out_tu) ⇒ Symbol from _enum_error_code_
Create a translation unit from an AST file (c -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_argument(c, i) ⇒ Cursor
Retrieve the argument cursor of a function or method.
-
.cursor_get_brief_comment_text(c) ⇒ String
Given a cursor that represents a documentable entity (e.g., declaration), return the associated paragraph; otherwise return the first paragraph.
-
.cursor_get_comment_range(c) ⇒ SourceRange
Given a cursor that represents a declaration, return the associated comment’s source range.
-
.cursor_get_module(c) ⇒ FFI::Pointer(Module)
Given a CXCursor_ModuleImportDecl cursor, return the associated module.
-
.cursor_get_num_arguments(c) ⇒ Integer
Retrieve the number of non-variadic arguments associated with a given cursor.
-
.cursor_get_obj_c_decl_qualifiers(c) ⇒ Integer
Given a cursor that represents an Objective-C method or parameter declaration, return the associated Objective-C qualifiers for the return type or the parameter respectively.
-
.cursor_get_obj_c_property_attributes(c, reserved) ⇒ Integer
Given a cursor that represents a property declaration, return the associated property attributes.
-
.cursor_get_obj_c_selector_index(cursor) ⇒ Integer
If the cursor points to a selector identifier in an Objective-C method or message expression, this returns the selector index.
-
.cursor_get_raw_comment_text(c) ⇒ String
Given a cursor that represents a declaration, return the associated comment text, including comment markers.
-
.cursor_get_receiver_type(c) ⇒ Type
Given a cursor pointing to an Objective-C message, returns the CXType of the receiver.
-
.cursor_get_spelling_name_range(cursor, piece_index, options) ⇒ SourceRange
Retrieve a range for a piece that forms the cursors spelling name.
-
.cursor_get_translation_unit(cursor) ⇒ TranslationUnitImpl
Returns the translation unit that a cursor originated from.
-
.cursor_is_bit_field(c) ⇒ Integer
Returns non-zero if the cursor specifies a Record member that is a bitfield.
-
.cursor_is_dynamic_call(c) ⇒ Integer
Given a cursor pointing to a C++ method call or an Objective-C message, returns non-zero if the method/message is “dynamic”, meaning:.
-
.cursor_is_null(cursor) ⇒ Integer
Returns non-zero if p cursor is null.
-
.cursor_is_obj_c_optional(c) ⇒ Integer
Given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by “@optional”.
-
.cursor_is_variadic(c) ⇒ Integer
Returns non-zero if the given cursor is a variadic function or method.
-
.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.
-
.cx_index_get_global_options(index) ⇒ Integer
Gets the general options associated with a CXIndex.
-
.cx_index_set_global_options(index, options) ⇒ nil
Sets general options associated with a CXIndex.
-
.cxx_method_is_const(c) ⇒ Integer
Determine if a C++ member function or member function template is declared ‘const’.
-
.cxx_method_is_pure_virtual(c) ⇒ Integer
Determine if a C++ member function or member function template is pure virtual.
-
.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_cx_platform_availability(availability) ⇒ nil
Free the memory associated with a c CXPlatformAvailability structure.
-
.dispose_cxtu_resource_usage(usage) ⇒ nil
(Not documented).
-
.dispose_diagnostic(diagnostic) ⇒ nil
Destroy a diagnostic.
-
.dispose_diagnostic_set(diags) ⇒ nil
Release a CXDiagnosticSet and all of its contained diagnostics.
-
.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_source_range_list(ranges) ⇒ nil
Destroy the given c CXSourceRangeList.
-
.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_includes_in_file(tu, file, visitor) ⇒ Symbol from _enum_result_
Find #import/#include directives in a specific file.
-
.find_references_in_file(cursor, file, visitor) ⇒ Symbol from _enum_result_
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_arg_type(t, i) ⇒ Type
Retrieve the type of a parameter of a function type.
-
.get_array_element_type(t) ⇒ Type
Return the element type of an array type.
-
.get_array_size(t) ⇒ Integer
Return 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_child_diagnostics(d) ⇒ FFI::Pointer(DiagnosticSet)
Retrieve the child diagnostics of a CXDiagnostic.
-
.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_brief_comment(completion_string) ⇒ String
Retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string.
-
.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_parent(completion_string, kind) ⇒ String
Retrieve the parent context of 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, taking the current target platform into account.
-
.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_platform_availability(cursor, always_deprecated, deprecated_message, always_unavailable, unavailable_message, availability, availability_size) ⇒ Integer
Determine the availability of the entity that this cursor refers to on any platforms for which availability information is known.
-
.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 return 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 referenced object.
-
.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_category_text(diagnostic) ⇒ String
Retrieve the diagnostic category text for a given diagnostic.
-
.get_diagnostic_fix_it(diagnostic, fix_it, replacement_range) ⇒ String
Retrieve the replacement information for a given fix-it.
-
.get_diagnostic_in_set(diags, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given CXDiagnosticSet.
-
.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_set_from_tu(unit) ⇒ FFI::Pointer(DiagnosticSet)
Retrieve the complete set of diagnostics associated with a translation unit.
-
.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_element_type(t) ⇒ Type
Return the element type of an array, complex, or vector type.
-
.get_enum_constant_decl_unsigned_value(c) ⇒ Integer
Retrieve the integer value of an enum constant declaration as an unsigned long long.
-
.get_enum_constant_decl_value(c) ⇒ Integer
Retrieve the integer value of an enum constant declaration as a signed long long.
-
.get_enum_decl_integer_type(c) ⇒ Type
Retrieve the integer type of an enum declaration.
-
.get_expansion_location(location, file, line, column, offset) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location.
-
.get_field_decl_bit_width(c) ⇒ Integer
Retrieve the bit width of a bit field declaration as an integer.
-
.get_file(tu, file_name) ⇒ FFI::Pointer(File)
Retrieve a file handle within the given translation unit.
-
.get_file_location(location, file, line, column, offset) ⇒ nil
Retrieve the file, line, column, and offset represented by the given source location.
-
.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_file_unique_id(file, out_id) ⇒ Integer
Retrieve the unique ID for the given c file.
-
.get_function_type_calling_conv(t) ⇒ Symbol from _enum_calling_conv_
Retrieve the calling convention associated with a function type.
-
.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_module_for_file(translation_unit_impl, file) ⇒ FFI::Pointer(Module)
Given a CXFile header file, return the module that contains it, if one exists.
-
.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_arg_types(t) ⇒ Integer
Retrieve the number of non-variadic parameters associated with a function type.
-
.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_diagnostics_in_set(diags) ⇒ Integer
Determine the number of diagnostics in a CXDiagnosticSet.
-
.get_num_elements(t) ⇒ Integer
Return the number of elements of an array or vector type.
-
.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(begin_, end_) ⇒ 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_remappings_from_file_list(file_paths, num_files) ⇒ FFI::Pointer(Remapping)
Retrieve a remapping.
-
.get_result_type(t) ⇒ Type
Retrieve the return type associated with a function type.
-
.get_skipped_ranges(tu, file) ⇒ SourceRangeList
Retrieve all ranges that were skipped by the preprocessor.
-
.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.
-
.get_type_spelling(ct) ⇒ String
Pretty-print the underlying type using the rules of the language of the translation unit from which it came.
-
.get_typedef_decl_underlying_type(c) ⇒ Type
Retrieve the underlying type of a typedef declaration.
-
.hash_cursor(cursor) ⇒ Integer
Compute a hash value for the given cursor.
-
.index_action_create(c_idx) ⇒ FFI::Pointer(IndexAction)
An indexing action/session, to be applied to one or multiple translation units.
-
.index_action_dispose(index_action) ⇒ nil
Destroy the given index action.
-
.index_get_client_container(idx_container_info) ⇒ FFI::Pointer(IdxClientContainer)
For retrieving a custom CXIdxClientContainer attached to a container.
-
.index_get_client_entity(idx_entity_info) ⇒ FFI::Pointer(IdxClientEntity)
For retrieving a custom CXIdxClientEntity attached to an entity.
-
.index_get_cxx_class_decl_info(idx_decl_info) ⇒ IdxCXXClassDeclInfo
(Not documented).
-
.index_get_ib_outlet_collection_attr_info(idx_attr_info) ⇒ IdxIBOutletCollectionAttrInfo
(Not documented).
-
.index_get_obj_c_category_decl_info(idx_decl_info) ⇒ IdxObjCCategoryDeclInfo
(Not documented).
-
.index_get_obj_c_container_decl_info(idx_decl_info) ⇒ IdxObjCContainerDeclInfo
(Not documented).
-
.index_get_obj_c_interface_decl_info(idx_decl_info) ⇒ IdxObjCInterfaceDeclInfo
(Not documented).
-
.index_get_obj_c_property_decl_info(idx_decl_info) ⇒ IdxObjCPropertyDeclInfo
(Not documented).
-
.index_get_obj_c_protocol_ref_list_info(idx_decl_info) ⇒ IdxObjCProtocolRefListInfo
(Not documented).
-
.index_is_entity_obj_c_container_kind(idx_entity_kind) ⇒ Integer
(Not documented).
-
.index_loc_get_cx_source_location(loc) ⇒ SourceLocation
Retrieve the CXSourceLocation represented by the given CXIdxLoc.
-
.index_loc_get_file_location(loc, index_file, file, line, column, offset) ⇒ nil
Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.
-
.index_set_client_container(idx_container_info, idx_client_container) ⇒ nil
For setting a custom CXIdxClientContainer attached to a container.
-
.index_set_client_entity(idx_entity_info, idx_client_entity) ⇒ nil
For setting a custom CXIdxClientEntity attached to an entity.
-
.index_source_file(index_action, client_data, index_callbacks, index_callbacks_size, index_options, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, out_tu, tu_options) ⇒ Integer
Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks.
-
.index_translation_unit(index_action, client_data, index_callbacks, index_callbacks_size, index_options, translation_unit_impl) ⇒ Integer
Index the given translation unit via callbacks implemented through #IndexerCallbacks.
-
.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_function_type_variadic(t) ⇒ Integer
Return 1 if the CXType is a variadic function type, and 0 otherwise.
-
.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.
-
.load_diagnostics(file, error, error_string) ⇒ FFI::Pointer(DiagnosticSet)
Deserialize a set of diagnostics from a Clang diagnostics bitcode file.
-
.location_is_from_main_file(location) ⇒ Integer
Returns non-zero if the given source location is in the main file of the corresponding translation unit.
-
.location_is_in_system_header(location) ⇒ Integer
Returns non-zero if the given source location is in a system header.
-
.module_get_ast_file(module_) ⇒ FFI::Pointer(File)
(Not documented).
-
.module_get_full_name(module_) ⇒ String
(Not documented).
-
.module_get_name(module_) ⇒ String
(Not documented).
-
.module_get_num_top_level_headers(translation_unit_impl, module_) ⇒ Integer
(Not documented).
-
.module_get_parent(module_) ⇒ FFI::Pointer(Module)
(Not documented).
-
.module_get_top_level_header(translation_unit_impl, module_, index) ⇒ FFI::Pointer(File)
(Not documented).
-
.module_is_system(module_) ⇒ Integer
(Not documented).
-
.parse_translation_unit(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options) ⇒ TranslationUnitImpl
Same as c clang_parseTranslationUnit2, but returns the c CXTranslationUnit instead of an error code.
-
.parse_translation_unit2(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options, out_tu) ⇒ Symbol from _enum_error_code_
Parse the given source file and the translation unit corresponding to that file.
-
.range_is_null(range) ⇒ Integer
Returns non-zero if p 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.
-
.type_get_align_of(t) ⇒ Integer
Return the alignment of a type in bytes as per C++(expr.alignof) standard.
-
.type_get_class_type(t) ⇒ Type
Return the class type of an member pointer type.
-
.type_get_cxx_ref_qualifier(t) ⇒ Symbol from _enum_ref_qualifier_kind_
Retrieve the ref-qualifier kind of a function or method.
-
.type_get_num_template_arguments(t) ⇒ Integer
Returns the number of template arguments for given class template specialization, or -1 if type c T is not a class template specialization.
-
.type_get_offset_of(t, s) ⇒ Integer
Return the offset of a field named S in a record of type T in bits as it would be returned by __offsetof__ as per C++11(18.2p4).
-
.type_get_size_of(t) ⇒ Integer
Return the size of a type in bytes as per C++(expr.sizeof) standard.
-
.type_get_template_argument_as_type(t, i) ⇒ Type
Returns the type template argument of a template class specialization at given index.
-
.visit_children(parent, visitor, client_data) ⇒ Integer
Visit the children of a particular cursor.
Instance Method Summary collapse
Class Method Details
._callback_cursor_visitor_(enumcx_child_visit_result, 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.
3542 |
# File 'lib/ffi_gen/clang.rb', line 3542 callback :cursor_visitor, [:child_visit_result, Cursor.by_value, Cursor.by_value, :pointer], :child_visit_result |
._callback_inclusion_visitor_(included_file, 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.
4964 |
# File 'lib/ffi_gen/clang.rb', line 4964 callback :inclusion_visitor, [:pointer, SourceLocation, :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.
129 130 131 132 133 134 |
# File 'lib/ffi_gen/clang.rb', line 129 enum :availability_kind, [ :available, 0, :deprecated, 1, :not_available, 2, :not_accessible, 3 ] |
._enum_calling_conv_ ⇒ Symbol
Describes the calling convention of a function type
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:calling_conv).
Options:
- :default
- :c
- :x86_std_call
- :x86_fast_call
- :x86_this_call
- :x86_pascal
- :aapcs
- :aapcs_vfp
- :pnacl_call
- :intel_ocl_bicc
- :x86_64_win64
- :x86_64_sys_v
- :invalid
- :unexposed
- :c
2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 |
# File 'lib/ffi_gen/clang.rb', line 2930 enum :calling_conv, [ :default, 0, :c, 1, :x86_std_call, 2, :x86_fast_call, 3, :x86_this_call, 4, :x86_pascal, 5, :aapcs, 6, :aapcs_vfp, 7, :pnacl_call, 8, :intel_ocl_bicc, 9, :x86_64_win64, 10, :x86_64_sys_v, 11, :invalid, 100, :unexposed, 200 ] |
._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.
3516 3517 3518 3519 3520 |
# File 'lib/ffi_gen/clang.rb', line 3516 enum :child_visit_result, [ :break_, 0, :continue, 1, :recurse, 2 ] |
._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.
- :include_brief_comments
-
Whether to include brief documentation within the set of code completions returned.
4662 4663 4664 4665 4666 |
# File 'lib/ffi_gen/clang.rb', line 4662 enum :code_complete_flags, [ :include_macros, 1, :include_code_patterns, 2, :include_brief_comments, 4 ] |
._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.
4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 |
# File 'lib/ffi_gen/clang.rb', line 4483 enum :completion_chunk_kind, [ :optional, 0, :typed_text, 1, :text, 2, :placeholder, 3, :informative, 4, :current_parameter, 5, :left_paren, 6, :right_paren, 7, :left_bracket, 8, :right_bracket, 9, :left_brace, 10, :right_brace, 11, :left_angle, 12, :right_angle, 13, :comma, 14, :result_type, 15, :colon, 16, :semi_colon, 17, :equal, 18, :horizontal_space, 19, :vertical_space, 20 ] |
._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:
- :unexposed
-
The context for completions is unexposed, as only Clang results should be included. (This is equivalent to having no context bits set.)
- :any_type
-
Completions for any possible type should be included in the results.
- :any_value
-
Completions for any possible value (variables, function calls, etc.) should be included in the results.
- :obj_c_object_value
-
Completions for values that resolve to an Objective-C object should be included in the results.
- :obj_c_selector_value
-
Completions for values that resolve to an Objective-C selector should be included in the results.
- :cxx_class_type_value
-
Completions for values that resolve to a C++ class type should be included in the results.
- :dot_member_access
-
Completions for fields of the member being accessed using the dot operator should be included in the results.
- :arrow_member_access
-
Completions for fields of the member being accessed using the arrow operator should be included in the results.
- :obj_c_property_access
-
Completions for properties of the Objective-C object being accessed using the dot operator should be included in the results.
- :enum_tag
-
Completions for enum tags should be included in the results.
- :union_tag
-
Completions for union tags should be included in the results.
- :struct_tag
-
Completions for struct tags should be included in the results.
- :class_tag
-
Completions for C++ class names should be included in the results.
- :namespace
-
Completions for C++ namespaces and namespace aliases should be included in the results.
- :nested_name_specifier
-
Completions for C++ nested name specifiers should be included in the results.
- :obj_c_interface
-
Completions for Objective-C interfaces (classes) should be included in the results.
- :obj_c_protocol
-
Completions for Objective-C protocols should be included in the results.
- :obj_c_category
-
Completions for Objective-C categories should be included in the results.
- :obj_c_instance_message
-
Completions for Objective-C instance messages should be included in the results.
- :obj_c_class_message
-
Completions for Objective-C class messages should be included in the results.
- :obj_c_selector_name
-
Completions for Objective-C selector names should be included in the results.
- :macro_name
-
Completions for preprocessor macro names should be included in the results.
- :natural_language
-
Natural language completions should be included in the results.
- :unknown
-
The current context is unknown, so set all contexts.
4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 |
# File 'lib/ffi_gen/clang.rb', line 4745 enum :completion_context, [ :unexposed, 0, :any_type, 1, :any_value, 2, :obj_c_object_value, 4, :obj_c_selector_value, 8, :cxx_class_type_value, 16, :dot_member_access, 32, :arrow_member_access, 64, :obj_c_property_access, 128, :enum_tag, 256, :union_tag, 512, :struct_tag, 1024, :class_tag, 2048, :namespace, 4096, :nested_name_specifier, 8192, :obj_c_interface, 16384, :obj_c_protocol, 32768, :obj_c_category, 65536, :obj_c_instance_message, 131072, :obj_c_class_message, 262144, :obj_c_selector_name, 524288, :macro_name, 1048576, :natural_language, 2097152, :unknown, 4194303 ] |
._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
- :cxx_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.
- :cxx_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
- :obj_c_class_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.
- :cxx_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.
- :variable_ref
-
A reference to a variable that occurs in some non-expression context, e.g., a C++ lambda capture list.
- :first_invalid
-
Error conditions
- :invalid_file
- :no_decl_found
- :not_implemented
- :invalid_code
- :first_expr
- :no_decl_found
-
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, variable, 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 C11 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).
- :cxx_static_cast_expr
-
C++‘s static_cast<> expression.
- :cxx_dynamic_cast_expr
-
C++‘s dynamic_cast<> expression.
- :cxx_reinterpret_cast_expr
-
C++‘s reinterpret_cast<> expression.
- :cxx_const_cast_expr
-
C++‘s const_cast<> expression.
- :cxx_functional_cast_expr
-
Represents an explicit C++ type conversion that uses “functional” notion (C++ (expr.type.conv)).
Example: code
x = int(0.5);
endcode
- :cxx_typeid_expr
-
A C++ typeid expression (C++ (expr.typeid)).
- :cxx_bool_literal_expr
-
(C++ 2.13.5) C++ Boolean Literal.
- :cxx_null_ptr_literal_expr
-
(C++0x 2.14.7) C++ Pointer Literal.
- :cxx_this_expr
-
Represents the “this” expression in C++
- :cxx_throw_expr
-
(C++ 15) C++ Throw Expression.
This handles ‘throw’ and ‘throw’ assignment-expression. When assignment-expression isn’t present, Op will be null.
- :cxx_new_expr
-
A new expression for memory allocation and constructor calls, e.g: “new CXXNewExpr(foo)”.
- :cxx_delete_expr
-
A delete expression for memory deallocation and destructor calls, e.g. “delete() pArray”.
- :unary_expr
-
A unary expression.
- :obj_c_string_literal
-
An Objective-C string literal i.e. @“foo”.
- :obj_c_encode_expr
-
An Objective-C @encode expression.
- :obj_c_selector_expr
-
An Objective-C @selector expression.
- :obj_c_protocol_expr
-
An Objective-C @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
- :lambda_expr
-
Represents a C++ lambda expression that produces a local function object.
code void abssort(float *x, unsigned N) {
std::sort(x, x + N, ()(float a, float b) { return std::abs(a) < std::abs(b); });
} endcode
- :obj_c_bool_literal_expr
-
Objective-c Boolean Literal.
- :obj_c_self_expr
-
Represents the “self” expression in an Objective-C method.
- :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 statement.
- :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.
- :gcc_asm_stmt
-
A GCC inline assembly statement extension.
- :obj_c_at_try_stmt
-
Objective-C’s overall @try-@catch-@finally 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.
- :cxx_catch_stmt
-
C++‘s catch statement.
- :cxx_try_stmt
-
C++‘s try statement.
- :cxx_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.
- :ms_asm_stmt
-
A MS inline assembly statement extension.
- :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.
- :omp_parallel_directive
-
OpenMP parallel directive.
- :omp_simd_directive
-
OpenMP simd directive.
- :omp_for_directive
-
OpenMP for directive.
- :omp_sections_directive
-
OpenMP sections directive.
- :omp_section_directive
-
OpenMP section directive.
- :omp_single_directive
-
OpenMP single directive.
- :omp_parallel_for_directive
-
OpenMP parallel for directive.
- :omp_parallel_sections_directive
-
OpenMP parallel sections directive.
- :omp_task_directive
-
OpenMP task directive.
- :omp_master_directive
-
OpenMP master directive.
- :omp_critical_directive
-
OpenMP critical directive.
- :omp_taskyield_directive
-
OpenMP taskyield directive.
- :omp_barrier_directive
-
OpenMP barrier directive.
- :omp_taskwait_directive
-
OpenMP taskwait directive.
- :omp_flush_directive
-
OpenMP flush directive.
- :seh_leave_stmt
-
Windows Structured Exception Handling’s leave statement.
- :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
- :cxx_final_attr
- :cxx_override_attr
- :annotate_attr
- :asm_label_attr
- :packed_attr
- :pure_attr
- :const_attr
- :no_duplicate_attr
- :cuda_constant_attr
- :cuda_device_attr
- :cuda_global_attr
- :cuda_host_attr
- :preprocessing_directive
- :ib_outlet_attr
-
Preprocessing
- :macro_definition
- :macro_expansion
- :inclusion_directive
- :module_import_decl
- :macro_expansion
-
A module import declaration.
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 |
# File 'lib/ffi_gen/clang.rb', line 2011 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, :cxx_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, :cxx_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, :cxx_base_specifier, 44, :template_ref, 45, :namespace_ref, 46, :member_ref, 47, :label_ref, 48, :overloaded_decl_ref, 49, :variable_ref, 50, :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, :cxx_static_cast_expr, 124, :cxx_dynamic_cast_expr, 125, :cxx_reinterpret_cast_expr, 126, :cxx_const_cast_expr, 127, :cxx_functional_cast_expr, 128, :cxx_typeid_expr, 129, :cxx_bool_literal_expr, 130, :cxx_null_ptr_literal_expr, 131, :cxx_this_expr, 132, :cxx_throw_expr, 133, :cxx_new_expr, 134, :cxx_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, :lambda_expr, 144, :obj_c_bool_literal_expr, 145, :obj_c_self_expr, 146, :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, :gcc_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, :cxx_catch_stmt, 223, :cxx_try_stmt, 224, :cxx_for_range_stmt, 225, :seh_try_stmt, 226, :seh_except_stmt, 227, :seh_finally_stmt, 228, :ms_asm_stmt, 229, :null_stmt, 230, :decl_stmt, 231, :omp_parallel_directive, 232, :omp_simd_directive, 233, :omp_for_directive, 234, :omp_sections_directive, 235, :omp_section_directive, 236, :omp_single_directive, 237, :omp_parallel_for_directive, 238, :omp_parallel_sections_directive, 239, :omp_task_directive, 240, :omp_master_directive, 241, :omp_critical_directive, 242, :omp_taskyield_directive, 243, :omp_barrier_directive, 244, :omp_taskwait_directive, 245, :omp_flush_directive, 246, :seh_leave_stmt, 247, :translation_unit, 300, :first_attr, 400, :unexposed_attr, 400, :ib_action_attr, 401, :ib_outlet_attr, 402, :ib_outlet_collection_attr, 403, :cxx_final_attr, 404, :cxx_override_attr, 405, :annotate_attr, 406, :asm_label_attr, 407, :packed_attr, 408, :pure_attr, 409, :const_attr, 410, :no_duplicate_attr, 411, :cuda_constant_attr, 412, :cuda_device_attr, 413, :cuda_global_attr, 414, :cuda_host_attr, 415, :preprocessing_directive, 500, :macro_definition, 501, :macro_expansion, 502, :inclusion_directive, 503, :module_import_decl, 600 ] |
._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:
- :invalid_access_specifier
- :public
- :protected
- :private
- :public
3443 3444 3445 3446 3447 3448 |
# File 'lib/ffi_gen/clang.rb', line 3443 enum :cxx_access_specifier, [ :invalid_access_specifier, 0, :public, 1, :protected, 2, :private, 3 ] |
._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_formatDiagnostic().
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:diagnostic_display_options).
Options:
- :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.
- :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.
- :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.
- :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.
- :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.
- :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.
824 825 826 827 828 829 830 831 |
# File 'lib/ffi_gen/clang.rb', line 824 enum :diagnostic_display_options, [ :source_location, 1, :column, 2, :source_ranges, 4, :option, 8, :category_id, 16, :category_name, 32 ] |
._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.
647 648 649 650 651 652 653 |
# File 'lib/ffi_gen/clang.rb', line 647 enum :diagnostic_severity, [ :ignored, 0, :note, 1, :warning, 2, :error, 3, :fatal, 4 ] |
._enum_error_code_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:error_code).
Options:
- :success
-
No error.
- :failure
-
A generic error code, no further details are available.
Errors of this kind can get their own specific error codes in future libclang versions.
- :crashed
-
libclang crashed while performing the requested operation.
- :invalid_arguments
-
The function detected that the arguments violate the function contract.
- :ast_read_error
-
An AST deserialization error has occurred.
46 47 48 49 50 51 52 |
# File 'lib/ffi_gen/clang.rb', line 46 enum :error_code, [ :success, 0, :failure, 1, :crashed, 2, :invalid_arguments, 3, :ast_read_error, 4 ] |
._enum_global_opt_flags_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:global_opt_flags).
Options:
- :none
-
Used to indicate that no special CXIndex options are needed.
- :thread_background_priority_for_indexing
-
Used to indicate that threads that libclang creates for indexing purposes should use background priority.
Affects #clang_indexSourceFile, #clang_indexTranslationUnit, #clang_parseTranslationUnit, #clang_saveTranslationUnit.
- :thread_background_priority_for_editing
-
Used to indicate that threads that libclang creates for editing purposes should use background priority.
Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, #clang_annotateTokens
236 237 238 239 240 |
# File 'lib/ffi_gen/clang.rb', line 236 enum :global_opt_flags, [ :none, 0, :thread_background_priority_for_indexing, 1, :thread_background_priority_for_editing, 2 ] |
._enum_idx_attr_kind_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_attr_kind).
Options:
- :unexposed
- :ib_action
- :ib_outlet
- :ib_outlet_collection
- :ib_action
5325 5326 5327 5328 5329 5330 |
# File 'lib/ffi_gen/clang.rb', line 5325 enum :idx_attr_kind, [ :unexposed, 0, :ib_action, 1, :ib_outlet, 2, :ib_outlet_collection, 3 ] |
._enum_idx_decl_info_flags_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_decl_info_flags).
Options:
- :idx_decl_flag_skipped
5415 5416 5417 |
# File 'lib/ffi_gen/clang.rb', line 5415 enum :idx_decl_info_flags, [ :idx_decl_flag_skipped, 1 ] |
._enum_idx_entity_cxx_template_kind_ ⇒ Symbol
Extra C++ template information for an entity. This can apply to: CXIdxEntity_Function CXIdxEntity_CXXClass CXIdxEntity_CXXStaticMethod CXIdxEntity_CXXInstanceMethod CXIdxEntity_CXXConstructor CXIdxEntity_CXXConversionFunction CXIdxEntity_CXXTypeAlias
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_entity_cxx_template_kind).
Options:
- :non_template
- :template
- :template_partial_specialization
- :template_specialization
- :template
5301 5302 5303 5304 5305 5306 |
# File 'lib/ffi_gen/clang.rb', line 5301 enum :idx_entity_cxx_template_kind, [ :non_template, 0, :template, 1, :template_partial_specialization, 2, :template_specialization, 3 ] |
._enum_idx_entity_kind_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_entity_kind).
Options:
- :unexposed
- :typedef
- :function
- :variable
- :field
- :enum_constant
- :obj_c_class
- :obj_c_protocol
- :obj_c_category
- :obj_c_instance_method
- :obj_c_class_method
- :obj_c_property
- :obj_c_ivar
- :enum
- :struct
- :union
- :cxx_class
- :cxx_namespace
- :cxx_namespace_alias
- :cxx_static_variable
- :cxx_static_method
- :cxx_instance_method
- :cxx_constructor
- :cxx_destructor
- :cxx_conversion_function
- :cxx_type_alias
- :cxx_interface
- :typedef
5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 |
# File 'lib/ffi_gen/clang.rb', line 5223 enum :idx_entity_kind, [ :unexposed, 0, :typedef, 1, :function, 2, :variable, 3, :field, 4, :enum_constant, 5, :obj_c_class, 6, :obj_c_protocol, 7, :obj_c_category, 8, :obj_c_instance_method, 9, :obj_c_class_method, 10, :obj_c_property, 11, :obj_c_ivar, 12, :enum, 13, :struct, 14, :union, 15, :cxx_class, 16, :cxx_namespace, 17, :cxx_namespace_alias, 18, :cxx_static_variable, 19, :cxx_static_method, 20, :cxx_instance_method, 21, :cxx_constructor, 22, :cxx_destructor, 23, :cxx_conversion_function, 24, :cxx_type_alias, 25, :cxx_interface, 26 ] |
._enum_idx_entity_language_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_entity_language).
Options:
- :lang_none
- :lang_c
- :lang_obj_c
- :lang_cxx
- :lang_c
5270 5271 5272 5273 5274 5275 |
# File 'lib/ffi_gen/clang.rb', line 5270 enum :idx_entity_language, [ :lang_none, 0, :lang_c, 1, :lang_obj_c, 2, :lang_cxx, 3 ] |
._enum_idx_entity_ref_kind_ ⇒ Symbol
Data for IndexerCallbacks#indexEntityReference.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_entity_ref_kind).
Options:
- :direct
-
The entity is referenced directly in user’s code.
- :implicit
-
An implicit reference, e.g. a reference of an Objective-C method via the dot syntax.
5621 5622 5623 5624 |
# File 'lib/ffi_gen/clang.rb', line 5621 enum :idx_entity_ref_kind, [ :direct, 1, :implicit, 2 ] |
._enum_idx_obj_c_container_kind_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:idx_obj_c_container_kind).
Options:
- :forward_ref
- :interface
- :implementation
- :interface
5481 5482 5483 5484 5485 |
# File 'lib/ffi_gen/clang.rb', line 5481 enum :idx_obj_c_container_kind, [ :forward_ref, 0, :interface, 1, :implementation, 2 ] |
._enum_index_opt_flags_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:index_opt_flags).
Options:
- :none
-
Used to indicate that no special indexing options are needed.
- :suppress_redundant_refs
-
Used to indicate that IndexerCallbacks#indexEntityReference should be invoked for only one reference of an entity per source file that does not also include a declaration/definition of the entity.
- :index_function_local_symbols
-
Function-local symbols should be indexed. If this is not set function-local symbols will be ignored.
- :index_implicit_template_instantiations
-
Implicit function/class template instantiations should be indexed. If this is not set, implicit instantiations will be ignored.
- :suppress_warnings
-
Suppress all compiler warnings when parsing for indexing.
- :skip_parsed_bodies_in_session
-
Skip a function/method body that was already parsed during an indexing session associated with a c CXIndexAction object. Bodies in system headers are always skipped.
5842 5843 5844 5845 5846 5847 5848 5849 |
# File 'lib/ffi_gen/clang.rb', line 5842 enum :index_opt_flags, [ :none, 0, :suppress_redundant_refs, 1, :index_function_local_symbols, 2, :index_implicit_template_instantiations, 4, :suppress_warnings, 8, :skip_parsed_bodies_in_session, 16 ] |
._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
- :c
2486 2487 2488 2489 2490 2491 |
# File 'lib/ffi_gen/clang.rb', line 2486 enum :language_kind, [ :invalid, 0, :c, 1, :obj_c, 2, :c_plus_plus, 3 ] |
._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.
2374 2375 2376 2377 2378 2379 2380 |
# File 'lib/ffi_gen/clang.rb', line 2374 enum :linkage_kind, [ :invalid, 0, :no_linkage, 1, :internal, 2, :unique_external, 3, :external, 4 ] |
._enum_load_diag_error_ ⇒ Symbol
Describes the kind of error that occurred (if any) in a call to c clang_loadDiagnostics.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:load_diag_error).
Options:
- :none
-
Indicates that no error occurred.
- :unknown
-
Indicates that an unknown error occurred while attempting to deserialize diagnostics.
- :cannot_load
-
Indicates that the file containing the serialized diagnostics could not be opened.
- :invalid_file
-
Indicates that the serialized diagnostics file is invalid or corrupt.
694 695 696 697 698 699 |
# File 'lib/ffi_gen/clang.rb', line 694 enum :load_diag_error, [ :none, 0, :unknown, 1, :cannot_load, 2, :invalid_file, 3 ] |
._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:
- :range_want_qualifier
- Include the nested-name-specifier, e.g. Foo
-
in x.Foo::y, in the
range.
- :range_want_template_args
-
Include the explicit template arguments, e.g. <int> in x.f<int>, in the range.
- :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); // Objective-C return some_vector(1); // C++ endcode
4153 4154 4155 4156 4157 |
# File 'lib/ffi_gen/clang.rb', line 4153 enum :name_ref_flags, [ :range_want_qualifier, 1, :range_want_template_args, 2, :range_want_single_piece, 4 ] |
._enum_obj_c_decl_qualifier_kind_ ⇒ Symbol
‘Qualifiers’ written next to the return and parameter types in Objective-C method declarations.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:obj_c_decl_qualifier_kind).
Options:
- :none
- :in_
- :inout
- :out
- :bycopy
- :byref
- :oneway
- :in_
3879 3880 3881 3882 3883 3884 3885 3886 3887 |
# File 'lib/ffi_gen/clang.rb', line 3879 enum :obj_c_decl_qualifier_kind, [ :none, 0, :in_, 1, :inout, 2, :out, 4, :bycopy, 8, :byref, 16, :oneway, 32 ] |
._enum_obj_c_property_attr_kind_ ⇒ Symbol
Property attributes for a c CXCursor_ObjCPropertyDecl.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:obj_c_property_attr_kind).
Options:
- :noattr
- :readonly
- :getter
- :assign
- :readwrite
- :retain
- :copy
- :nonatomic
- :setter
- :atomic
- :weak
- :strong
- :unsafe_unretained
- :readonly
3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 |
# File 'lib/ffi_gen/clang.rb', line 3828 enum :obj_c_property_attr_kind, [ :noattr, 0, :readonly, 1, :getter, 2, :assign, 4, :readwrite, 8, :retain, 16, :copy, 32, :nonatomic, 64, :setter, 128, :atomic, 256, :weak, 512, :strong, 1024, :unsafe_unretained, 2048 ] |
._enum_ref_qualifier_kind_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:ref_qualifier_kind).
Options:
- :none
-
No ref-qualifier was provided.
- :l_value
-
An lvalue ref-qualifier was provided (c &).
- :r_value
-
An rvalue ref-qualifier was provided (c &&).
3365 3366 3367 3368 3369 |
# File 'lib/ffi_gen/clang.rb', line 3365 enum :ref_qualifier_kind, [ :none, 0, :l_value, 1, :r_value, 2 ] |
._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.
1327 1328 1329 |
# File 'lib/ffi_gen/clang.rb', line 1327 enum :reparse_flags, [ :reparse_none, 0 ] |
._enum_result_ ⇒ Symbol
(Not documented)
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:result).
Options:
- :success
-
Function returned successfully.
- :invalid
-
One of the parameters was invalid for the function.
- :visit_break
-
The function was terminated by a callback (e.g. it returned CXVisit_Break)
5074 5075 5076 5077 5078 |
# File 'lib/ffi_gen/clang.rb', line 5074 enum :result, [ :success, 0, :invalid, 1, :visit_break, 2 ] |
._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).
1275 1276 1277 1278 1279 1280 |
# File 'lib/ffi_gen/clang.rb', line 1275 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.
1230 1231 1232 |
# File 'lib/ffi_gen/clang.rb', line 1230 enum :save_translation_unit_flags, [ :save_translation_unit_none, 0 ] |
._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.
4178 4179 4180 4181 4182 4183 4184 |
# File 'lib/ffi_gen/clang.rb', line 4178 enum :token_kind, [ :punctuation, 0, :keyword, 1, :identifier, 2, :literal, 3, :comment, 4 ] |
._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.
- :for_serialization
-
Used to indicate that the translation unit will be serialized with c clang_saveTranslationUnit.
This option is typically used when parsing a header with the intent of producing a precompiled header.
- :cxx_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.
- :skip_function_bodies
-
Used to indicate that function/method bodies should be skipped while parsing.
This option can be used to search for declarations/definitions while ignoring the usages.
- :include_brief_comments_in_code_completion
-
Used to indicate that brief documentation comments should be included into the set of code completions returned from this translation unit.
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 |
# File 'lib/ffi_gen/clang.rb', line 1130 enum :translation_unit_flags, [ :none, 0, :detailed_preprocessing_record, 1, :incomplete, 2, :precompiled_preamble, 4, :cache_completion_results, 8, :for_serialization, 16, :cxx_chained_pch, 32, :skip_function_bodies, 64, :include_brief_comments_in_code_completion, 128 ] |
._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
- :identifiers
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 |
# File 'lib/ffi_gen/clang.rb', line 1420 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
-
Represents 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
- :vector
- :incomplete_array
- :variable_array
- :dependent_sized_array
- :member_pointer
- :char_u
2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 |
# File 'lib/ffi_gen/clang.rb', line 2842 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, :vector, 113, :incomplete_array, 114, :variable_array, 115, :dependent_sized_array, 116, :member_pointer, 117 ] |
._enum_type_layout_error_ ⇒ Symbol
List the possible error codes for c clang_Type_getSizeOf,
\c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and
\c clang_Cursor_getOffsetOf.
A value of this enumeration type can be returned if the target type is not a valid argument to sizeof, alignof or offsetof.
This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:type_layout_error).
Options:
- :invalid
-
Type is of kind CXType_Invalid.
- :incomplete
-
The type is an incomplete Type.
- :dependent
-
The type is a dependent Type.
- :not_constant_size
-
The type is not a constant size type.
- :invalid_field_name
-
The Field name is not valid for this record.
3282 3283 3284 3285 3286 3287 3288 |
# File 'lib/ffi_gen/clang.rb', line 3282 enum :type_layout_error, [ :invalid, -1, :incomplete, -2, :dependent, -3, :not_constant_size, -4, :invalid_field_name, -5 ] |
._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:
- :visit_break
- :visit_continue
5041 5042 5043 5044 |
# File 'lib/ffi_gen/clang.rb', line 5041 enum :visitor_result, [ :visit_break, 0, :visit_continue, 1 ] |
.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.
4280 |
# File 'lib/ffi_gen/clang.rb', line 4280 attach_function :annotate_tokens, :clang_annotateTokens, [TranslationUnitImpl, Token, :uint, Cursor], :void |
.attach_function(name, *_) ⇒ Object
9 10 11 12 13 |
# File 'lib/ffi_gen/clang.rb', line 9 def self.attach_function(name, *_) begin; super; rescue FFI::NotFoundError => e (class << self; self; end).class_eval { define_method(name) { |*_| raise e } } end end |
.code_complete_at(tu, complete_filename, complete_line, complete_column, unsaved_files, num_unsaved_files, options) ⇒ 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.
4841 |
# File 'lib/ffi_gen/clang.rb', line 4841 attach_function :code_complete_at, :clang_codeCompleteAt, [TranslationUnitImpl, :string, :uint, :uint, UnsavedFile, :uint, :uint], CodeCompleteResults |
.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.
4904 |
# File 'lib/ffi_gen/clang.rb', line 4904 attach_function :code_complete_get_container_kind, :clang_codeCompleteGetContainerKind, [CodeCompleteResults, :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.
4914 |
# File 'lib/ffi_gen/clang.rb', line 4914 attach_function :code_complete_get_container_usr, :clang_codeCompleteGetContainerUSR, [CodeCompleteResults], String.by_value |
.code_complete_get_contexts(results) ⇒ Integer
Determines what completions are appropriate for the context the given code completion.
4888 |
# File 'lib/ffi_gen/clang.rb', line 4888 attach_function :code_complete_get_contexts, :clang_codeCompleteGetContexts, [CodeCompleteResults], :ulong_long |
.code_complete_get_diagnostic(results, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given code completion.
4878 |
# File 'lib/ffi_gen/clang.rb', line 4878 attach_function :code_complete_get_diagnostic, :clang_codeCompleteGetDiagnostic, [CodeCompleteResults, :uint], :pointer |
.code_complete_get_num_diagnostics(results) ⇒ Integer
Determine the number of diagnostics produced prior to the location where code completion was performed.
4868 |
# File 'lib/ffi_gen/clang.rb', line 4868 attach_function :code_complete_get_num_diagnostics, :clang_codeCompleteGetNumDiagnostics, [CodeCompleteResults], :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.
4926 |
# File 'lib/ffi_gen/clang.rb', line 4926 attach_function :code_complete_get_obj_c_selector, :clang_codeCompleteGetObjCSelector, [CodeCompleteResults], String.by_value |
.construct_usr_obj_c_category(class_name, category_name) ⇒ String
Construct a USR for a specified Objective-C category.
3594 |
# File 'lib/ffi_gen/clang.rb', line 3594 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.
3585 |
# File 'lib/ffi_gen/clang.rb', line 3585 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.
3612 |
# File 'lib/ffi_gen/clang.rb', line 3612 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.
3623 |
# File 'lib/ffi_gen/clang.rb', line 3623 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.
3633 |
# File 'lib/ffi_gen/clang.rb', line 3633 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.
3602 |
# File 'lib/ffi_gen/clang.rb', line 3602 attach_function :construct_usr_obj_c_protocol, :clang_constructUSR_ObjCProtocol, [:string], String.by_value |
.create_cx_cursor_set ⇒ CursorSetImpl
Creates an empty CXCursorSet.
2519 |
# File 'lib/ffi_gen/clang.rb', line 2519 attach_function :create_cx_cursor_set, :clang_createCXCursorSet, [], CursorSetImpl |
.create_index(exclude_declarations_from_pch, display_diagnostics) ⇒ FFI::Pointer(Index)
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:
code
// 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);
endcode
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).
200 |
# File 'lib/ffi_gen/clang.rb', line 200 attach_function :create_index, :clang_createIndex, [:int, :int], :pointer |
.create_translation_unit(c_idx, ast_filename) ⇒ TranslationUnitImpl
Same as c clang_createTranslationUnit2, but returns the c CXTranslationUnit instead of an error code. In case of an error this routine returns a c NULL c CXTranslationUnit, without further detailed error codes.
1039 |
# File 'lib/ffi_gen/clang.rb', line 1039 attach_function :create_translation_unit, :clang_createTranslationUnit, [:pointer, :string], TranslationUnitImpl |
.create_translation_unit2(c_idx, ast_filename, out_tu) ⇒ Symbol from _enum_error_code_
Create a translation unit from an AST file (c -emit-ast).
param(out) out_TU A non-NULL pointer to store the created c CXTranslationUnit.
1052 |
# File 'lib/ffi_gen/clang.rb', line 1052 attach_function :create_translation_unit2, :clang_createTranslationUnit2, [:pointer, :string, :pointer], :error_code |
.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)
1027 |
# File 'lib/ffi_gen/clang.rb', line 1027 attach_function :create_translation_unit_from_source_file, :clang_createTranslationUnitFromSourceFile, [:pointer, :string, :int, :pointer, :uint, UnsavedFile], TranslationUnitImpl |
.cursor_get_argument(c, i) ⇒ Cursor
Retrieve the argument cursor of a function or method.
The argument cursor can be determined for calls as well as for declarations of functions or methods. For other cursors and for invalid indices, an invalid cursor is returned.
3059 |
# File 'lib/ffi_gen/clang.rb', line 3059 attach_function :cursor_get_argument, :clang_Cursor_getArgument, [Cursor.by_value, :uint], Cursor.by_value |
.cursor_get_brief_comment_text(c) ⇒ String
Given a cursor that represents a documentable entity (e.g., declaration), return the associated paragraph; otherwise return the first paragraph.
3945 |
# File 'lib/ffi_gen/clang.rb', line 3945 attach_function :cursor_get_brief_comment_text, :clang_Cursor_getBriefCommentText, [Cursor.by_value], String.by_value |
.cursor_get_comment_range(c) ⇒ SourceRange
Given a cursor that represents a declaration, return the associated comment’s source range. The range may include multiple consecutive comments with whitespace in between.
3926 |
# File 'lib/ffi_gen/clang.rb', line 3926 attach_function :cursor_get_comment_range, :clang_Cursor_getCommentRange, [Cursor.by_value], SourceRange.by_value |
.cursor_get_module(c) ⇒ FFI::Pointer(Module)
Given a CXCursor_ModuleImportDecl cursor, return the associated module.
3953 |
# File 'lib/ffi_gen/clang.rb', line 3953 attach_function :cursor_get_module, :clang_Cursor_getModule, [Cursor.by_value], :pointer |
.cursor_get_num_arguments(c) ⇒ Integer
Retrieve the number of non-variadic arguments associated with a given cursor.
The number of arguments can be determined for calls as well as for declarations of functions or methods. For other cursors -1 is returned.
3046 |
# File 'lib/ffi_gen/clang.rb', line 3046 attach_function :cursor_get_num_arguments, :clang_Cursor_getNumArguments, [Cursor.by_value], :int |
.cursor_get_obj_c_decl_qualifiers(c) ⇒ Integer
Given a cursor that represents an Objective-C method or parameter declaration, return the associated Objective-C qualifiers for the return type or the parameter respectively. The bits are formed from CXObjCDeclQualifierKind.
3898 |
# File 'lib/ffi_gen/clang.rb', line 3898 attach_function :cursor_get_obj_c_decl_qualifiers, :clang_Cursor_getObjCDeclQualifiers, [Cursor.by_value], :uint |
.cursor_get_obj_c_property_attributes(c, reserved) ⇒ Integer
Given a cursor that represents a property declaration, return the associated property attributes. The bits are formed from c CXObjCPropertyAttrKind.
3853 |
# File 'lib/ffi_gen/clang.rb', line 3853 attach_function :cursor_get_obj_c_property_attributes, :clang_Cursor_getObjCPropertyAttributes, [Cursor.by_value, :uint], :uint |
.cursor_get_obj_c_selector_index(cursor) ⇒ Integer
If the cursor points to a selector identifier in an Objective-C method or message expression, this returns the selector index.
After getting a cursor with #clang_getCursor, this can be called to determine if the location points to a selector identifier.
3766 |
# File 'lib/ffi_gen/clang.rb', line 3766 attach_function :cursor_get_obj_c_selector_index, :clang_Cursor_getObjCSelectorIndex, [Cursor.by_value], :int |
.cursor_get_raw_comment_text(c) ⇒ String
Given a cursor that represents a declaration, return the associated comment text, including comment markers.
3935 |
# File 'lib/ffi_gen/clang.rb', line 3935 attach_function :cursor_get_raw_comment_text, :clang_Cursor_getRawCommentText, [Cursor.by_value], String.by_value |
.cursor_get_receiver_type(c) ⇒ Type
Given a cursor pointing to an Objective-C message, returns the CXType of the receiver.
3791 |
# File 'lib/ffi_gen/clang.rb', line 3791 attach_function :cursor_get_receiver_type, :clang_Cursor_getReceiverType, [Cursor.by_value], Type.by_value |
.cursor_get_spelling_name_range(cursor, piece_index, options) ⇒ SourceRange
Retrieve a range for a piece that forms the cursors spelling name. Most of the times there is only one range for the complete spelling but for Objective-C methods and Objective-C message expressions, there are multiple pieces for each selector identifier.
3655 |
# File 'lib/ffi_gen/clang.rb', line 3655 attach_function :cursor_get_spelling_name_range, :clang_Cursor_getSpellingNameRange, [Cursor.by_value, :uint, :uint], SourceRange.by_value |
.cursor_get_translation_unit(cursor) ⇒ TranslationUnitImpl
Returns the translation unit that a cursor originated from.
2507 |
# File 'lib/ffi_gen/clang.rb', line 2507 attach_function :cursor_get_translation_unit, :clang_Cursor_getTranslationUnit, [Cursor.by_value], TranslationUnitImpl |
.cursor_is_bit_field(c) ⇒ Integer
Returns non-zero if the cursor specifies a Record member that is a
bitfield.
3414 |
# File 'lib/ffi_gen/clang.rb', line 3414 attach_function :cursor_is_bit_field, :clang_Cursor_isBitField, [Cursor.by_value], :uint |
.cursor_is_dynamic_call(c) ⇒ Integer
Given a cursor pointing to a C++ method call or an Objective-C message, returns non-zero if the method/message is “dynamic”, meaning:
For a C++ method: the call is virtual. For an Objective-C message: the receiver is an object instance, not ‘super’ or a specific class.
If the method/message is “static” or the cursor does not point to a method/message, it will return zero.
3782 |
# File 'lib/ffi_gen/clang.rb', line 3782 attach_function :cursor_is_dynamic_call, :clang_Cursor_isDynamicCall, [Cursor.by_value], :int |
.cursor_is_null(cursor) ⇒ Integer
Returns non-zero if p cursor is null.
2253 |
# File 'lib/ffi_gen/clang.rb', line 2253 attach_function :cursor_is_null, :clang_Cursor_isNull, [Cursor.by_value], :int |
.cursor_is_obj_c_optional(c) ⇒ Integer
Given a cursor that represents an Objective-C method or property declaration, return non-zero if the declaration was affected by “@optional”. Returns zero if the cursor is not such a declaration or it is “@required”.
3908 |
# File 'lib/ffi_gen/clang.rb', line 3908 attach_function :cursor_is_obj_c_optional, :clang_Cursor_isObjCOptional, [Cursor.by_value], :uint |
.cursor_is_variadic(c) ⇒ Integer
Returns non-zero if the given cursor is a variadic function or method.
3916 |
# File 'lib/ffi_gen/clang.rb', line 3916 attach_function :cursor_is_variadic, :clang_Cursor_isVariadic, [Cursor.by_value], :uint |
.cx_cursor_set_contains(cset, cursor) ⇒ Integer
Queries a CXCursorSet to see if it contains a specific CXCursor.
2536 |
# File 'lib/ffi_gen/clang.rb', line 2536 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.
2545 |
# File 'lib/ffi_gen/clang.rb', line 2545 attach_function :cx_cursor_set_insert, :clang_CXCursorSet_insert, [CursorSetImpl, Cursor.by_value], :uint |
.cx_index_get_global_options(index) ⇒ Integer
Gets the general options associated with a CXIndex.
266 |
# File 'lib/ffi_gen/clang.rb', line 266 attach_function :cx_index_get_global_options, :clang_CXIndex_getGlobalOptions, [:pointer], :uint |
.cx_index_set_global_options(index, options) ⇒ nil
Sets general options associated with a CXIndex.
For example: code CXIndex idx = …; clang_CXIndex_setGlobalOptions(idx,
clang_CXIndex_getGlobalOptions(idx) |
CXGlobalOpt_ThreadBackgroundPriorityForIndexing);
endcode
257 |
# File 'lib/ffi_gen/clang.rb', line 257 attach_function :cx_index_set_global_options, :clang_CXIndex_setGlobalOptions, [:pointer, :uint], :void |
.cxx_method_is_const(c) ⇒ Integer
Determine if a C++ member function or member function template is declared ‘const’.
4061 |
# File 'lib/ffi_gen/clang.rb', line 4061 attach_function :cxx_method_is_const, :clang_CXXMethod_isConst, [Cursor.by_value], :uint |
.cxx_method_is_pure_virtual(c) ⇒ Integer
Determine if a C++ member function or member function template is pure virtual.
4033 |
# File 'lib/ffi_gen/clang.rb', line 4033 attach_function :cxx_method_is_pure_virtual, :clang_CXXMethod_isPureVirtual, [Cursor.by_value], :uint |
.cxx_method_is_static(c) ⇒ Integer
Determine if a C++ member function or member function template is declared ‘static’.
4042 |
# File 'lib/ffi_gen/clang.rb', line 4042 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.
4052 |
# File 'lib/ffi_gen/clang.rb', line 4052 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().
4778 |
# File 'lib/ffi_gen/clang.rb', line 4778 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.
855 |
# File 'lib/ffi_gen/clang.rb', line 855 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.
1156 |
# File 'lib/ffi_gen/clang.rb', line 1156 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.
1344 |
# File 'lib/ffi_gen/clang.rb', line 1344 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.
1246 |
# File 'lib/ffi_gen/clang.rb', line 1246 attach_function :default_save_options, :clang_defaultSaveOptions, [TranslationUnitImpl], :uint |
.dispose_code_complete_results(results) ⇒ nil
Free the given set of code-completion results.
4859 |
# File 'lib/ffi_gen/clang.rb', line 4859 attach_function :dispose_code_complete_results, :clang_disposeCodeCompleteResults, [CodeCompleteResults], :void |
.dispose_cx_cursor_set(cset) ⇒ nil
Disposes a CXCursorSet and releases its associated memory.
2527 |
# File 'lib/ffi_gen/clang.rb', line 2527 attach_function :dispose_cx_cursor_set, :clang_disposeCXCursorSet, [CursorSetImpl], :void |
.dispose_cx_platform_availability(availability) ⇒ nil
Free the memory associated with a c CXPlatformAvailability structure.
2467 |
# File 'lib/ffi_gen/clang.rb', line 2467 attach_function :dispose_cx_platform_availability, :clang_disposeCXPlatformAvailability, [PlatformAvailability], :void |
.dispose_cxtu_resource_usage(usage) ⇒ nil
(Not documented)
1490 |
# File 'lib/ffi_gen/clang.rb', line 1490 attach_function :dispose_cxtu_resource_usage, :clang_disposeCXTUResourceUsage, [TUResourceUsage.by_value], :void |
.dispose_diagnostic(diagnostic) ⇒ nil
Destroy a diagnostic.
768 |
# File 'lib/ffi_gen/clang.rb', line 768 attach_function :dispose_diagnostic, :clang_disposeDiagnostic, [:pointer], :void |
.dispose_diagnostic_set(diags) ⇒ nil
Release a CXDiagnosticSet and all of its contained diagnostics.
721 |
# File 'lib/ffi_gen/clang.rb', line 721 attach_function :dispose_diagnostic_set, :clang_disposeDiagnosticSet, [: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.
211 |
# File 'lib/ffi_gen/clang.rb', line 211 attach_function :dispose_index, :clang_disposeIndex, [:pointer], :void |
.dispose_overridden_cursors(overridden) ⇒ nil
Free the set of overridden cursors returned by c clang_getOverriddenCursors().
2675 |
# File 'lib/ffi_gen/clang.rb', line 2675 attach_function :dispose_overridden_cursors, :clang_disposeOverriddenCursors, [Cursor], :void |
.dispose_source_range_list(ranges) ⇒ nil
Destroy the given c CXSourceRangeList.
621 |
# File 'lib/ffi_gen/clang.rb', line 621 attach_function :dispose_source_range_list, :clang_disposeSourceRangeList, [SourceRangeList], :void |
.dispose_string(string) ⇒ nil
Free the given string.
80 |
# File 'lib/ffi_gen/clang.rb', line 80 attach_function :dispose_string, :clang_disposeString, [String.by_value], :void |
.dispose_tokens(tu, tokens, num_tokens) ⇒ nil
Free the given set of tokens.
4290 |
# File 'lib/ffi_gen/clang.rb', line 4290 attach_function :dispose_tokens, :clang_disposeTokens, [TranslationUnitImpl, Token, :uint], :void |
.dispose_translation_unit(translation_unit_impl) ⇒ nil
Destroy the specified CXTranslationUnit object.
1310 |
# File 'lib/ffi_gen/clang.rb', line 1310 attach_function :dispose_translation_unit, :clang_disposeTranslationUnit, [TranslationUnitImpl], :void |
.enable_stack_traces ⇒ nil
(Not documented)
4319 |
# File 'lib/ffi_gen/clang.rb', line 4319 attach_function :enable_stack_traces, :clang_enableStackTraces, [], :void |
.equal_cursors(cursor, cursor) ⇒ Integer
Determine whether two cursors are equivalent.
2245 |
# File 'lib/ffi_gen/clang.rb', line 2245 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.
376 |
# File 'lib/ffi_gen/clang.rb', line 376 attach_function :equal_locations, :clang_equalLocations, [SourceLocation.by_value, SourceLocation.by_value], :uint |
.equal_ranges(range1, range2) ⇒ Integer
Determine whether two ranges are equivalent.
442 |
# File 'lib/ffi_gen/clang.rb', line 442 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.
3069 |
# File 'lib/ffi_gen/clang.rb', line 3069 attach_function :equal_types, :clang_equalTypes, [Type.by_value, Type.by_value], :uint |
.execute_on_thread(fn, user_data, stack_size) ⇒ nil
(Not documented)
4329 |
# File 'lib/ffi_gen/clang.rb', line 4329 attach_function :execute_on_thread, :clang_executeOnThread, [:pointer, :pointer, :uint], :void |
.find_includes_in_file(tu, file, visitor) ⇒ Symbol from _enum_result_
Find #import/#include directives in a specific file.
5102 |
# File 'lib/ffi_gen/clang.rb', line 5102 attach_function :find_includes_in_file, :clang_findIncludesInFile, [TranslationUnitImpl, :pointer, CursorAndRangeVisitor.by_value], :result |
.find_references_in_file(cursor, file, visitor) ⇒ Symbol from _enum_result_
Find references of a declaration in a specific file.
5091 |
# File 'lib/ffi_gen/clang.rb', line 5091 attach_function :find_references_in_file, :clang_findReferencesInFile, [Cursor.by_value, :pointer, CursorAndRangeVisitor.by_value], :result |
.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.
846 |
# File 'lib/ffi_gen/clang.rb', line 846 attach_function :format_diagnostic, :clang_formatDiagnostic, [:pointer, :uint], String.by_value |
.get_arg_type(t, i) ⇒ Type
Retrieve the type of a parameter of a function type.
If a non-function type is passed in or the function does not have enough parameters, an invalid type is returned.
3187 |
# File 'lib/ffi_gen/clang.rb', line 3187 attach_function :get_arg_type, :clang_getArgType, [Type.by_value, :uint], Type.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.
3246 |
# File 'lib/ffi_gen/clang.rb', line 3246 attach_function :get_array_element_type, :clang_getArrayElementType, [Type.by_value], Type.by_value |
.get_array_size(t) ⇒ Integer
Return the array size of a constant array.
If a non-array type is passed in, -1 is returned.
3256 |
# File 'lib/ffi_gen/clang.rb', line 3256 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.
72 |
# File 'lib/ffi_gen/clang.rb', line 72 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.
3752 |
# File 'lib/ffi_gen/clang.rb', line 3752 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’.
3082 |
# File 'lib/ffi_gen/clang.rb', line 3082 attach_function :get_canonical_type, :clang_getCanonicalType, [Type.by_value], Type.by_value |
.get_child_diagnostics(d) ⇒ FFI::Pointer(DiagnosticSet)
Retrieve the child diagnostics of a CXDiagnostic.
This CXDiagnosticSet does not need to be released by clang_disposeDiagnosticSet.
732 |
# File 'lib/ffi_gen/clang.rb', line 732 attach_function :get_child_diagnostics, :clang_getChildDiagnostics, [:pointer], :pointer |
.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).
4934 |
# File 'lib/ffi_gen/clang.rb', line 4934 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.
4586 |
# File 'lib/ffi_gen/clang.rb', line 4586 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.
4565 |
# File 'lib/ffi_gen/clang.rb', line 4565 attach_function :get_completion_availability, :clang_getCompletionAvailability, [:pointer], :availability_kind |
.get_completion_brief_comment(completion_string) ⇒ String
Retrieve the brief documentation comment attached to the declaration that corresponds to the given completion string.
4611 |
# File 'lib/ffi_gen/clang.rb', line 4611 attach_function :get_completion_brief_comment, :clang_getCompletionBriefComment, [:pointer], String.by_value |
.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.
4535 |
# File 'lib/ffi_gen/clang.rb', line 4535 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.
4514 |
# File 'lib/ffi_gen/clang.rb', line 4514 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.
4524 |
# File 'lib/ffi_gen/clang.rb', line 4524 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.
4575 |
# File 'lib/ffi_gen/clang.rb', line 4575 attach_function :get_completion_num_annotations, :clang_getCompletionNumAnnotations, [:pointer], :uint |
.get_completion_parent(completion_string, kind) ⇒ String
Retrieve the parent context of the given completion string.
The parent context of a completion string is the semantic parent of the declaration (if any) that the code completion represents. For example, a code completion for an Objective-C method would have the method’s class or protocol as its context.
4602 |
# File 'lib/ffi_gen/clang.rb', line 4602 attach_function :get_completion_parent, :clang_getCompletionParent, [:pointer, :pointer], String.by_value |
.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.
4556 |
# File 'lib/ffi_gen/clang.rb', line 4556 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.
2703 |
# File 'lib/ffi_gen/clang.rb', line 2703 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, taking the current target platform into account.
2397 |
# File 'lib/ffi_gen/clang.rb', line 2397 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.
4621 |
# File 'lib/ffi_gen/clang.rb', line 4621 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.
3716 |
# File 'lib/ffi_gen/clang.rb', line 3716 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.
3667 |
# File 'lib/ffi_gen/clang.rb', line 3667 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 within 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).
2734 |
# File 'lib/ffi_gen/clang.rb', line 2734 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.
2269 |
# File 'lib/ffi_gen/clang.rb', line 2269 attach_function :get_cursor_kind, :clang_getCursorKind, [Cursor.by_value], :cursor_kind |
.get_cursor_kind_spelling(kind) ⇒ String
for debug/testing
4298 |
# File 'lib/ffi_gen/clang.rb', line 4298 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.
2499 |
# File 'lib/ffi_gen/clang.rb', line 2499 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 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.
2622 |
# File 'lib/ffi_gen/clang.rb', line 2622 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.
2388 |
# File 'lib/ffi_gen/clang.rb', line 2388 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.
2718 |
# File 'lib/ffi_gen/clang.rb', line 2718 attach_function :get_cursor_location, :clang_getCursorLocation, [Cursor.by_value], SourceLocation.by_value |
.get_cursor_platform_availability(cursor, always_deprecated, deprecated_message, always_unavailable, unavailable_message, availability, availability_size) ⇒ Integer
Determine the availability of the entity that this cursor refers to on any platforms for which availability information is known.
2459 |
# File 'lib/ffi_gen/clang.rb', line 2459 attach_function :get_cursor_platform_availability, :clang_getCursorPlatformAvailability, [Cursor.by_value, :pointer, String, :pointer, String, PlatformAvailability, :int], :int |
.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.
4127 |
# File 'lib/ffi_gen/clang.rb', line 4127 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.
3683 |
# File 'lib/ffi_gen/clang.rb', line 3683 attach_function :get_cursor_referenced, :clang_getCursorReferenced, [Cursor.by_value], Cursor.by_value |
.get_cursor_result_type(c) ⇒ Type
Retrieve the return type associated with a given cursor.
This only returns a valid type if the cursor refers to a function or method.
3205 |
# File 'lib/ffi_gen/clang.rb', line 3205 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 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.
2583 |
# File 'lib/ffi_gen/clang.rb', line 2583 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.
3641 |
# File 'lib/ffi_gen/clang.rb', line 3641 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).
2965 |
# File 'lib/ffi_gen/clang.rb', line 2965 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.
3577 |
# File 'lib/ffi_gen/clang.rb', line 3577 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().
1482 |
# File 'lib/ffi_gen/clang.rb', line 1482 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 referenced object.
If the cursor refers to a C++ declaration, its access control level within its parent scope is returned. Otherwise, if the cursor refers to a base specifier or access specifier, the specifier itself is returned.
3460 |
# File 'lib/ffi_gen/clang.rb', line 3460 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.
3136 |
# File 'lib/ffi_gen/clang.rb', line 3136 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)
4312 |
# File 'lib/ffi_gen/clang.rb', line 4312 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.
751 |
# File 'lib/ffi_gen/clang.rb', line 751 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.
907 |
# File 'lib/ffi_gen/clang.rb', line 907 attach_function :get_diagnostic_category, :clang_getDiagnosticCategory, [:pointer], :uint |
.get_diagnostic_category_name(category) ⇒ String
Retrieve the name of a particular diagnostic category. This
is now deprecated. Use clang_getDiagnosticCategoryText()
instead.
918 |
# File 'lib/ffi_gen/clang.rb', line 918 attach_function :get_diagnostic_category_name, :clang_getDiagnosticCategoryName, [:uint], String.by_value |
.get_diagnostic_category_text(diagnostic) ⇒ String
Retrieve the diagnostic category text for a given diagnostic.
926 |
# File 'lib/ffi_gen/clang.rb', line 926 attach_function :get_diagnostic_category_text, :clang_getDiagnosticCategoryText, [:pointer], 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).
981 |
# File 'lib/ffi_gen/clang.rb', line 981 attach_function :get_diagnostic_fix_it, :clang_getDiagnosticFixIt, [:pointer, :uint, SourceRange], String.by_value |
.get_diagnostic_in_set(diags, index) ⇒ FFI::Pointer(Diagnostic)
Retrieve a diagnostic associated with the given CXDiagnosticSet.
671 |
# File 'lib/ffi_gen/clang.rb', line 671 attach_function :get_diagnostic_in_set, :clang_getDiagnosticInSet, [:pointer, :uint], :pointer |
.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.
874 |
# File 'lib/ffi_gen/clang.rb', line 874 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.
957 |
# File 'lib/ffi_gen/clang.rb', line 957 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.
935 |
# File 'lib/ffi_gen/clang.rb', line 935 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.
894 |
# File 'lib/ffi_gen/clang.rb', line 894 attach_function :get_diagnostic_option, :clang_getDiagnosticOption, [:pointer, String], 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.
948 |
# File 'lib/ffi_gen/clang.rb', line 948 attach_function :get_diagnostic_range, :clang_getDiagnosticRange, [:pointer, :uint], SourceRange.by_value |
.get_diagnostic_set_from_tu(unit) ⇒ FFI::Pointer(DiagnosticSet)
Retrieve the complete set of diagnostics associated with a
translation unit.
760 |
# File 'lib/ffi_gen/clang.rb', line 760 attach_function :get_diagnostic_set_from_tu, :clang_getDiagnosticSetFromTU, [TranslationUnitImpl], :pointer |
.get_diagnostic_severity(diagnostic) ⇒ Symbol from _enum_diagnostic_severity_
Determine the severity of the given diagnostic.
863 |
# File 'lib/ffi_gen/clang.rb', line 863 attach_function :get_diagnostic_severity, :clang_getDiagnosticSeverity, [:pointer], :diagnostic_severity |
.get_diagnostic_spelling(diagnostic) ⇒ String
Retrieve the text of the given diagnostic.
882 |
# File 'lib/ffi_gen/clang.rb', line 882 attach_function :get_diagnostic_spelling, :clang_getDiagnosticSpelling, [:pointer], String.by_value |
.get_element_type(t) ⇒ Type
Return the element type of an array, complex, or vector type.
If a type is passed in that is not an array, complex, or vector type, an invalid type is returned.
3225 |
# File 'lib/ffi_gen/clang.rb', line 3225 attach_function :get_element_type, :clang_getElementType, [Type.by_value], Type.by_value |
.get_enum_constant_decl_unsigned_value(c) ⇒ Integer
Retrieve the integer value of an enum constant declaration as an unsigned
long long.
If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.
3024 |
# File 'lib/ffi_gen/clang.rb', line 3024 attach_function :get_enum_constant_decl_unsigned_value, :clang_getEnumConstantDeclUnsignedValue, [Cursor.by_value], :ulong_long |
.get_enum_constant_decl_value(c) ⇒ Integer
Retrieve the integer value of an enum constant declaration as a signed
long long.
If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. Since this is also potentially a valid constant value, the kind of the cursor must be verified before calling this function.
3011 |
# File 'lib/ffi_gen/clang.rb', line 3011 attach_function :get_enum_constant_decl_value, :clang_getEnumConstantDeclValue, [Cursor.by_value], :long_long |
.get_enum_decl_integer_type(c) ⇒ Type
Retrieve the integer type of an enum declaration.
If the cursor does not reference an enum declaration, an invalid type is returned.
2998 |
# File 'lib/ffi_gen/clang.rb', line 2998 attach_function :get_enum_decl_integer_type, :clang_getEnumDeclIntegerType, [Cursor.by_value], Type.by_value |
.get_expansion_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 expansion, retrieves the location of the macro expansion.
471 |
# File 'lib/ffi_gen/clang.rb', line 471 attach_function :get_expansion_location, :clang_getExpansionLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void |
.get_field_decl_bit_width(c) ⇒ Integer
Retrieve the bit width of a bit field declaration as an integer.
If a cursor that is not a bit field declaration is passed in, -1 is returned.
3034 |
# File 'lib/ffi_gen/clang.rb', line 3034 attach_function :get_field_decl_bit_width, :clang_getFieldDeclBitWidth, [Cursor.by_value], :int |
.get_file(tu, file_name) ⇒ FFI::Pointer(File)
Retrieve a file handle within the given translation unit.
323 |
# File 'lib/ffi_gen/clang.rb', line 323 attach_function :get_file, :clang_getFile, [TranslationUnitImpl, :string], :pointer |
.get_file_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 expansion, return where the macro was expanded or where the macro argument was written, if the location points at a macro argument.
571 |
# File 'lib/ffi_gen/clang.rb', line 571 attach_function :get_file_location, :clang_getFileLocation, [SourceLocation.by_value, :pointer, :pointer, :pointer, :pointer], :void |
.get_file_name(s_file) ⇒ String
Retrieve the complete file and path name of the given file.
274 |
# File 'lib/ffi_gen/clang.rb', line 274 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.
282 |
# File 'lib/ffi_gen/clang.rb', line 282 attach_function :get_file_time, :clang_getFileTime, [:pointer], :long |
.get_file_unique_id(file, out_id) ⇒ Integer
Retrieve the unique ID for the given c file.
302 |
# File 'lib/ffi_gen/clang.rb', line 302 attach_function :get_file_unique_id, :clang_getFileUniqueID, [:pointer, FileUniqueID], :int |
.get_function_type_calling_conv(t) ⇒ Symbol from _enum_calling_conv_
Retrieve the calling convention associated with a function type.
If a non-function type is passed in, CXCallingConv_Invalid is returned.
3154 |
# File 'lib/ffi_gen/clang.rb', line 3154 attach_function :get_function_type_calling_conv, :clang_getFunctionTypeCallingConv, [Type.by_value], :calling_conv |
.get_ib_outlet_collection_type(cursor) ⇒ Type
For cursors representing an iboutletcollection attribute,
this function returns the collection element type.
3493 |
# File 'lib/ffi_gen/clang.rb', line 3493 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.
2684 |
# File 'lib/ffi_gen/clang.rb', line 2684 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).
4977 |
# File 'lib/ffi_gen/clang.rb', line 4977 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 #clang_getExpansionLocation(). See that interface’s documentation for details.
528 |
# File 'lib/ffi_gen/clang.rb', line 528 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.
388 |
# File 'lib/ffi_gen/clang.rb', line 388 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.
399 |
# File 'lib/ffi_gen/clang.rb', line 399 attach_function :get_location_for_offset, :clang_getLocationForOffset, [TranslationUnitImpl, :pointer, :uint], SourceLocation.by_value |
.get_module_for_file(translation_unit_impl, file) ⇒ FFI::Pointer(Module)
Given a CXFile header file, return the module that contains it, if one exists.
3963 |
# File 'lib/ffi_gen/clang.rb', line 3963 attach_function :get_module_for_file, :clang_getModuleForFile, [TranslationUnitImpl, :pointer], :pointer |
.get_null_cursor ⇒ Cursor
Retrieve the NULL cursor, which represents no entity.
2225 |
# File 'lib/ffi_gen/clang.rb', line 2225 attach_function :get_null_cursor, :clang_getNullCursor, [], Cursor.by_value |
.get_null_location ⇒ SourceLocation
Retrieve a NULL (invalid) source location.
364 |
# File 'lib/ffi_gen/clang.rb', line 364 attach_function :get_null_location, :clang_getNullLocation, [], SourceLocation.by_value |
.get_null_range ⇒ SourceRange
Retrieve a NULL (invalid) source range.
423 |
# File 'lib/ffi_gen/clang.rb', line 423 attach_function :get_null_range, :clang_getNullRange, [], SourceRange.by_value |
.get_num_arg_types(t) ⇒ Integer
Retrieve the number of non-variadic parameters associated with a function type.
If a non-function type is passed in, -1 is returned.
3175 |
# File 'lib/ffi_gen/clang.rb', line 3175 attach_function :get_num_arg_types, :clang_getNumArgTypes, [Type.by_value], :int |
.get_num_completion_chunks(completion_string) ⇒ Integer
Retrieve the number of chunks in the given code-completion string.
4543 |
# File 'lib/ffi_gen/clang.rb', line 4543 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.
741 |
# File 'lib/ffi_gen/clang.rb', line 741 attach_function :get_num_diagnostics, :clang_getNumDiagnostics, [TranslationUnitImpl], :uint |
.get_num_diagnostics_in_set(diags) ⇒ Integer
Determine the number of diagnostics in a CXDiagnosticSet.
661 |
# File 'lib/ffi_gen/clang.rb', line 661 attach_function :get_num_diagnostics_in_set, :clang_getNumDiagnosticsInSet, [:pointer], :uint |
.get_num_elements(t) ⇒ Integer
Return the number of elements of an array or vector type.
If a type is passed in that is not an array or vector type, -1 is returned.
3236 |
# File 'lib/ffi_gen/clang.rb', line 3236 attach_function :get_num_elements, :clang_getNumElements, [Type.by_value], :long_long |
.get_num_overloaded_decls(cursor) ⇒ Integer
Determine the number of overloaded declarations referenced by a c CXCursor_OverloadedDeclRef cursor.
3470 |
# File 'lib/ffi_gen/clang.rb', line 3470 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.
3484 |
# File 'lib/ffi_gen/clang.rb', line 3484 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 base class, its protocols, or its categories’ protocols, 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. A method from an Objective-C implementation is considered to override the same methods as its corresponding method in the interface.
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.
2666 |
# File 'lib/ffi_gen/clang.rb', line 2666 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.
3120 |
# File 'lib/ffi_gen/clang.rb', line 3120 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
code #123 “dummy.c” 1
static int func(void)
return 0;
endcode
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
511 |
# File 'lib/ffi_gen/clang.rb', line 511 attach_function :get_presumed_location, :clang_getPresumedLocation, [SourceLocation.by_value, String, :pointer, :pointer], :void |
.get_range(begin_, end_) ⇒ SourceRange
Retrieve a source range given the beginning and ending source locations.
433 |
# File 'lib/ffi_gen/clang.rb', line 433 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.
589 |
# File 'lib/ffi_gen/clang.rb', line 589 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.
580 |
# File 'lib/ffi_gen/clang.rb', line 580 attach_function :get_range_start, :clang_getRangeStart, [SourceRange.by_value], SourceLocation.by_value |
.get_remappings(path) ⇒ FFI::Pointer(Remapping)
Retrieve a remapping.
4986 |
# File 'lib/ffi_gen/clang.rb', line 4986 attach_function :get_remappings, :clang_getRemappings, [:string], :pointer |
.get_remappings_from_file_list(file_paths, num_files) ⇒ FFI::Pointer(Remapping)
Retrieve a remapping.
4996 |
# File 'lib/ffi_gen/clang.rb', line 4996 attach_function :get_remappings_from_file_list, :clang_getRemappingsFromFileList, [:pointer, :uint], :pointer |
.get_result_type(t) ⇒ Type
Retrieve the return type associated with a function type.
If a non-function type is passed in, an invalid type is returned.
3164 |
# File 'lib/ffi_gen/clang.rb', line 3164 attach_function :get_result_type, :clang_getResultType, [Type.by_value], Type.by_value |
.get_skipped_ranges(tu, file) ⇒ SourceRangeList
Retrieve all ranges that were skipped by the preprocessor.
The preprocessor will skip lines when they are surrounded by an if/ifdef/ifndef directive whose condition does not evaluate to true.
613 |
# File 'lib/ffi_gen/clang.rb', line 613 attach_function :get_skipped_ranges, :clang_getSkippedRanges, [TranslationUnitImpl, :pointer], SourceRangeList |
.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.
4108 |
# File 'lib/ffi_gen/clang.rb', line 4108 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.
549 |
# File 'lib/ffi_gen/clang.rb', line 549 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”.
4079 |
# File 'lib/ffi_gen/clang.rb', line 4079 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.
4234 |
# File 'lib/ffi_gen/clang.rb', line 4234 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.
4204 |
# File 'lib/ffi_gen/clang.rb', line 4204 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.
4225 |
# File 'lib/ffi_gen/clang.rb', line 4225 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.
4216 |
# File 'lib/ffi_gen/clang.rb', line 4216 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.
2236 |
# File 'lib/ffi_gen/clang.rb', line 2236 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.
989 |
# File 'lib/ffi_gen/clang.rb', line 989 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.
1444 |
# File 'lib/ffi_gen/clang.rb', line 1444 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.
3128 |
# File 'lib/ffi_gen/clang.rb', line 3128 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.
3144 |
# File 'lib/ffi_gen/clang.rb', line 3144 attach_function :get_type_kind_spelling, :clang_getTypeKindSpelling, [:type_kind], String.by_value |
.get_type_spelling(ct) ⇒ String
Pretty-print the underlying type using the rules of the language of the translation unit from which it came.
If the type is invalid, an empty string is returned.
2976 |
# File 'lib/ffi_gen/clang.rb', line 2976 attach_function :get_type_spelling, :clang_getTypeSpelling, [Type.by_value], String.by_value |
.get_typedef_decl_underlying_type(c) ⇒ Type
Retrieve the underlying type of a typedef declaration.
If the cursor does not reference a typedef declaration, an invalid type is returned.
2987 |
# File 'lib/ffi_gen/clang.rb', line 2987 attach_function :get_typedef_decl_underlying_type, :clang_getTypedefDeclUnderlyingType, [Cursor.by_value], Type.by_value |
.hash_cursor(cursor) ⇒ Integer
Compute a hash value for the given cursor.
2261 |
# File 'lib/ffi_gen/clang.rb', line 2261 attach_function :hash_cursor, :clang_hashCursor, [Cursor.by_value], :uint |
.index_action_create(c_idx) ⇒ FFI::Pointer(IndexAction)
An indexing action/session, to be applied to one or multiple translation units.
5802 |
# File 'lib/ffi_gen/clang.rb', line 5802 attach_function :index_action_create, :clang_IndexAction_create, [:pointer], :pointer |
.index_action_dispose(index_action) ⇒ nil
Destroy the given index action.
The index action must not be destroyed until all of the translation units created within that index action have been destroyed.
5813 |
# File 'lib/ffi_gen/clang.rb', line 5813 attach_function :index_action_dispose, :clang_IndexAction_dispose, [:pointer], :void |
.index_get_client_container(idx_container_info) ⇒ FFI::Pointer(IdxClientContainer)
For retrieving a custom CXIdxClientContainer attached to a container.
5766 |
# File 'lib/ffi_gen/clang.rb', line 5766 attach_function :index_get_client_container, :clang_index_getClientContainer, [IdxContainerInfo], :pointer |
.index_get_client_entity(idx_entity_info) ⇒ FFI::Pointer(IdxClientEntity)
For retrieving a custom CXIdxClientEntity attached to an entity.
5784 |
# File 'lib/ffi_gen/clang.rb', line 5784 attach_function :index_get_client_entity, :clang_index_getClientEntity, [IdxEntityInfo], :pointer |
.index_get_cxx_class_decl_info(idx_decl_info) ⇒ IdxCXXClassDeclInfo
(Not documented)
5757 |
# File 'lib/ffi_gen/clang.rb', line 5757 attach_function :index_get_cxx_class_decl_info, :clang_index_getCXXClassDeclInfo, [IdxDeclInfo], IdxCXXClassDeclInfo |
.index_get_ib_outlet_collection_attr_info(idx_attr_info) ⇒ IdxIBOutletCollectionAttrInfo
(Not documented)
5749 |
# File 'lib/ffi_gen/clang.rb', line 5749 attach_function :index_get_ib_outlet_collection_attr_info, :clang_index_getIBOutletCollectionAttrInfo, [IdxAttrInfo], IdxIBOutletCollectionAttrInfo |
.index_get_obj_c_category_decl_info(idx_decl_info) ⇒ IdxObjCCategoryDeclInfo
(Not documented)
5725 |
# File 'lib/ffi_gen/clang.rb', line 5725 attach_function :index_get_obj_c_category_decl_info, :clang_index_getObjCCategoryDeclInfo, [IdxDeclInfo], IdxObjCCategoryDeclInfo |
.index_get_obj_c_container_decl_info(idx_decl_info) ⇒ IdxObjCContainerDeclInfo
(Not documented)
5709 |
# File 'lib/ffi_gen/clang.rb', line 5709 attach_function :index_get_obj_c_container_decl_info, :clang_index_getObjCContainerDeclInfo, [IdxDeclInfo], IdxObjCContainerDeclInfo |
.index_get_obj_c_interface_decl_info(idx_decl_info) ⇒ IdxObjCInterfaceDeclInfo
(Not documented)
5717 |
# File 'lib/ffi_gen/clang.rb', line 5717 attach_function :index_get_obj_c_interface_decl_info, :clang_index_getObjCInterfaceDeclInfo, [IdxDeclInfo], IdxObjCInterfaceDeclInfo |
.index_get_obj_c_property_decl_info(idx_decl_info) ⇒ IdxObjCPropertyDeclInfo
(Not documented)
5741 |
# File 'lib/ffi_gen/clang.rb', line 5741 attach_function :index_get_obj_c_property_decl_info, :clang_index_getObjCPropertyDeclInfo, [IdxDeclInfo], IdxObjCPropertyDeclInfo |
.index_get_obj_c_protocol_ref_list_info(idx_decl_info) ⇒ IdxObjCProtocolRefListInfo
(Not documented)
5733 |
# File 'lib/ffi_gen/clang.rb', line 5733 attach_function :index_get_obj_c_protocol_ref_list_info, :clang_index_getObjCProtocolRefListInfo, [IdxDeclInfo], IdxObjCProtocolRefListInfo |
.index_is_entity_obj_c_container_kind(idx_entity_kind) ⇒ Integer
(Not documented)
5701 |
# File 'lib/ffi_gen/clang.rb', line 5701 attach_function :index_is_entity_obj_c_container_kind, :clang_index_isEntityObjCContainerKind, [:idx_entity_kind], :int |
.index_loc_get_cx_source_location(loc) ⇒ SourceLocation
Retrieve the CXSourceLocation represented by the given CXIdxLoc.
5930 |
# File 'lib/ffi_gen/clang.rb', line 5930 attach_function :index_loc_get_cx_source_location, :clang_indexLoc_getCXSourceLocation, [IdxLoc.by_value], SourceLocation.by_value |
.index_loc_get_file_location(loc, index_file, file, line, column, offset) ⇒ nil
Retrieve the CXIdxFile, file, line, column, and offset represented by the given CXIdxLoc.
If the location refers into a macro expansion, retrieves the location of the macro expansion and if it refers into a macro argument retrieves the location of the argument.
5922 |
# File 'lib/ffi_gen/clang.rb', line 5922 attach_function :index_loc_get_file_location, :clang_indexLoc_getFileLocation, [IdxLoc.by_value, :pointer, :pointer, :pointer, :pointer, :pointer], :void |
.index_set_client_container(idx_container_info, idx_client_container) ⇒ nil
For setting a custom CXIdxClientContainer attached to a container.
5776 |
# File 'lib/ffi_gen/clang.rb', line 5776 attach_function :index_set_client_container, :clang_index_setClientContainer, [IdxContainerInfo, :pointer], :void |
.index_set_client_entity(idx_entity_info, idx_client_entity) ⇒ nil
For setting a custom CXIdxClientEntity attached to an entity.
5793 |
# File 'lib/ffi_gen/clang.rb', line 5793 attach_function :index_set_client_entity, :clang_index_setClientEntity, [IdxEntityInfo, :pointer], :void |
.index_source_file(index_action, client_data, index_callbacks, index_callbacks_size, index_options, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, out_tu, tu_options) ⇒ Integer
Index the given source file and the translation unit corresponding to that file via callbacks implemented through #IndexerCallbacks.
5880 |
# File 'lib/ffi_gen/clang.rb', line 5880 attach_function :index_source_file, :clang_indexSourceFile, [:pointer, :pointer, IndexerCallbacks, :uint, :uint, :string, :pointer, :int, UnsavedFile, :uint, :pointer, :uint], :int |
.index_translation_unit(index_action, client_data, index_callbacks, index_callbacks_size, index_options, translation_unit_impl) ⇒ Integer
Index the given translation unit via callbacks implemented through #IndexerCallbacks.
The order of callback invocations is not guaranteed to be the same as when indexing a source file. The high level order will be:
-Preprocessor callbacks invocations
-Declaration/reference callbacks invocations
-Diagnostic callback invocations
The parameters are the same as #clang_indexSourceFile.
5904 |
# File 'lib/ffi_gen/clang.rb', line 5904 attach_function :index_translation_unit, :clang_indexTranslationUnit, [:pointer, :pointer, IndexerCallbacks, :uint, :uint, TranslationUnitImpl], :int |
.is_attribute(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an attribute.
2314 |
# File 'lib/ffi_gen/clang.rb', line 2314 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.
3092 |
# File 'lib/ffi_gen/clang.rb', line 3092 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.
3725 |
# File 'lib/ffi_gen/clang.rb', line 3725 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.
2277 |
# File 'lib/ffi_gen/clang.rb', line 2277 attach_function :is_declaration, :clang_isDeclaration, [:cursor_kind], :uint |
.is_expression(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an expression.
2298 |
# File 'lib/ffi_gen/clang.rb', line 2298 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.
313 |
# File 'lib/ffi_gen/clang.rb', line 313 attach_function :is_file_multiple_include_guarded, :clang_isFileMultipleIncludeGuarded, [TranslationUnitImpl, :pointer], :uint |
.is_function_type_variadic(t) ⇒ Integer
Return 1 if the CXType is a variadic function type, and 0 otherwise.
3195 |
# File 'lib/ffi_gen/clang.rb', line 3195 attach_function :is_function_type_variadic, :clang_isFunctionTypeVariadic, [Type.by_value], :uint |
.is_invalid(cursor_kind) ⇒ Integer
Determine whether the given cursor kind represents an invalid cursor.
2323 |
# File 'lib/ffi_gen/clang.rb', line 2323 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.
3214 |
# File 'lib/ffi_gen/clang.rb', line 3214 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.
2341 |
# File 'lib/ffi_gen/clang.rb', line 2341 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.
2290 |
# File 'lib/ffi_gen/clang.rb', line 2290 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.
3112 |
# File 'lib/ffi_gen/clang.rb', line 3112 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.
2306 |
# File 'lib/ffi_gen/clang.rb', line 2306 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.
2332 |
# File 'lib/ffi_gen/clang.rb', line 2332 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).
2350 |
# File 'lib/ffi_gen/clang.rb', line 2350 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.
3423 |
# File 'lib/ffi_gen/clang.rb', line 3423 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.
3102 |
# File 'lib/ffi_gen/clang.rb', line 3102 attach_function :is_volatile_qualified_type, :clang_isVolatileQualifiedType, [Type.by_value], :uint |
.load_diagnostics(file, error, error_string) ⇒ FFI::Pointer(DiagnosticSet)
Deserialize a set of diagnostics from a Clang diagnostics bitcode file.
713 |
# File 'lib/ffi_gen/clang.rb', line 713 attach_function :load_diagnostics, :clang_loadDiagnostics, [:string, :pointer, String], :pointer |
.location_is_from_main_file(location) ⇒ Integer
Returns non-zero if the given source location is in the main file of the corresponding translation unit.
416 |
# File 'lib/ffi_gen/clang.rb', line 416 attach_function :location_is_from_main_file, :clang_Location_isFromMainFile, [SourceLocation.by_value], :int |
.location_is_in_system_header(location) ⇒ Integer
Returns non-zero if the given source location is in a system header.
407 |
# File 'lib/ffi_gen/clang.rb', line 407 attach_function :location_is_in_system_header, :clang_Location_isInSystemHeader, [SourceLocation.by_value], :int |
.module_get_ast_file(module_) ⇒ FFI::Pointer(File)
(Not documented)
3971 |
# File 'lib/ffi_gen/clang.rb', line 3971 attach_function :module_get_ast_file, :clang_Module_getASTFile, [:pointer], :pointer |
.module_get_full_name(module_) ⇒ String
(Not documented)
3997 |
# File 'lib/ffi_gen/clang.rb', line 3997 attach_function :module_get_full_name, :clang_Module_getFullName, [:pointer], String.by_value |
.module_get_name(module_) ⇒ String
(Not documented)
3989 |
# File 'lib/ffi_gen/clang.rb', line 3989 attach_function :module_get_name, :clang_Module_getName, [:pointer], String.by_value |
.module_get_num_top_level_headers(translation_unit_impl, module_) ⇒ Integer
(Not documented)
4014 |
# File 'lib/ffi_gen/clang.rb', line 4014 attach_function :module_get_num_top_level_headers, :clang_Module_getNumTopLevelHeaders, [TranslationUnitImpl, :pointer], :uint |
.module_get_parent(module_) ⇒ FFI::Pointer(Module)
(Not documented)
3980 |
# File 'lib/ffi_gen/clang.rb', line 3980 attach_function :module_get_parent, :clang_Module_getParent, [:pointer], :pointer |
.module_get_top_level_header(translation_unit_impl, module_, index) ⇒ FFI::Pointer(File)
(Not documented)
4024 |
# File 'lib/ffi_gen/clang.rb', line 4024 attach_function :module_get_top_level_header, :clang_Module_getTopLevelHeader, [TranslationUnitImpl, :pointer, :uint], :pointer |
.module_is_system(module_) ⇒ Integer
(Not documented)
4005 |
# File 'lib/ffi_gen/clang.rb', line 4005 attach_function :module_is_system, :clang_Module_isSystem, [:pointer], :int |
.parse_translation_unit(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options) ⇒ TranslationUnitImpl
Same as c clang_parseTranslationUnit2, but returns the c CXTranslationUnit instead of an error code. In case of an error this routine returns a c NULL c CXTranslationUnit, without further detailed error codes.
1173 |
# File 'lib/ffi_gen/clang.rb', line 1173 attach_function :parse_translation_unit, :clang_parseTranslationUnit, [:pointer, :string, :pointer, :int, UnsavedFile, :uint, :uint], TranslationUnitImpl |
.parse_translation_unit2(c_idx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options, out_tu) ⇒ Symbol from _enum_error_code_
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.
1213 |
# File 'lib/ffi_gen/clang.rb', line 1213 attach_function :parse_translation_unit2, :clang_parseTranslationUnit2, [:pointer, :string, :pointer, :int, UnsavedFile, :uint, :uint, :pointer], :error_code |
.range_is_null(range) ⇒ Integer
Returns non-zero if p range is null.
450 |
# File 'lib/ffi_gen/clang.rb', line 450 attach_function :range_is_null, :clang_Range_isNull, [SourceRange.by_value], :int |
.remap_dispose(remapping) ⇒ nil
Dispose the remapping.
5024 |
# File 'lib/ffi_gen/clang.rb', line 5024 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.
5016 |
# File 'lib/ffi_gen/clang.rb', line 5016 attach_function :remap_get_filenames, :clang_remap_getFilenames, [:pointer, :uint, String, String], :void |
.remap_get_num_files(remapping) ⇒ Integer
Determine the number of remappings.
5004 |
# File 'lib/ffi_gen/clang.rb', line 5004 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.
1381 |
# File 'lib/ffi_gen/clang.rb', line 1381 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.
1302 |
# File 'lib/ffi_gen/clang.rb', line 1302 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.
4851 |
# File 'lib/ffi_gen/clang.rb', line 4851 attach_function :sort_code_completion_results, :clang_sortCodeCompletionResults, [CompletionResult, :uint], :void |
.toggle_crash_recovery(is_enabled) ⇒ nil
Enable/disable crash recovery.
4943 |
# File 'lib/ffi_gen/clang.rb', line 4943 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.
4250 |
# File 'lib/ffi_gen/clang.rb', line 4250 attach_function :tokenize, :clang_tokenize, [TranslationUnitImpl, SourceRange.by_value, :pointer, :pointer], :void |
.type_get_align_of(t) ⇒ Integer
Return the alignment of a type in bytes as per C++(expr.alignof)
standard.
If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
is returned.
If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
returned.
If the type declaration is not a constant size type,
CXTypeLayoutError_NotConstantSize is returned.
3305 |
# File 'lib/ffi_gen/clang.rb', line 3305 attach_function :type_get_align_of, :clang_Type_getAlignOf, [Type.by_value], :long_long |
.type_get_class_type(t) ⇒ Type
Return the class type of an member pointer type.
If a non-member-pointer type is passed in, an invalid type is returned.
3315 |
# File 'lib/ffi_gen/clang.rb', line 3315 attach_function :type_get_class_type, :clang_Type_getClassType, [Type.by_value], Type.by_value |
.type_get_cxx_ref_qualifier(t) ⇒ Symbol from _enum_ref_qualifier_kind_
Retrieve the ref-qualifier kind of a function or method.
The ref-qualifier is returned for C++ functions or methods. For other types or non-C++ declarations, CXRefQualifier_None is returned.
3405 |
# File 'lib/ffi_gen/clang.rb', line 3405 attach_function :type_get_cxx_ref_qualifier, :clang_Type_getCXXRefQualifier, [Type.by_value], :ref_qualifier_kind |
.type_get_num_template_arguments(t) ⇒ Integer
Returns the number of template arguments for given class template specialization, or -1 if type c T is not a class template specialization.
Variadic argument packs count as only one argument, and can not be inspected further.
3381 |
# File 'lib/ffi_gen/clang.rb', line 3381 attach_function :type_get_num_template_arguments, :clang_Type_getNumTemplateArguments, [Type.by_value], :int |
.type_get_offset_of(t, s) ⇒ Integer
Return the offset of a field named S in a record of type T in bits
as it would be returned by __offsetof__ as per C++11(18.2p4)
If the cursor is not a record field declaration, CXTypeLayoutError_Invalid
is returned.
If the field’s type declaration is an incomplete type,
CXTypeLayoutError_Incomplete is returned.
If the field’s type declaration is a dependent type,
CXTypeLayoutError_Dependent is returned.
If the field’s name S is not found,
CXTypeLayoutError_InvalidFieldName is returned.
3348 |
# File 'lib/ffi_gen/clang.rb', line 3348 attach_function :type_get_offset_of, :clang_Type_getOffsetOf, [Type.by_value, :string], :long_long |
.type_get_size_of(t) ⇒ Integer
Return the size of a type in bytes as per C++(expr.sizeof) standard.
If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete
is returned.
If the type declaration is a dependent type, CXTypeLayoutError_Dependent is
returned.
3329 |
# File 'lib/ffi_gen/clang.rb', line 3329 attach_function :type_get_size_of, :clang_Type_getSizeOf, [Type.by_value], :long_long |
.type_get_template_argument_as_type(t, i) ⇒ Type
Returns the type template argument of a template class specialization at given index.
This function only returns template type arguments and does not handle template template arguments or variadic packs.
3394 |
# File 'lib/ffi_gen/clang.rb', line 3394 attach_function :type_get_template_argument_as_type, :clang_Type_getTemplateArgumentAsType, [Type.by_value, :uint], Type.by_value |
.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.
3563 |
# File 'lib/ffi_gen/clang.rb', line 3563 attach_function :visit_children, :clang_visitChildren, [Cursor.by_value, :cursor_visitor, :pointer], :uint |
Instance Method Details
#cindex_version_stringize(major, minor) ⇒ Object
19 20 21 |
# File 'lib/ffi_gen/clang.rb', line 19 def cindex_version_stringize(major, minor) cindex_version_stringize(major, minor) end |