Exemple #1
0
        private PBXList ParseArray()
        {
            PBXList list     = new PBXList();
            bool    complete = false;

            while (!complete)
            {
                switch (NextToken())
                {
                case END_OF_FILE:
                    Debug.Log("Error: Reached end of file inside a list: " + list);
                    complete = true;
                    break;

                case ARRAY_END_TOKEN:
                    complete = true;
                    break;

                case ARRAY_ITEM_DELIMITER_TOKEN:
                    break;

                default:
                    StepBackward();
                    list.Add(ParseValue());
                    break;
                }
            }
            return(list);
        }
        public bool AddOtherCFlags(string flag)
        {
            PBXList flags = new PBXList();

            flags.Add(flag);
            return(AddOtherCFlags(flags));
        }
        protected bool AddSearchPaths(string path, string key, bool recursive = true)
        {
            PBXList paths = new PBXList();

            paths.Add(path);
            return(AddSearchPaths(paths, key, recursive));
        }
        public bool SetWeakLink(bool weak = false)
        {
            PBXDictionary settings   = null;
            PBXList       attributes = null;

            if (!_data.ContainsKey(SETTINGS_KEY))
            {
                if (weak)
                {
                    attributes = new PBXList();
                    attributes.internalNewlines = false;
                    attributes.Add(WEAK_VALUE);

                    settings = new PBXDictionary();
                    settings.Add(ATTRIBUTES_KEY, attributes);
                    settings.internalNewlines = false;

                    this.Add(SETTINGS_KEY, settings);
                }
                return(true);
            }

            settings = _data[SETTINGS_KEY] as PBXDictionary;
            settings.internalNewlines = false;
            if (!settings.ContainsKey(ATTRIBUTES_KEY))
            {
                if (weak)
                {
                    attributes = new PBXList();
                    attributes.internalNewlines = false;
                    attributes.Add(WEAK_VALUE);
                    settings.Add(ATTRIBUTES_KEY, attributes);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                attributes = settings[ATTRIBUTES_KEY] as PBXList;
            }

            attributes.internalNewlines = false;
            if (weak)
            {
                attributes.Add(WEAK_VALUE);
            }
            else
            {
                attributes.Remove(WEAK_VALUE);
            }

            settings.Add(ATTRIBUTES_KEY, attributes);
            this.Add(SETTINGS_KEY, settings);

            return(true);
        }
    public bool SetWeakLink(bool weak = false)
    {
        PBXDictionary settings = null;
        PBXList attributes = null;

        if (!_data.ContainsKey(SETTINGS_KEY))
        {
            if (weak)
            {
                attributes = new PBXList();
                attributes.internalNewlines = false;
                attributes.Add(WEAK_VALUE);

                settings = new PBXDictionary();
                settings.Add(ATTRIBUTES_KEY, attributes);
                settings.internalNewlines = false;

                this.Add(SETTINGS_KEY, settings);
            }
            return true;
        }

        settings = _data[SETTINGS_KEY] as PBXDictionary;
        settings.internalNewlines = false;
        if (!settings.ContainsKey(ATTRIBUTES_KEY))
        {
            if (weak)
            {
                attributes = new PBXList();
                attributes.internalNewlines = false;
                attributes.Add(WEAK_VALUE);
                settings.Add(ATTRIBUTES_KEY, attributes);
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            attributes = settings[ATTRIBUTES_KEY] as PBXList;
        }

        attributes.internalNewlines = false;
        if (weak)
        {
            attributes.Add(WEAK_VALUE);
        }
        else
        {
            attributes.Remove(WEAK_VALUE);
        }

        settings.Add(ATTRIBUTES_KEY, attributes);
        this.Add(SETTINGS_KEY, settings);

        return true;
    }
        public bool AddOtherCFlags(string flag)
        {
            Debug.Log("INIZIO 1");
            PBXList flags = new PBXList();

            flags.Add(flag);
            return(AddOtherCFlags(flags));
        }
        protected bool AddSearchPaths(PBXList paths, string key, bool recursive = true)
        {
            bool modified = false;

            if (!ContainsKey(BUILDSETTINGS_KEY))
            {
                this.Add(BUILDSETTINGS_KEY, new PBXDictionary());
            }

            foreach (string path in paths)
            {
                string currentPath = path;
                if (recursive && !path.EndsWith("/**"))
                {
                    currentPath += "**";
                }
                if (!((PBXDictionary)_data[BUILDSETTINGS_KEY]).ContainsKey(key))
                {
                    ((PBXDictionary)_data[BUILDSETTINGS_KEY]).Add(key, new PBXList());
                }
                else if (((PBXDictionary)_data[BUILDSETTINGS_KEY])[key] is string)
                {
                    PBXList list = new PBXList();
                    list.Add(((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]);
                    ((PBXDictionary)_data[BUILDSETTINGS_KEY])[key] = list;
                }


                if (!((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Contains(currentPath))
                {
                    ((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Add(currentPath);
                    modified = true;
                }
            }

            return(modified);
        }
    protected bool AddSearchPaths(PBXList paths, string key, bool recursive = true)
    {
        bool modified = false;

        if (!ContainsKey(BUILDSETTINGS_KEY))
        {
            this.Add(BUILDSETTINGS_KEY, new PBXDictionary());
        }

        foreach (string path in paths)
        {
            string currentPath = path;
            if (recursive && !path.EndsWith("/**"))
            {
                currentPath += "**";
            }
            if (!((PBXDictionary) _data[BUILDSETTINGS_KEY]).ContainsKey(key))
            {
                ((PBXDictionary) _data[BUILDSETTINGS_KEY]).Add(key, new PBXList());
            }
            else if (((PBXDictionary) _data[BUILDSETTINGS_KEY])[key] is string)
            {
                PBXList list = new PBXList();
                list.Add(((PBXDictionary) _data[BUILDSETTINGS_KEY])[key]);
                ((PBXDictionary) _data[BUILDSETTINGS_KEY])[key] = list;
            }


            if (!((PBXList) ((PBXDictionary) _data[BUILDSETTINGS_KEY])[key]).Contains(currentPath))
            {
                ((PBXList) ((PBXDictionary) _data[BUILDSETTINGS_KEY])[key]).Add(currentPath);
                modified = true;
            }
        }

        return modified;
    }
 private PBXList ParseArray()
 {
     PBXList list = new PBXList();
     bool complete = false;
     while (!complete)
     {
         switch (NextToken())
         {
         case END_OF_FILE:
             Debug.Log("Error: Reached end of file inside a list: " + list);
             complete = true;
             break;
         case ARRAY_END_TOKEN:
             complete = true;
             break;
         case ARRAY_ITEM_DELIMITER_TOKEN:
             break;
         default:
             StepBackward();
             list.Add(ParseValue());
             break;
         }
     }
     return list;
 }
 protected bool AddSearchPaths(string path, string key, bool recursive = true)
 {
     PBXList paths = new PBXList();
     paths.Add(path);
     return AddSearchPaths(paths, key, recursive);
 }
 public bool AddOtherCFlags(string flag)
 {
     PBXList flags = new PBXList();
     flags.Add(flag);
     return AddOtherCFlags(flags);
 }