internal void Set(ref NodeSequenceItem item, int position, int size) { this.node = item.node; this.position = position; this.size = size; this.flags = item.flags; }
public int Compare(object obj1, object obj2) { NodeSequenceItem item1 = (NodeSequenceItem)obj1; NodeSequenceItem item2 = (NodeSequenceItem)obj2; XmlNodeOrder order = item1.Node.Node.ComparePosition(item1.Node.Position, item2.Node.Position); int ret; switch (order) { case XmlNodeOrder.Before: ret = -1; break; case XmlNodeOrder.Same: ret = 0; break; case XmlNodeOrder.After: ret = 1; break; case XmlNodeOrder.Unknown: default: throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XPathException(SR.GetString(SR.QueryNotSortable)), TraceEventType.Critical); } return(ret); }
internal void AddCopy(ref NodeSequenceItem item) { if (this.count == this.items.Length) { this.Grow(this.items.Length * 2); } this.items[this.count++] = item; }
internal void AddCopy(ref NodeSequenceItem item, int size) { if (this.count == this.items.Length) { this.Grow(this.items.Length * 2); } this.items[this.count] = item; this.items[this.count++].Size = size; }
internal void Add(ref NodeSequenceItem item) { if (this.count == this.items.Length) { this.Grow(this.items.Length * 2); } this.position++; this.items[this.count++].Set(ref item, this.position, this.sizePosition); }
private void Grow(int newSize) { NodeSequenceItem[] destinationArray = new NodeSequenceItem[newSize]; if (this.items != null) { Array.Copy(this.items, destinationArray, this.items.Length); } this.items = destinationArray; }
internal void Add(ref NodeSequenceItem item) { if (this.sequence == null) { this.sequence = this.context.CreateSequence(); this.sequence.StartNodeset(); } this.sequence.Add(ref item); }
void Grow(int newSize) { NodeSequenceItem[] newItems = new NodeSequenceItem[newSize]; if (this.items != null) { Array.Copy(this.items, newItems, this.items.Length); } this.items = newItems; }
internal bool Compare(ref NodeSequenceItem item, RelationOperator op) { for (int i = 0; i < this.count; ++i) { if (this.items[i].Compare(ref item, op)) { return(true); } } return(false); }
public void Trim() { if (this.count == 0) { this.items = null; } else if (this.count < this.items.Length) { NodeSequenceItem[] newItems = new NodeSequenceItem[this.count]; Array.Copy(this.items, newItems, this.count); this.items = newItems; } }
internal static void NumberSum(ProcessingContext context) { StackFrame topArg = context.TopArg; while (topArg.basePtr <= topArg.endPtr) { NodeSequence sequence = context.PeekSequence(topArg.basePtr); double val = 0.0; for (int i = 0; i < sequence.Count; i++) { NodeSequenceItem item = sequence[i]; val += QueryValueModel.Double(item.StringValue()); } context.SetValue(context, topArg.basePtr, val); topArg.basePtr++; } }
internal override Opcode Eval(ProcessingContext context) { StackFrame topSequenceArg = context.TopSequenceArg; Value[] sequences = context.Sequences; context.PushFrame(); for (int i = topSequenceArg.basePtr; i <= topSequenceArg.endPtr; i++) { NodeSequence sequence = sequences[i].Sequence; for (int j = 0; j < sequence.Count; j++) { NodeSequenceItem item = sequence[j]; context.Push(item.Position == this.ordinal); } } return(base.next); }
internal override Opcode Eval(ProcessingContext context) { Value[] values = context.Values; StackFrame topArg = context.TopArg; for (int i = topArg.basePtr; i <= topArg.endPtr; i++) { NodeSequence sequence = values[i].Sequence; NodeSequence val = context.CreateSequence(); for (int j = 0; j < sequence.Count; j++) { NodeSequenceItem item = sequence[j]; val.AddCopy(ref item); } val.Merge(); context.SetValue(context, i, val); } return(base.next); }
internal override Opcode Eval(ProcessingContext context) { StackFrame topSequenceArg = context.TopSequenceArg; StackFrame topArg = context.TopArg; Value[] sequences = context.Sequences; int basePtr = topSequenceArg.basePtr; int index = topArg.basePtr; while (basePtr <= topSequenceArg.endPtr) { NodeSequence sequence = sequences[basePtr].Sequence; for (int i = 0; i < sequence.Count; i++) { NodeSequenceItem item = sequence[i]; context.Values[index].Boolean = item.Position == context.Values[index].Double; index++; } basePtr++; } return(base.next); }
internal override void InvokeInternal(ProcessingContext context, int argCount) { StackFrame topArg = context.TopArg; while (topArg.basePtr <= topArg.endPtr) { string val = string.Empty; NodeSequence sequence = context.PeekSequence(topArg.basePtr); if (sequence.Count > 0) { NodeSequenceItem item = sequence[0]; SeekableXPathNavigator node = item.Node.Node; long currentPosition = node.CurrentPosition; NodeSequenceItem item2 = sequence[0]; node.CurrentPosition = item2.Node.Position; val = ExtractFromNavigator(node); node.CurrentPosition = currentPosition; } context.SetValue(context, topArg.basePtr, val); topArg.basePtr++; } }
internal override Opcode Eval(ProcessingContext context) { Value[] values = context.Values; StackFrame arg = context.TopArg; for (int i = arg.basePtr; i <= arg.endPtr; ++i) { Fx.Assert(ValueDataType.Sequence == values[i].Type, ""); NodeSequence seq = values[i].Sequence; NodeSequence newSeq = context.CreateSequence(); for (int j = 0; j < seq.Count; ++j) { NodeSequenceItem item = seq[j]; newSeq.AddCopy(ref item); } newSeq.Merge(); context.SetValue(context, i, newSeq); } return(this.next); }
public override bool MoveNext() { if (this.data.seq == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("QueryIteratorOutOfScope"))); } if (this.index < this.data.seq.Count) { if (this.nav == null) { NodeSequenceItem item = this.data.seq[this.index]; this.nav = (SeekableXPathNavigator)item.GetNavigator().Clone(); } else { this.nav.CurrentPosition = this.data.seq[this.index].GetNavigatorPosition(); } this.index++; return(true); } this.index++; this.nav = null; return(false); }
internal bool Compare(ref NodeSequenceItem item, RelationOperator op) { for (int i = 0; i < this.count; i++) { if (this.items[i].Compare(ref item, op)) { return true; } } return false; }
internal bool Compare(ref NodeSequenceItem item, RelationOperator op) { return(QueryValueModel.Compare(this.StringValue(), item.StringValue(), op)); }
internal bool Compare(ref NodeSequenceItem item, RelationOperator op) { return QueryValueModel.Compare(this.StringValue(), item.StringValue(), op); }