Module: FFI::Clang::Lib
- Extended by:
- Library
- Defined in:
- lib/ffi/clang/lib.rb,
lib/ffi/clang/lib/file.rb,
lib/ffi/clang/lib/type.rb,
lib/ffi/clang/lib/index.rb,
lib/ffi/clang/lib/token.rb,
lib/ffi/clang/lib/cursor.rb,
lib/ffi/clang/lib/string.rb,
lib/ffi/clang/lib/comment.rb,
lib/ffi/clang/lib/indexing.rb,
lib/ffi/clang/lib/cursor_set.rb,
lib/ffi/clang/lib/diagnostic.rb,
lib/ffi/clang/lib/evaluation.rb,
lib/ffi/clang/lib/inclusions.rb,
lib/ffi/clang/lib/source_range.rb,
lib/ffi/clang/lib/clang_version.rb,
lib/ffi/clang/lib/code_completion.rb,
lib/ffi/clang/lib/printing_policy.rb,
lib/ffi/clang/lib/source_location.rb,
lib/ffi/clang/lib/translation_unit.rb,
lib/ffi/clang/lib/compilation_database.rb
Defined Under Namespace
Classes: CXCodeCompleteResults, CXComment, CXCompletionResult, CXCursor, CXCursorAndRangeVisitor, CXFileUniqueID, CXIdxAttrInfo, CXIdxBaseClassInfo, CXIdxCXXClassDeclInfo, CXIdxContainerInfo, CXIdxDeclInfo, CXIdxEntityInfo, CXIdxEntityRefInfo, CXIdxIBOutletCollectionAttrInfo, CXIdxImportedASTFileInfo, CXIdxIncludedFileInfo, CXIdxLoc, CXIdxObjCCategoryDeclInfo, CXIdxObjCContainerDeclInfo, CXIdxObjCInterfaceDeclInfo, CXIdxObjCPropertyDeclInfo, CXIdxObjCProtocolRefInfo, CXIdxObjCProtocolRefListInfo, CXIndexOptions, CXPlatformAvailability, CXSourceLocation, CXSourceRange, CXSourceRangeList, CXString, CXStringSet, CXTUResourceUsage, CXTUResourceUsageEntry, CXToken, CXType, CXUnsavedFile, CXVersion, IndexerCallbacks, TokensPointer
Constant Summary collapse
- GlobalOptFlags =
enum [ :none, 0x0, :thread_background_priority_for_indexing, 0x1, :thread_background_priority_for_editing, 0x2, :thread_background_priority_for_all, 0x3 ]
- CXChoice =
enum(FFI::Type::UINT8, [ :default, 0, :enabled, 1, :disabled, 2 ])
- CUSOR_TRANSLATION_UNIT =
In Clang 15 the enum value changed from 300 to 350!
Clang.clang_version < Gem::Version.new("15.0.0") ? 300 : 350
- NameRefFlags =
enum [ :want_qualifier, 0x1, :want_template_args, 0x2, :want_single_piece, 0x4 ]
- IdxEntityKind =
enum :idx_entity_kind, [ :unexposed, 0, :typedef, 1, :function, 2, :variable, 3, :field, 4, :enum_constant, 5, :objc_class, 6, :objc_protocol, 7, :objc_category, 8, :objc_instance_method, 9, :objc_class_method, 10, :objc_property, 11, :objc_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, :cxx_concept, 27 ]
- IdxEntityLanguage =
enum :idx_entity_language, [ :none, 0, :c, 1, :objc, 2, :cxx, 3, :swift, 4 ]
- IdxEntityCXXTemplateKind =
enum :idx_entity_cxx_template_kind, [ :non_template, 0, :template, 1, :template_partial_specialization, 2, :template_specialization, 3 ]
- IdxAttrKind =
enum :idx_attr_kind, [ :unexposed, 0, :ib_action, 1, :ib_outlet, 2, :ib_outlet_collection, 3 ]
- IdxDeclInfoFlags =
enum :idx_decl_info_flags, [ :skipped, 0x1 ]
- IdxObjCContainerKind =
enum :idx_objc_container_kind, [ :forward_ref, 0, :interface, 1, :implementation, 2 ]
- IdxEntityRefKind =
enum :idx_entity_ref_kind, [ :direct, 1, :implicit, 2 ]
- SymbolRole =
enum :symbol_role, [ :none, 0, :declaration, 1 << 0, :definition, 1 << 1, :reference, 1 << 2, :read, 1 << 3, :write, 1 << 4, :call, 1 << 5, :dynamic, 1 << 6, :address_of, 1 << 7, :implicit, 1 << 8 ]
- IndexOptFlags =
enum [ :none, 0x0, :suppress_redundant_refs, 0x1, :index_function_local_symbols, 0x2, :index_implicit_template_instantiations, 0x4, :suppress_warnings, 0x8, :skip_parsed_bodies_in_session, 0x10 ]
- DiagnosticDisplayOptions =
enum [ :source_location, 0x01, :column, 0x02, :source_ranges, 0x04, :option, 0x08, :category_id, 0x10, :category_name , 0x20, ]
- CodeCompleteFlags =
enum :code_complete_flags, [ :include_macros, 0x01, :include_code_patterns, 0x02, :include_brief_comments, 0x04, :skip_preamble, 0x08, :include_completions_with_fix_its, 0x10 ]
- CompletionContext =
enum :completion_context, [ :unexposed, 0, :any_type, 1 << 0, :any_value, 1 << 1, :objc_object_value, 1 << 2, :objc_selector_value, 1 << 3, :cxx_class_type_value, 1 << 4, :dot_member_access, 1 << 5, :arrow_member_access, 1 << 6, :objc_property_access, 1 << 7, :enum_tag, 1 << 8, :union_tag, 1 << 9, :struct_tag, 1 << 10, :class_tag, 1 << 11, :namespace, 1 << 12, :nested_name_specifier, 1 << 13, :objc_interface, 1 << 14, :objc_protocol, 1 << 15, :objc_category, 1 << 16, :objc_instance_message, 1 << 17, :objc_class_message, 1 << 18, :objc_selector_name, 1 << 19, :macro_name, 1 << 20, :natural_language, 1 << 21, :included_file, 1 << 22, :unknown, ((1 << 23) - 1), ]
- PrintingPolicyProperty =
enum [ :printing_policy_indentation, :printing_policy_suppress_specifiers, :printing_policy_suppress_tag_keyword, :printing_policy_include_tag_definition, :printing_policy_suppress_scope, :printing_policy_suppress_unwritten_scope, :printing_policy_suppress_initializers, :printing_policy_constant_array_size_as_written, :printing_policy_anonymous_tag_locations, :printing_policy_suppress_strong_lifetime, :printing_policy_suppress_lifetime_qualifiers, :printing_policy_suppress_template_args_in_cxx_constructors, :printing_policy_bool, :printing_policy_restrict, :printing_policy_alignof, :printing_policy_underscore_alignof, :printing_policy_use_void_for_zero_params, :printing_policy_terse_output, :printing_policy_polish_for_declaration, :printing_policy_half, :printing_policy_msw_char, :printing_policy_include_new_lines, :printing_policy_msvc_formatting, :printing_policy_constants_as_written, :printing_policy_suppress_implicit_base, :printing_policy_fully_qualified_name, :printing_policy_last_property ]
- TranslationUnitFlags =
enum [ :none, 0x0, :detailed_preprocessing_record, 0x01, :incomplete, 0x02, :precompiled_preamble, 0x04, :cache_completion_results, 0x08, :for_serialization, 0x10, :cxx_chained_pch, 0x20, :skip_function_bodies, 0x40, :include_brief_comments_in_code_completion, 0x80, :create_preamble_on_first_parse, 0x100, :keep_going, 0x200, :single_file_parse, 0x400, :limit_skip_function_bodies_to_preamble, 0x800, :include_attributed_type, 0x1000, :visit_implicit_attributes, 0x2000, :ignore_non_errors_from_included_files, 0x4000, :retain_excluded_conditional_blocks, 0x8000, ]
- SaveTranslationUnitFlags =
enum [ :save_translation_unit_none, 0x0, ]
- SaveError =
enum [ :none, 0, :unknown, 1, :translation_errors, 2, :invalid_translation_unit, 3 ]
- ReparseFlags =
enum [ :none, 0x0, ]
- ErrorCodes =
enum [ :cx_error_success, 0, :cx_error_failure, 1, :cx_error_crashed, 2, :cx_error_invalid_arguments, 3, :cx_error_ast_read_error, 4, ]
- CompilationDatabaseError =
enum [ :no_error, 0, :can_not_load_database, 1, ]
Class Method Summary collapse
-
.args ⇒ Object
The platform-specific clang configuration.
-
.bitmask_from(enum, opts) ⇒ Object
Convert an options hash to a bitmask for libclang enums.
-
.extract_string(cxstring) ⇒ Object
Extract a Ruby string from a CXString and dispose of the CXString.
-
.opts_from(enum, bitmask) ⇒ Object
Convert a bitmask to an array of option symbols.
Class Method Details
.args ⇒ Object
The platform-specific clang configuration.
45 46 47 |
# File 'lib/ffi/clang/lib.rb', line 45 def self.args @args end |
.bitmask_from(enum, opts) ⇒ Object
Convert an options hash to a bitmask for libclang enums.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ffi/clang/lib.rb', line 54 def self.bitmask_from(enum, opts) bitmask = 0 opts.each do |symbol| if int = enum[symbol] bitmask |= int else raise Error, "unknown option: #{symbol}, expected one of #{enum.symbols}" end end bitmask end |
.extract_string(cxstring) ⇒ Object
Extract a Ruby string from a CXString and dispose of the CXString.
35 36 37 38 39 40 |
# File 'lib/ffi/clang/lib/string.rb', line 35 def self.extract_string(cxstring) result = get_string(cxstring) dispose_string cxstring return result end |
.opts_from(enum, bitmask) ⇒ Object
Convert a bitmask to an array of option symbols.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/ffi/clang/lib.rb', line 73 def self.opts_from(enum, bitmask) bit = 1 result = [] while bitmask != 0 if bitmask & 1 if symbol = enum[bit] result << symbol else raise(Error, "unknown values: #{bit}, expected one of #{enum.symbols}") end end bitmask >>= 1 bit <<= 1 end result end |