public uint GetPosition(PositionBlock positionBlock) { var dataBuffer = new byte[4]; this.GetPosition(positionBlock, dataBuffer); return(BitConverter.ToUInt32(dataBuffer, 0)); }
public void GetDirect(PositionBlock positionBlock, byte[] dataBuffer, ref ushort dataBufferLength, byte[] keyBuffer, sbyte keyNumber, LockBias lockBias = LockBias.None) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } this.Operate(Operation.GetDirect, positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber, (ushort)lockBias); }
public void UpdateChunk(PositionBlock positionBlock, byte[] dataBuffer, ref ushort dataBufferLength, byte[] keyBuffer = null, sbyte keyNumber = -1) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } this.Operate(Operation.UpdateChunk, positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber); }
public void GetLessThanOrEqualKey(PositionBlock positionBlock, byte[] keyBuffer, sbyte keyNumber, LockBias lockBias = LockBias.None) { if (positionBlock == null || keyBuffer == null) { throw new ArgumentNullException(); } this.Operate(Operation.GetLessThanOrEqualKey, positionBlock, null, keyBuffer, keyNumber, (ushort)lockBias); }
public void UnlockSingleRecord(PositionBlock positionBlock, sbyte keyNumber) { if (positionBlock == null) { throw new ArgumentNullException(); } this.Operate(Operation.Unlock, positionBlock, null, null, keyNumber); }
public void Insert(PositionBlock positionBlock, byte[] dataBuffer, ushort dataBufferLength, sbyte keyNumber = -1, byte keyLength = 255) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } var keyBuffer = keyNumber == -1 ? _zero : new byte[keyLength]; this.Operate(Operation.Insert, positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber); }
public void Delete(PositionBlock positionBlock) { if (positionBlock == null) { throw new ArgumentNullException(); } var keyNumber = (sbyte)0; this.Operate(Operation.Delete, positionBlock, null, null, keyNumber); }
public void GetDirect(PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer, sbyte keyNumber, LockBias lockBias = LockBias.None) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } var dataBufferLength = (ushort)dataBuffer.Length; this.GetDirect(positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber, lockBias); }
public void StepPreviousExtended(PositionBlock positionBlock, byte[] dataBuffer, ref ushort dataBufferLength, LockBias lockBias = LockBias.None) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } var keyNumber = (sbyte)0; this.Operate(Operation.StepPreviousExtended, positionBlock, dataBuffer, ref dataBufferLength, null, keyNumber, (ushort)lockBias); }
public void ClearOwner(PositionBlock positionBlock) { if (positionBlock == null) { throw new ArgumentNullException(); } var dataBuffer = _zero; var keyBuffer = _zero; var keyNumber = (sbyte)0; this.Operate(Operation.ClearOwner, positionBlock, dataBuffer, keyBuffer, keyNumber); }
public StatData Stat(PositionBlock positionBlock, byte[] dataBuffer) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } var keyBuffer = new byte[64]; var keyNumber = (sbyte)-1; this.Operate(Operation.Stat, positionBlock, dataBuffer, keyBuffer, keyNumber); return(new StatData(dataBuffer)); }
public void SetOwner(PositionBlock positionBlock, string ownerName, OwnerNameOption option = OwnerNameOption.NoEncryption) { if (positionBlock == null || ownerName == null) { throw new ArgumentNullException(); } ownerName = ownerName == null ? "\0" : ownerName.TrimEnd('\0') + "\0"; var dataBuffer = (this.OwnerNameEncoding ?? Encoding.Default).GetBytes(ownerName); var keyBuffer = (this.OwnerNameEncoding ?? Encoding.Default).GetBytes(ownerName); var keyNumber = (sbyte)option; this.Operate(Operation.SetOwner, positionBlock, dataBuffer, keyBuffer, keyNumber); }
public void GetPosition(PositionBlock positionBlock, byte[] dataBuffer) { if (positionBlock == null || dataBuffer == null) { throw new ArgumentNullException(); } if (dataBuffer.Length < 4) { throw new ArgumentException(); } var keyNumber = (sbyte)0; this.Operate(Operation.GetPosition, positionBlock, dataBuffer, null, keyNumber); }
public void UnlockMultiRecord(PositionBlock positionBlock, byte[] recordPosition = null, bool isBufferReused = true) { if (positionBlock == null) { throw new ArgumentNullException(); } if (recordPosition.Length != 4) { throw new ArgumentException(); } var dataBuffer = recordPosition; var keyNumber = recordPosition == null ? (sbyte)-2 : (sbyte)-1; this.Operate(Operation.Unlock, positionBlock, dataBuffer, null, keyNumber); }
internal OperationResult( Operation operationType, PositionBlock positionBlock, byte[] dataBuffer, int dataBufferLength, byte[] keyBuffer, sbyte keyNumber, ClientId clientId) { this.OperationType = operationType; this.PositionBlock = positionBlock; this.DataBuffer = dataBuffer; this.DataBufferLength = dataBufferLength; this.KeyBuffer = keyBuffer; this.KeyNumber = keyNumber; this.ClientId = clientId; }
public PositionBlock Open(string filePath, string ownerName = null, OpenMode openMode = OpenMode.Normal) { if (filePath == null) { throw new ArgumentNullException(); } filePath = filePath.TrimEnd('\0') + "\0"; ownerName = ownerName == null ? "\0" : ownerName.TrimEnd('\0') + "\0"; var positionBlock = new PositionBlock(); var dataBuffer = (this.OwnerNameEncoding ?? Encoding.Default).GetBytes(ownerName); var keyBuffer = (this.PathEncoding ?? Encoding.Default).GetBytes(filePath); var keyNumber = (sbyte)openMode; this.Operate(Operation.Open, positionBlock, dataBuffer, keyBuffer, keyNumber); return(positionBlock); }
public void Operate( Operation operation, PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer, sbyte keyNumber, ushort bias = 0) { var dataBufferLength = dataBuffer == null ? (ushort)0 : (ushort)dataBuffer.Length; this.Operate( operation, positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber, bias); }
public void Operate( Operation operation, PositionBlock positionBlock, byte[] dataBuffer, ref ushort dataBufferLength, byte[] keyBuffer, sbyte keyNumber, ushort bias = 0) { if (dataBuffer == null) { dataBuffer = _zero; } if (keyBuffer == null) { keyBuffer = _zero; } if (keyBuffer.Length > 255) { throw new ArgumentException(); } byte[] posBlk = positionBlock == null ? _zero : positionBlock.Value; short statusCode; if (this.ClientId == null) { statusCode = _library.BtrCall((ushort)((ushort)operation + bias), posBlk, dataBuffer, ref dataBufferLength, keyBuffer, (ushort)keyBuffer.Length, keyNumber); } else { statusCode = _library.BtrCallId((ushort)((ushort)operation + bias), posBlk, dataBuffer, ref dataBufferLength, keyBuffer, (ushort)keyBuffer.Length, keyNumber, this.ClientId.Buffer); } if (statusCode != 0) { throw new OperationException(operation, statusCode); } }
public void StepPreviousExtended(PositionBlock positionBlock, byte[] dataBuffer, LockBias lockBias = LockBias.None) { var dataBufferLength = (ushort)dataBuffer.Length; this.StepPreviousExtended(positionBlock, dataBuffer, ref dataBufferLength, lockBias); }
public void GetPreviousExtended(PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer, sbyte keyNumber, LockBias lockBias = LockBias.None) { var dataBufferLength = (ushort)dataBuffer.Length; this.GetPreviousExtended(positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber, lockBias); }
public void GetLessThanOrEqual(PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer, sbyte keyNumber, LockBias lockBias = LockBias.None) { var dataBufferLength = (ushort)dataBuffer.Length; this.GetLessThanOrEqual(positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber, lockBias); }
public void Update(PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer = null, sbyte keyNumber = -1) { var dataBufferLength = (ushort)dataBuffer.Length; this.Update(positionBlock, dataBuffer, ref dataBufferLength, keyBuffer, keyNumber); }
public void InsertExtended(PositionBlock positionBlock, byte[] dataBuffer, byte[] keyBuffer = null, sbyte keyNumber = -1) { var dataBufferLength = (ushort)dataBuffer.Length; this.InsertExtended(positionBlock, dataBuffer, dataBufferLength, keyBuffer, keyNumber); }
public StatData Stat(PositionBlock positionBlock) { return(this.Stat(positionBlock, new byte[1920])); }
public void Insert(PositionBlock positionBlock, byte[] dataBuffer, sbyte keyNumber = -1, byte keyLength = 255) { var dataBufferLength = (ushort)dataBuffer.Length; this.Insert(positionBlock, dataBuffer, (ushort)dataBuffer.Length, keyNumber, keyLength); }