コード例 #1
0
ファイル: LdsFileGenerator.cs プロジェクト: sysprogs/BSPTools
        private void OutputSectionReference(StreamWriter sw, string padding, string namePattern, SectionReferenceFlags flags)
        {
            string baseRef = namePattern;
            if ((flags & SectionReferenceFlags.DotPrefixForm) != SectionReferenceFlags.None)
                baseRef += ".*";
            else if ((flags & SectionReferenceFlags.PrefixFormOnly) != SectionReferenceFlags.None)
                baseRef += "*";

            if ((flags & SectionReferenceFlags.Sort) != SectionReferenceFlags.None)
                baseRef = "SORT(" + baseRef + ")";

            string finalRef;
            if ((flags & SectionReferenceFlags.NoBrackets) != SectionReferenceFlags.None)
                finalRef = "*" + baseRef;
            else
                finalRef = "*(" + baseRef + ")";

            if ((flags & SectionReferenceFlags.Keep) != SectionReferenceFlags.None)
                finalRef = "KEEP(" + finalRef + ")";

            sw.WriteLine(padding + finalRef);

            if (((flags & SectionReferenceFlags.AddPrefixForm) != SectionReferenceFlags.None) &&
                ((flags & SectionReferenceFlags.PrefixFormOnly) == SectionReferenceFlags.None))
                OutputSectionReference(sw, padding, namePattern, flags | SectionReferenceFlags.PrefixFormOnly);
        }
コード例 #2
0
ファイル: LdsFileGenerator.cs プロジェクト: xllj/BSPTools
        private void OutputSectionReference(StreamWriter sw, string padding, string namePattern, SectionReferenceFlags flags)
        {
            string baseRef = namePattern;

            if ((flags & SectionReferenceFlags.DotPrefixForm) != SectionReferenceFlags.None)
            {
                baseRef += ".*";
            }
            else if ((flags & SectionReferenceFlags.PrefixFormOnly) != SectionReferenceFlags.None)
            {
                baseRef += "*";
            }

            if ((flags & SectionReferenceFlags.Sort) != SectionReferenceFlags.None)
            {
                baseRef = "SORT(" + baseRef + ")";
            }

            string finalRef;

            if ((flags & SectionReferenceFlags.NoBrackets) != SectionReferenceFlags.None)
            {
                finalRef = "*" + baseRef;
            }
            else
            {
                finalRef = "*(" + baseRef + ")";
            }

            if ((flags & SectionReferenceFlags.Keep) != SectionReferenceFlags.None)
            {
                finalRef = "KEEP(" + finalRef + ")";
            }

            sw.WriteLine(padding + finalRef);

            if (((flags & SectionReferenceFlags.AddPrefixForm) != SectionReferenceFlags.None) &&
                ((flags & SectionReferenceFlags.PrefixFormOnly) == SectionReferenceFlags.None))
            {
                OutputSectionReference(sw, padding, namePattern, flags | SectionReferenceFlags.PrefixFormOnly);
            }
        }