Exemplo n.º 1
0
        private void ScanClassDirectory(ClassContext currentContext, string directory)
        {
            var files = Directory.GetFiles(directory, "*.m");

            foreach (var fileName in files)
            {
                ScanMethod(currentContext, fileName);
            }

            var subDirectories = Directory.GetDirectories(directory);

            foreach (var subDirectory in subDirectories)
            {
                var lastName = subDirectory.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Last();
                if (lastName == "private")
                {
                    ScanPrivateDirectory(currentContext, subDirectory);
                    continue;
                }
                var packageName = GetPackageNameFromFolder(lastName);
                if (packageName != null)
                {
                    Console.WriteLine($"A PACKAGE INSIDE A CLASS WHAT TO DO? {subDirectory}");
                    continue;
                }

                var className = GetClassNameFromFolder(lastName);
                if (className != null)
                {
                    currentContext.SubClasses[className] = new ClassContext(className);
                    ScanClassDirectory(currentContext.SubClasses[className], subDirectory);
                    continue;
                }
                ScanClassDirectory(currentContext, subDirectory); // Should this really work?
            }
        }
Exemplo n.º 2
0
        private void ScanPrivateMethod(ClassContext context, string fileName)
        {
            var methodName = Path.GetFileNameWithoutExtension(fileName);

            context.PrivateMethods[methodName] = new FunctionContext(fileName);
        }