예제 #1
0
        private CSharpConverter(CSharpConverterOptions options)
        {
            Options               = options ?? throw new ArgumentNullException(nameof(options));
            _mapCppToCSharp       = new Dictionary <CppElement, CSharpElement>(CppElementReferenceEqualityComparer.Default);
            _cppElementsToDiscard = new HashSet <CppElement>(CppElementReferenceEqualityComparer.Default);
            _csTempWriter         = new CodeWriter(new CodeWriterOptions(null));
            Tags = new Dictionary <string, object>();

            _currentContainers = new Stack <ICSharpContainer>();

            _pipeline = new CSharpConverterPipeline(options);
            _pipeline.RegisterPlugins(this);
        }
예제 #2
0
        public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
        {
            var cachedRules = GetCachedRules(converter);

            // Register to the pipeline only we have anything to process
            if (!cachedRules.IsEmpty)
            {
                if (cachedRules.MacroRules.Count > 0 || cachedRules.TypesToCompile.Count > 0)
                {
                    pipeline.AfterPreprocessing.Add(AfterPreprocessing);
                }

                pipeline.ConvertBegin.Add(ProcessTypedefs);
                pipeline.Converting.Add(ProcessCppElementMappingRules);
                pipeline.Converted.Add(ProcessCSharpElementMappingRules);
            }
        }
예제 #3
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.TypedefConverters.Add(ConvertTypedef);
 }
 /// <inheritdoc />
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.ClassConverters.Add(ConvertClass);
 }
예제 #5
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.GetCSharpNameResolvers.Add(DefaultGetCSharpName);
 }
 /// <inheritdoc />
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.ParameterConverters.Add(ConvertParameter);
 }
예제 #7
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.FieldConverters.Add(ConvertField);
 }
예제 #8
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.FunctionTypeConverters.Add(ConvertAnonymousFunctionType);
 }
예제 #9
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.GetCSharpContainerResolvers.Add(GetSharpContainer);
 }
 /// <inheritdoc />
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.FunctionConverters.Add(ConvertFunction);
 }
예제 #11
0
 /// <inheritdoc />
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.GetCSharpTypeResolvers.Add(GetCSharpType);
 }
 /// <inheritdoc />
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.CommentConverters.Add(ConvertComment);
 }
예제 #13
0
 public void Register(CSharpConverter converter, CSharpConverterPipeline pipeline)
 {
     pipeline.Converted.Add(AddDefaultDllImport);
 }