//----------------------------------------------------------------------------- // positionTo //----------------------------------------------------------------------------- /// <summary> /// Position to the <see cref="DOMNode"/> in the result that is at /// the position specified by the searchKey parameter. /// </summary> /// <param name="nodeToReuse"> /// An existing <see cref="DOMNode"/> object can optionally be /// passed in, and it will be reused instead of a new object being allocated. /// </param> /// <param name="uiTimeLimit"> /// Time limit (in milliseconds) for operation to complete. A value of zero /// indicates that the operation should not time out. /// </param> /// <param name="searchKey"> /// This is a key that corresponds to the sort key that was specified using /// the addSortKey method. This method looks up the node in the result set /// that has this search key and returns it. /// </param> /// <param name="retrieveFlags"> /// The search flags that direct how the key is to be used to do positioning. /// This should be values from <see cref="RetrieveFlags"/> that are ORed together. /// </param> /// <returns> /// Returns a <see cref="DOMNode"/> object. /// </returns> public DOMNode positionTo( DOMNode nodeToReuse, uint uiTimeLimit, DataVector searchKey, RetrieveFlags retrieveFlags) { RCODE rc; DOMNode newNode; IntPtr pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : IntPtr.Zero; if ((rc = xflaim_Query_positionToByKey( m_pQuery, m_db.getDb(), uiTimeLimit, searchKey.getDataVector(), retrieveFlags, ref pNode)) != 0) { throw new XFlaimException( rc); } if (nodeToReuse == null) { newNode = new DOMNode( pNode, m_db); } else { newNode = nodeToReuse; newNode.setNodePtr( pNode, m_db); } return( newNode); }
//----------------------------------------------------------------------------- // keyRetrieve //----------------------------------------------------------------------------- /// <summary> /// Lookup/retrieve keys in an index. /// </summary> /// <param name="uiIndex"> /// The index that is being searched. /// </param> /// <param name="searchKey"> /// The search key use for the search. /// </param> /// <param name="retrieveFlags"> /// Search flags <see cref="RetrieveFlags"/>. /// </param> /// <param name="foundKey"> /// Data vector where found key will be returned. If null is passed in /// a new data vector will be created. /// </param> /// <returns> /// Key that was retrieved from the index. /// </returns> public DataVector keyRetrieve( uint uiIndex, DataVector searchKey, RetrieveFlags retrieveFlags, DataVector foundKey) { RCODE rc; IntPtr pSearchKey = (searchKey == null ? IntPtr.Zero : searchKey.getDataVector()); IntPtr pFoundKey; if (foundKey == null) { foundKey = m_dbSystem.createDataVector(); } pFoundKey = foundKey.getDataVector(); if ((rc = xflaim_Db_keyRetrieve( m_pDb, uiIndex, pSearchKey, retrieveFlags, pFoundKey)) != 0) { throw new XFlaimException(rc); } return( foundKey); }