public PBXElementArray CreateArray(string key) { var v = new PBXElementArray(); values[key] = v; return(v); }
public PBXElementArray AddArray() { var v = new PBXElementArray(); values.Add(v); return(v); }
public override void UpdateProps() { SetPropertyString("fileRef", fileRef); if (compileFlags != null && compileFlags != "") { GetSettingsDict().SetString("COMPILER_FLAGS", compileFlags); } else { var dict = GetSettingsDictOptional(); if (dict != null) { dict.Remove("COMPILER_FLAGS"); } } if (weak) { var dict = GetSettingsDict(); PBXElementArray attrs = null; if (dict.Contains("ATTRIBUTES")) { attrs = dict["ATTRIBUTES"].AsArray(); } else { attrs = dict.CreateArray("ATTRIBUTES"); } bool exists = false; foreach (var value in attrs.values) { if (value is PBXElementString && value.AsString() == "Weak") { exists = true; } } if (!exists) { attrs.AddString("Weak"); } } else { var dict = GetSettingsDictOptional(); if (dict != null && dict.Contains("ATTRIBUTES")) { var attrs = dict["ATTRIBUTES"].AsArray(); attrs.values.RemoveAll(el => (el is PBXElementString && el.AsString() == "Weak")); if (attrs.values.Count == 0) { dict.Remove("ATTRIBUTES"); } if (dict.values.Count == 0) { m_Properties.Remove("settings"); } } } }
public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text) { var el = new PBXElementArray(); foreach (var v in ast.values) { el.values.Add(ParseValueAST(v, tokens, text)); } return(el); }
public static void WriteArray(StringBuilder sb, PBXElementArray el, int indent, bool compact, PropertyCommentChecker checker, GUIDToCommentMap comments) { sb.Append("("); foreach (var value in el.values) { if (!compact) { sb.Append("\n"); sb.Append(GetIndent(indent + 1)); } if (value is PBXElementString) { WriteStringImpl(sb, value.AsString(), checker.CheckStringValueInArray(value.AsString()), comments); } else if (value is PBXElementDict) { WriteDict(sb, value.AsDict(), indent + 1, compact, checker.NextLevel("*"), comments); } else if (value is PBXElementArray) { WriteArray(sb, value.AsArray(), indent + 1, compact, checker.NextLevel("*"), comments); } sb.Append(","); if (compact) { sb.Append(" "); } } if (!compact) { sb.Append("\n"); sb.Append(GetIndent(indent)); } sb.Append(")"); }
public PBXElementArray CreateArray(string key) { var v = new PBXElementArray(); values[key] = v; return v; }
public PBXElementArray AddArray() { var v = new PBXElementArray(); values.Add(v); return v; }
public static void WriteArray(StringBuilder sb, PBXElementArray el, int indent, bool compact, PropertyCommentChecker checker, GUIDToCommentMap comments) { sb.Append("("); foreach (var value in el.values) { if (!compact) { sb.Append("\n"); sb.Append(GetIndent(indent+1)); } if (value is PBXElementString) WriteStringImpl(sb, value.AsString(), checker.CheckStringValueInArray(value.AsString()), comments); else if (value is PBXElementDict) WriteDict(sb, value.AsDict(), indent+1, compact, checker.NextLevel("*"), comments); else if (value is PBXElementArray) WriteArray(sb, value.AsArray(), indent+1, compact, checker.NextLevel("*"), comments); sb.Append(","); if (compact) sb.Append(" "); } if (!compact) { sb.Append("\n"); sb.Append(GetIndent(indent)); } sb.Append(")"); }
public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text) { var el = new PBXElementArray(); foreach (var v in ast.values) { el.values.Add(ParseValueAST(v, tokens, text)); } return el; }