當前位置: 首頁>>代碼示例>>C#>>正文


C# AnyObjectId類代碼示例

本文整理匯總了C#中AnyObjectId的典型用法代碼示例。如果您正苦於以下問題:C# AnyObjectId類的具體用法?C# AnyObjectId怎麽用?C# AnyObjectId使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AnyObjectId類屬於命名空間,在下文中一共展示了AnyObjectId類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PlotCommit

 /// <summary>
 /// Create a new commit.
 /// </summary>
 /// <param name="id">the identity of this commit.</param>
 /// <param name="tags">the tags associated with this commit, null for no tags</param>
 public PlotCommit(AnyObjectId id, Ref[] tags)
     : base(id)
 {
     this.refs = tags;
     passingLanes = NO_LANES;
     children = NO_CHILDREN;
 }
開發者ID:ermshiperete,項目名稱:GitSharp,代碼行數:12,代碼來源:PlotCommit.cs

示例2: include

 public void include(string name, AnyObjectId id)
 {
     if (!Repository.IsValidRefName(name))
         throw new ArgumentException("Invalid ref name: " + name, "name");
     if (includeObjects.ContainsKey(name))
         throw new ApplicationException("Duplicate ref: " + name);
     includeObjects.Add(name, id.ToObjectId());
 }
開發者ID:mneedham,項目名稱:GitSharp,代碼行數:8,代碼來源:BundleWriter.cs

示例3: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.SetRefLogMessage(msg, true);
 }
開發者ID:ArildF,項目名稱:GitSharp,代碼行數:8,代碼來源:TrackingRefUpdate.cs

示例4: ObjectId

 public ObjectId(AnyObjectId src)
 {
     this.W1 = src.W1;
     this.W2 = src.W2;
     this.W3 = src.W3;
     this.W4 = src.W4;
     this.W5 = src.W5;
 }
開發者ID:ArildF,項目名稱:GitSharp,代碼行數:8,代碼來源:ObjectId.cs

示例5: SetBase

	    /**
	     * Set the common ancestor tree.
	     *
	     * @param id
	     *            common base treeish; null to automatically compute the common
	     *            base from the input commits during
	     *            {@link #merge(AnyObjectId, AnyObjectId)}.
	     * @throws IncorrectObjectTypeException
	     *             the object is not a treeish.
	     * @throws MissingObjectException
	     *             the object does not exist.
	     * @throws IOException
	     *             the object could not be read.
	     */
	    public void SetBase(AnyObjectId id)
        {
		    if (id != null) 
            {
			    _baseTree = Walk.parseTree(id);
		    } 
            else 
            {
			    _baseTree = null;
		    }
	    }
開發者ID:gilran,項目名稱:GitSharp,代碼行數:25,代碼來源:ThreeWayMerger.cs

示例6: Entry

		private static byte[] Entry(FileMode mode, string name, AnyObjectId id)
		{
			var @out = new MemoryStream();
			mode.CopyTo(@out);
			@out.WriteByte((byte) ' ');
			byte[] bytes = Constants.encode(name);
			@out.Write(bytes, 0, bytes.Length);
			@out.WriteByte(0);
			id.copyRawTo(@out);
			return @out.ToArray();
		}
開發者ID:dev218,項目名稱:GitSharp,代碼行數:11,代碼來源:CanonicalTreeParserTest.cs

示例7: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     if (db == null)
         throw new System.ArgumentNullException("db");
     if (nv == null)
         throw new System.ArgumentNullException("nv");
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.setRefLogMessage(msg, true);
 }
開發者ID:dev218,項目名稱:GitSharp,代碼行數:12,代碼來源:TrackingRefUpdate.cs

示例8: BinarySearchLevelTwo

        private int BinarySearchLevelTwo(AnyObjectId objId, int levelOne)
        {
            int[] data = _names[levelOne];
            var high = (int)((uint)(_offset32[levelOne].Length) >> 2);
            if (high == 0)
            {
                return -1;
            }

            int low = 0;
            do
            {
                var mid = (int)((uint)(low + high) >> 1);
                int mid4 = mid << 2;

                int cmp = objId.CompareTo(data, mid4 + mid);
                if (cmp < 0)
                {
                    high = mid;
                }
                else if (cmp == 0)
                {
                    return mid;
                }
                else
                {
                    low = mid + 1;
                }

            } while (low < high);
            return -1;
        }
開發者ID:nestalk,項目名稱:GitSharp,代碼行數:32,代碼來源:PackIndexV2.cs

