本文整理汇总了C#中AnyObjectId.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId.ToString方法的具体用法?C# AnyObjectId.ToString怎么用?C# AnyObjectId.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyObjectId
的用法示例。
在下文中一共展示了AnyObjectId.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fileFor
/**
* Compute the location of a loose object file.
*
* @param objectId
* identity of the loose object to map to the directory.
* @return location of the object, if it were to exist as a loose object.
*/
public FileInfo fileFor(AnyObjectId objectId)
{
return fileFor(objectId.ToString());
}
示例2: hasObject
/// <summary>
/// Does the requested object exist in this database?
/// <para />
/// Alternates (if present) are searched automatically.
/// </summary>
/// <param name="objectId">identity of the object to test for existence of.</param>
/// <returns>
/// True if the specified object is stored in this database, or any
/// of the alternate databases.
/// </returns>
public bool hasObject(AnyObjectId objectId)
{
return hasObjectImpl1(objectId) || hasObjectImpl2(objectId.ToString());
}
示例3: ToFile
/**
* Construct a filename where the loose object having a specified SHA-1
* should be stored. If the object is stored in a shared repository the path
* to the alternative repo will be returned. If the object is not yet store
* a usable path in this repo will be returned. It is assumed that callers
* will look for objects in a pack first.
*
* @param objectId
* @return suggested file name
*/
public FileInfo ToFile(AnyObjectId objectId)
{
string n = objectId.ToString();
string d = n.Substring(0, 2);
string f = n.Substring(2);
for (int i = 0; i < _objectsDirs.Count; ++i)
{
FileInfo ret = new FileInfo(PathUtil.Combine(_objectsDirs[i].FullName, d, f));
if (ret.Exists)
return ret;
}
return new FileInfo(PathUtil.Combine(_objectsDirs[0].FullName, d, f));
}
示例4: openObject
/**
* Open an object from this database.
* <p>
* Alternates (if present) are searched automatically.
*
* @param curs
* temporary working space associated with the calling thread.
* @param objectId
* identity of the object to open.
* @return a {@link ObjectLoader} for accessing the data of the named
* object, or null if the object does not exist.
* @
*/
public virtual ObjectLoader openObject(WindowCursor curs, AnyObjectId objectId)
{
if (objectId == null)
return null;
ObjectLoader ldr;
ldr = openObjectImpl1(curs, objectId);
if (ldr != null)
{
return ldr;
}
ldr = openObjectImpl2(curs, objectId.ToString(), objectId);
if (ldr != null)
{
return ldr;
}
return null;
}