/// <summary>
        /// Gets files in directory dir (and all subdirectories) where the filename matches pattern
        /// </summary>
        /// <param name="dir"></param>
        /// <param name="pattern"></param>
        /// <returns></returns>
        private static List <string> getFiles(string dir, string pattern)
        {
            Files.Files   fileClass = new Files.Files(new string[] { dir, pattern, "-r" });
            List <string> filenames = fileClass.GetFiles;

            return(filenames);
        }
예제 #2
0
 public AppController()
 {
     Settings = new AppSettings();
     Files    = new Files.Files();
     Patcher  = new Patcher(this);
     _wc      = new WebClient();
     _wc.DownloadProgressChanged += (sender, args) => { FileDownloadProgressChanged?.Invoke(this, new FileDownloadProgressEventArgs(args.ProgressPercentage)); };
 }
예제 #3
0
        /// <summary>
        /// Crea los directorios y archivos que lleven consigo
        /// </summary>
        private void Ejecutar()
        {
            if (this.bandera)
            {
                var aux = new Files.Files().CrearDirectorio(this.DirectorioActual, this.DirectorioAcumulado[0]);

                if (!String.IsNullOrEmpty(aux))
                {
                    //char temp01 = (char) 97;
                    //for (int i = 0; i < 2; i++)
                    //{
                    new Files.Files().GenerarYAbrir(aux, this.archivo[0] /*+ temp01++*/, this.archivo[2], this.archivo[1], false);
                    //}
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Capture all Functions from VC Code DB
        /// </summary>
        /// <param name="dataSource"></param>
        /// <param name="files"></param>
        /// <param name="rep"></param>
        public Functions(string dataSource, Files.Files files, EA.Repository rep)
        {
            _rep   = rep;
            _files = files;
            // Check data Source

            SQLite sqlLite = new SQLite(dataSource);
            var    reader  = sqlLite.ExecuteSql(_sql);

            if (reader == null)
            {
                return;
            }
            Dictionary <string, ParameterItem> parList = new Dictionary <string, ParameterItem>();
            string filePath        = "";
            string returnValue     = "";
            string oldFunctionName = "";
            bool   isStatic        = false;

            //
            // 0: File
            // 1: FunctionName
            // 2: ReturnValue
            // 3: ParameterName
            // 4: ParameterType
            // 5: ParameterNumber
            while (reader.Read())
            {
                string functionName = reader[0].ToString();

                // new function
                if (oldFunctionName != functionName)
                {
                    if (oldFunctionName != "")
                    {
                        AddFunction(filePath, oldFunctionName, returnValue, false, parameterDictionaryToList(parList));
                        parList = new Dictionary <string, ParameterItem>();
                    }
                }
                // Function
                oldFunctionName = functionName;
                filePath        = reader[1].ToString();

                // Add parameter
                returnValue = reader[2].ToString();
                isStatic    = false;
                if (returnValue.StartsWith("static"))
                {
                    isStatic    = true;
                    returnValue = returnValue.Substring(6).Trim();
                }


                string parName = reader[3].ToString();
                if (parName.Trim() != "")
                {
                    string parType = reader[4].ToString().Replace("\u0001", "").Trim();
                    bool   isConst = false;
                    if (parType.StartsWith("const"))
                    {
                        isConst = true;
                        parType = parType.Substring(6).Trim();
                    }
                    int index = 1;
                    while (parList.ContainsKey(parName))
                    {
                        parName = $"{parName}_{index}";
                        index   = index + 1;
                    }
                    int parPos = Int32.Parse(reader[5].ToString());
                    parList.Add(parName, new ParameterItem(parPos, parName, parType, isConst));
                }
            }
            AddFunction(filePath, oldFunctionName, returnValue, isStatic, parameterDictionaryToList(parList));
            sqlLite.EndSql();
        }
예제 #5
0
 public Functions(Files.Files files, EA.Repository rep)
 {
     _rep   = rep;
     _files = files;
 }