Example #1
0
        private ParsedClass FindAndParse(SearchTask task, string storeResultDir, bool enablePrint)
        {
            switch (task.Converter)
            {
            case KnownConverter.ApiConverter:
            {
                var converted = _apiConverter.FindAndParse(task, new[] { ".hpp" }, true);
                if (enablePrint && converted != null)
                {
                    var absPathToFile = task.FullPath.Remove(0, task.SearchDir.Length);
                    _apiConverter.PrintToFile(converted, task.SearchDir, absPathToFile, storeResultDir);
                }
                return(converted);
            }

            case KnownConverter.StructConverter:
            {
                var converted = _structConverter.FindAndParse(task, new[] { ".cpp", ".hpp" }, false);
                if (enablePrint && converted != null)
                {
                    var absPathToFile = task.FullPath.Remove(0, task.SearchDir.Length);
                    _structConverter.PrintToFile(converted, task.SearchDir, absPathToFile, storeResultDir);
                }
                return(converted);
            }
            }
            return(null);
        }