示例#1
0
        private static extern RCODE xflaim_Query_positionToByKey(
			IntPtr			pQuery,
			IntPtr			pDb,
			uint				uiTimeLimit,
			IntPtr			pDataVector,
			RetrieveFlags	retrieveFlags,
			ref IntPtr		ppNode);
示例#2
0
        //-----------------------------------------------------------------------------
        // 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);
        }
示例#3
0
        private static extern RCODE xflaim_Db_keyRetrieve(
			IntPtr				pDb,
			uint					uiIndex,
			IntPtr				pSearchKey,
			RetrieveFlags		retrieveFlags,
			IntPtr				pFoundKey);
示例#4
0
        private static extern RCODE xflaim_Db_getDocument(
			IntPtr			pDb,
			uint				uiCollection,
			RetrieveFlags	retrieveFlags,
			ulong				ulDocumentId,
			ref IntPtr		pNode);
示例#5
0
        //-----------------------------------------------------------------------------
        // 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);
        }
示例#6
0
        //-----------------------------------------------------------------------------
        // getDocument
        //-----------------------------------------------------------------------------
        /// <summary>
        /// Retrieves a document from the specified collection. 
        /// </summary>
        /// <param name="uiCollection">
        /// The collection from which to retrieve the document
        /// </param>
        /// <param name="retrieveFlags">
        /// Search flags <see cref="RetrieveFlags"/>.
        /// </param>
        /// <param name="ulDocumentId">
        /// Document to retrieve.
        /// </param>
        /// <param name="nodeToReuse">
        /// An existing DOM node object can optionally be passed in.  It will
        /// be reused rather than allocating a new object.
        /// </param>
        /// <returns>
        /// Returns the root <see cref="DOMNode"/> of the document.
        /// </returns>
        public DOMNode getDocument(
			uint				uiCollection,
			RetrieveFlags	retrieveFlags,
			ulong				ulDocumentId,
			DOMNode			nodeToReuse)
        {
            RCODE		rc;
            IntPtr	pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : IntPtr.Zero;

            if ((rc = xflaim_Db_getDocument( m_pDb, uiCollection,
                retrieveFlags, ulDocumentId, ref pNode)) != 0)
            {
                throw new XFlaimException(rc);
            }

            if (nodeToReuse != null)
            {
                nodeToReuse.setNodePtr(pNode, this);
                return( nodeToReuse);
            }

            return( new DOMNode( pNode, this));
        }