Пример #1
0
        protected void ReadCommentedGuidProperty(string curLine)
        {
            Match  m   = PBXRegex.KeyValue.Match(curLine.Trim());
            string key = m.Groups[1].Value.Trim();

            m_Properties[key] = CommentedGUID.ReadString(m.Groups[2].Value.Trim());
        }
Пример #2
0
 public void Write(TextWriter sw, GUIDToCommentMap comments)
 {
     sw.WriteLine("\t\t\t\t{");
     sw.WriteLine("\t\t\t\t\tProductGroup = {0};", CommentedGUID.Write(@group, comments));
     sw.WriteLine("\t\t\t\t\tProjectRef = {0};", CommentedGUID.Write(projectRef, comments));
     sw.WriteLine("\t\t\t\t}");
 }
Пример #3
0
        public void Read(string curLine, TextReader sr)
        {
            if (curLine.Trim() != "{")
            {
                throw new Exception("Wrong entry passed to ProjectReference.Read");
            }

            curLine = sr.ReadLine();
            while (curLine.Trim() != "}")
            {
                Match m = PBXRegex.KeyValue.Match(curLine.Trim());
                if (m.Success)
                {
                    string key   = m.Groups[1].Value;
                    string value = m.Groups[2].Value;

                    if (key == "ProductGroup")
                    {
                        group = CommentedGUID.ReadString(value);
                    }
                    else if (key == "ProjectRef")
                    {
                        projectRef = CommentedGUID.ReadString(value);
                    }
                }
                curLine = sr.ReadLine();
            }
        }
Пример #4
0
 public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments)
 {
     sw.WriteLine(
         "\t\t{0} = {{isa = PBXBuildFile; fileRef = {1}; {2}}};",
         CommentedGUID.Write(guid, comments),
         CommentedGUID.Write(fileRef, comments),
         postfix);
 }
Пример #5
0
        protected void WriteCommentedGuidListProperty(string prop, TextWriter sw, GUIDToCommentMap comments)
        {
            sw.WriteLine("\t\t\t{0} = (", prop);
            var list = m_ListProperties[prop];

            foreach (string v in list)
            {
                sw.WriteLine("\t\t\t\t{0},", CommentedGUID.Write(v, comments));
            }
            sw.WriteLine("\t\t\t);");
        }
Пример #6
0
        protected string ReadCommentedGuidListProperty(string curLine, TextReader sr)
        {
            Match  m    = PBXRegex.ListHeader.Match(curLine.Trim());
            string key  = m.Groups[1].Value.Trim();
            var    list = new List <string>();

            curLine = sr.ReadLine();
            while (curLine.Trim() != ");")
            {
                list.Add(CommentedGUID.ReadString(curLine));
                curLine = sr.ReadLine();
            }
            m_ListProperties[key] = list;
            return(curLine);
        }
Пример #7
0
        public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments)
        {
            // TODO: the implementation works but is not elegant

            var processedProperties = new HashSet <string>();
            var allProps            = new List <string>();

            allProps.AddRange(GetPropertyNames());
            allProps.Sort();

            sw.WriteLine("\t\t{0} = {{", CommentedGUID.Write(guid, comments));
            WritePropertyWrapper("isa", processedProperties, sw, comments); // always the first
            foreach (var prop in allProps)
            {
                WritePropertyWrapper(prop, processedProperties, sw, comments);
            }
            foreach (var line in m_BadLines)
            {
                sw.WriteLine(line);
            }
            sw.WriteLine("\t\t};");
        }
Пример #8
0
 public override void WriteToSection(TextWriter sw, GUIDToCommentMap comments)
 {
     sw.WriteLine("\t\t{0} = {1};", CommentedGUID.Write(guid, comments), text);
 }
Пример #9
0
 protected void WriteCommentedGuidProperty(string prop, TextWriter sw, GUIDToCommentMap comments)
 {
     sw.WriteLine("\t\t\t{0} = {1};", prop, CommentedGUID.Write(m_Properties[prop], comments));
 }
Пример #10
0
 public void ReadFromSection(string curLine, TextReader sr)
 {
     guid = CommentedGUID.ReadString(curLine);
     ReadFromSectionImpl(curLine, sr);
 }