示例9: decodeTypeString

        /// <summary>
        /// Parse an encoded type string into a type constant.
        /// </summary>
        /// <param name="id">
        /// <see cref="ObjectId" /> this type string came from; may be null if 
        /// that is not known at the time the parse is occurring.
        /// </param>
        /// <param name="typeString">string version of the type code.</param>
        /// <param name="endMark">
        /// Character immediately following the type string. Usually ' '
        /// (space) or '\n' (line feed).
        /// </param>
        /// <param name="offset">
        /// Position within <paramref name="typeString"/> where the parse
        /// should start. Updated with the new position (just past
        /// <paramref name="endMark"/> when the parse is successful).
        /// </param>
        /// <returns>
        /// A type code constant (one of <see cref="OBJ_BLOB"/>,
        /// <see cref="OBJ_COMMIT"/>, <see cref="OBJ_TAG"/>, <see cref="OBJ_TREE"/>
        /// </returns>
        /// <exception cref="CorruptObjectException"></exception>
        public static int decodeTypeString(AnyObjectId id, byte[] typeString, byte endMark, MutableInteger offset)
        {
            try
            {
                int position = offset.value;
                switch (typeString[position])
                {
                    case (byte)'b':
                        if (typeString[position + 1] != (byte)'l'
                            || typeString[position + 2] != (byte)'o'
                            || typeString[position + 3] != (byte)'b'
                            || typeString[position + 4] != endMark)
                        {
                            throw new CorruptObjectException(id, "invalid type");
                        }
                        offset.value = position + 5;
                        return OBJ_BLOB;

                    case (byte)'c':
                        if (typeString[position + 1] != (byte)'o'
                                || typeString[position + 2] != (byte)'m'
                                || typeString[position + 3] != (byte)'m'
                                || typeString[position + 4] != (byte)'i'
                                || typeString[position + 5] != (byte)'t'
                                || typeString[position + 6] != endMark)
                        {
                            throw new CorruptObjectException(id, "invalid type");
                        }
                        offset.value = position + 7;
                        return OBJ_COMMIT;

                    case (byte)'t':
                        switch (typeString[position + 1])
                        {
                            case (byte)'a':
                                if (typeString[position + 2] != (byte)'g'
                                    || typeString[position + 3] != endMark)
                                    throw new CorruptObjectException(id, "invalid type");
                                offset.value = position + 4;
                                return OBJ_TAG;

                            case (byte)'r':
                                if (typeString[position + 2] != (byte)'e'
                                        || typeString[position + 3] != (byte)'e'
                                        || typeString[position + 4] != endMark)
                                    throw new CorruptObjectException(id, "invalid type");
                                offset.value = position + 5;
                                return OBJ_TREE;

                            default:
                                throw new CorruptObjectException(id, "invalid type");
                        }

                    default:
                        throw new CorruptObjectException(id, "invalid type");
                }
            }
            catch (IndexOutOfRangeException)
            {
                throw new CorruptObjectException(id, "invalid type");
            }
        }
開發者ID:dev218,項目名稱:GitSharp,代碼行數:84,代碼來源:Constants.cs

示例10: FindCRC32

        public override long FindCRC32(AnyObjectId objId)
        {
            int levelOne = objId.GetFirstByte();
            int levelTwo = BinarySearchLevelTwo(objId, levelOne);
            if (levelTwo == -1)
            {
                throw new MissingObjectException(objId.Copy(), ObjectType.Unknown);
            }

            return NB.DecodeUInt32(_crc32[levelOne], levelTwo << 2);
        }
開發者ID:nestalk,項目名稱:GitSharp,代碼行數:11,代碼來源:PackIndexV2.cs

示例11: FindOffset

        public override long FindOffset(AnyObjectId objId)
        {
            int levelOne = objId.GetFirstByte();
            int levelTwo = BinarySearchLevelTwo(objId, levelOne);
            if (levelTwo == -1)
            {
                return -1;
            }

            long p = NB.DecodeUInt32(_offset32[levelOne], levelTwo << 2);
            if ((p & IS_O64) != 0)
            {
                return NB.DecodeUInt64(_offset64, (8 * (int)(p & ~IS_O64)));
            }

            return p;
        }
開發者ID:nestalk,項目名稱:GitSharp,代碼行數:17,代碼來源:PackIndexV2.cs

示例12: writeLooseRef

 private void writeLooseRef(string name, AnyObjectId id)
 {
     writeLooseRef(name, id.Name + "\n");
 }
開發者ID:deodelacruz,項目名稱:GitSharp,代碼行數:4,代碼來源:RefDirectoryTest.cs

示例13: writePackedRef

 private void writePackedRef(string name, AnyObjectId id)
 {
     writePackedRefs(id.Name + " " + name + "\n");
 }
開發者ID:deodelacruz,項目名稱:GitSharp,代碼行數:4,代碼來源:RefDirectoryTest.cs

示例14: CanonicalTreeParser

 /**
  * Create a new parser for a tree appearing in a subset of a repository.
  *
  * @param prefix
  *            position of this iterator in the repository tree. The value
  *            may be null or the empty array to indicate the prefix is the
  *            root of the repository. A trailing slash ('/') is
  *            automatically appended if the prefix does not end in '/'.
  * @param repo
  *            repository to load the tree data from.
  * @param treeId
  *            identity of the tree being parsed; used only in exception
  *            messages if data corruption is found.
  * @param curs
  *            a window cursor to use during data access from the repository.
  * @throws MissingObjectException
  *             the object supplied is not available from the repository.
  * @throws IncorrectObjectTypeException
  *             the object supplied as an argument is not actually a tree and
  *             cannot be parsed as though it were a tree.
  * @throws IOException
  *             a loose object or pack file could not be read.
  */
 public CanonicalTreeParser(byte[] prefix, Repository repo, AnyObjectId treeId, WindowCursor curs)
     : base(prefix)
 {
     reset(repo, treeId, curs);
 }
開發者ID:ArildF,項目名稱:GitSharp,代碼行數:28,代碼來源:CanonicalTreeParser.cs

示例15: openObject

 /**
  * @param curs
  *            temporary working space associated with the calling thread.
  * @param id
  *            SHA-1 of an object.
  * 
  * @return a {@link ObjectLoader} for accessing the data of the named
  *         object, or null if the object does not exist.
  * @
  */
 public ObjectLoader openObject(WindowCursor curs, AnyObjectId id)
 {
     return objectDatabase.openObject(curs, id);
 }
開發者ID:gilran,項目名稱:GitSharp,代碼行數:14,代碼來源:Repository.cs


注:本文中的AnyObjectId類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。