Exemple #1
0
        //------------------------------------------------------------
        // CController.CreateNewInputSet
        //
        /// <summary>
        /// <para>Create a new CInputSet instance, register to this.inputSetList,
        /// and return it.</para>
        /// <para>(AddInputSet in sscli.)</para>
        /// </summary>
        /// <returns>A created CInputSet instance.</returns>
        //------------------------------------------------------------
        virtual internal CInputSet CreateNewInputSet(TargetType defaultTarget)
        {
            CInputSet inp = new CInputSet(this);

            inp.SetTargetType(defaultTarget);
            this.inputSetList.Add(inp);
            return(inp);
        }
Exemple #2
0
        //------------------------------------------------------------
        // CController.AddInputFiles
        //
        /// <summary>
        /// <para>Check if searchString is valid.
        /// If it is valid, register all files matching to searchString to inputSet.
        /// If it is invalid, throw an exception.</para>
        /// <para>(In sscli, ProcessFileName in csharp\scc\scc.cpp)</para>
        /// </summary>
        /// <param name="pInputSet"></param>
        //------------------------------------------------------------
        internal void AddInputFiles(
            string fileStr,
            CInputSet inputSet,
            bool recursively,
            ref bool fileAdded)
        {
            DirectoryInfo dirInfo     = null;
            string        filePattern = null;
            Exception     excp        = null;

            // オプション文字列からディレクトリ名を取り出し、有効かどうか調べる。
            if (!IOUtil.CreateDirectoryInfoFromFilePath(fileStr, out dirInfo, out excp))
            {
                ReportError(ERRORKIND.ERROR, excp);
                return;
            }
            if (!dirInfo.Exists)
            {
                ReportError(
                    ERRORKIND.ERROR,
                    String.Format("{0} could not be found.", dirInfo.Name));
                return;
            }
            filePattern = Path.GetFileName(fileStr);

            // 指定されたディレクトリ内でファイル名にマッチするものすべてを探す。
            // ただし、hidden 属性を持つものとディレクトリは除く
            List <FileInfo> fileInfoList = new List <FileInfo>();

            IOUtil.EnumFileInfo(
                dirInfo,
                filePattern,
                0,
                FileAttributes.Hidden | FileAttributes.Directory,
                fileInfoList,
                recursively);

            // 見つかったファイルのフルパスを inputSet に登録する。
            if (fileInfoList.Count > 0)
            {
                foreach (FileInfo fi in fileInfoList)
                {
                    if (fi != null)
                    {
                        inputSet.AddSourceFile(fi);
                        fileAdded = true;
                    }
                }
            }
            else
            {
                ReportError(CSCERRID.ERR_FileNotFound, ERRORKIND.ERROR, fileStr);
            }
        }
Exemple #3
0
 //------------------------------------------------------------
 // CController.BeginNewInputSet
 //
 /// <summary>
 /// <para>(sscli)
 /// This function is called to make sure the given input set is "fresh",
 /// meaning it hasn't had any files added to it yet.</para>
 /// </summary>
 /// <param name="inputSet"></param>
 /// <param name="fileAdded"></param>
 /// <returns></returns>
 //------------------------------------------------------------
 internal bool BeginNewInputSet(ref CInputSet inputSet, ref bool fileAdded)
 {
     if (fileAdded)
     {
         fileAdded = false;
         // default for subsequent executables is DLL.
         inputSet = CreateNewInputSet(TargetType.Module);
         DebugUtil.Assert(inputSet != null);
         //inputSet.SetTargetType(TargetType.Module);
     }
     return(true);
 }
Exemple #4
0
 //------------------------------------------------------------
 // CController.RemoveSetFromList
 //
 /// <summary>
 /// Not defined in sscli20_20060311. Do not call this method.
 /// </summary>
 /// <param name="pSet"></param>
 //------------------------------------------------------------
 internal void RemoveSetFromList(CInputSet pSet)
 {
     throw new NotImplementedException("CController.RemoveSetFromList");
 }
Exemple #5
0
 //------------------------------------------------------------
 // CController.RemoveInputSet
 //
 /// <summary>Not implemented. Return false.</summary>
 /// <param name="pInputSet"></param>
 //------------------------------------------------------------
 virtual internal bool RemoveInputSet(CInputSet pInputSet)
 {
     return(false);
 }