public FakeTreeIterator(AbstractTreeIteratorTest _enclosing, string pathName, FileMode
				 fileMode) : base(AbstractTreeIteratorTest.Prefix(pathName), new Config().Get(WorkingTreeOptions
				.KEY))
			{
				this._enclosing = _enclosing;
				this.mode = fileMode.GetBits();
				int s = pathName.LastIndexOf('/');
				byte[] name = Constants.Encode(Sharpen.Runtime.Substring(pathName, s + 1));
				this.EnsurePathCapacity(this.pathOffset + name.Length, this.pathOffset);
				System.Array.Copy(name, 0, this.path, this.pathOffset, name.Length);
				this.pathLen = this.pathOffset + name.Length;
			}
示例#2
0
		private static int LastPathChar(FileMode mode)
		{
			return FileMode.TREE.Equals(mode.GetBits()) ? '/' : '\0';
		}
		private static bool IsFile(FileMode mode)
		{
			return (mode.GetBits() & FileMode.TYPE_MASK) == FileMode.TYPE_FILE;
		}