Ejemplo n.º 1
0
        /// <summary>Add the specified tree entry to this tree.</summary>
        /// <remarks>Add the specified tree entry to this tree.</remarks>
        /// <param name="e"></param>
        /// <exception cref="System.IO.IOException">System.IO.IOException</exception>
        public virtual void AddEntry(TreeEntry e)
        {
            int p;

            EnsureLoaded();
            p = BinarySearch(contents, e.GetNameUTF8(), TreeEntry.LastChar(e), 0, e.GetNameUTF8
                                 ().Length);
            if (p < 0)
            {
                e.AttachParent(this);
                InsertEntry(p, e);
            }
            else
            {
                throw new EntryExistsException(e.GetName());
            }
        }
Ejemplo n.º 2
0
        internal virtual void RemoveEntry(TreeEntry e)
        {
            TreeEntry[] c = contents;
            int         p = BinarySearch(c, e.GetNameUTF8(), TreeEntry.LastChar(e), 0, e.GetNameUTF8(
                                             ).Length);

            if (p >= 0)
            {
                TreeEntry[] n = new TreeEntry[c.Length - 1];
                for (int k = c.Length - 1; k > p; k--)
                {
                    n[k - 1] = c[k];
                }
                for (int k_1 = p - 1; k_1 >= 0; k_1--)
                {
                    n[k_1] = c[k_1];
                }
                contents = n;
                SetModified();
            }
        }
Ejemplo n.º 3
0
		internal virtual void RemoveEntry(TreeEntry e)
		{
			TreeEntry[] c = contents;
			int p = BinarySearch(c, e.GetNameUTF8(), TreeEntry.LastChar(e), 0, e.GetNameUTF8(
				).Length);
			if (p >= 0)
			{
				TreeEntry[] n = new TreeEntry[c.Length - 1];
				for (int k = c.Length - 1; k > p; k--)
				{
					n[k - 1] = c[k];
				}
				for (int k_1 = p - 1; k_1 >= 0; k_1--)
				{
					n[k_1] = c[k_1];
				}
				contents = n;
				SetModified();
			}
		}
Ejemplo n.º 4
0
		/// <summary>Add the specified tree entry to this tree.</summary>
		/// <remarks>Add the specified tree entry to this tree.</remarks>
		/// <param name="e"></param>
		/// <exception cref="System.IO.IOException">System.IO.IOException</exception>
		public virtual void AddEntry(TreeEntry e)
		{
			int p;
			EnsureLoaded();
			p = BinarySearch(contents, e.GetNameUTF8(), TreeEntry.LastChar(e), 0, e.GetNameUTF8
				().Length);
			if (p < 0)
			{
				e.AttachParent(this);
				InsertEntry(p, e);
			}
			else
			{
				throw new EntryExistsException(e.GetName());
			}
		}