Beispiel #1
0
        /// <summary>
        /// Constructor for enumerating over all documents starting from a given sequence
        /// </summary>
        /// <param name="db">The database to retrieve documents from</param>
        /// <param name="lastSequence">The sequence to start enumerating from</param>
        /// <param name="options">The enumeration options (null for default).</param>
        public CBForestDocEnumerator(C4Database *db, long lastSequence, C4EnumeratorOptions options)
        {
            var options_ = &options;

            _currentDocInfo = (C4DocumentInfo *)Marshal.AllocHGlobal(sizeof(C4DocumentInfo)).ToPointer();
            _e = (C4DocEnumerator *)RetryHandler.RetryIfBusy().Execute(err => Native.c4db_enumerateChanges(db, (ulong)lastSequence, options_, err));
        }
Beispiel #2
0
        /// <summary>
        /// Constructor for enumerating over a given subset of documents in a database
        /// </summary>
        /// <param name="db">The database to retrieve documents from</param>
        /// <param name="startKey">The key to start enumeration from</param>
        /// <param name="endKey">The key to end enumeration at</param>
        /// <param name="options">The enumeration options (null for default).</param>
        public CBForestDocEnumerator(C4Database *db, string startKey, string endKey, C4EnumeratorOptions options)
        {
            var options_ = &options;

            _currentDocInfo = (C4DocumentInfo *)Marshal.AllocHGlobal(sizeof(C4DocumentInfo)).ToPointer();
            _e = (C4DocEnumerator *)RetryHandler.RetryIfBusy().Execute(err => Native.c4db_enumerateAllDocs(db, startKey, endKey, options_, err));
        }
        public CBForestDocEnumerator(C4Database *db, long lastSequence, C4EnumeratorOptions options)
        {
            var err = default(C4Error);

            _e = Native.c4db_enumerateChanges(db, (ulong)lastSequence, &options, &err);
            if (_e == null)
            {
                throw new CBForestException(err.code, err.domain);
            }
        }
        public CBForestDocEnumerator(C4Database *db, string startKey, string endKey, C4EnumeratorOptions options)
        {
            var err = default(C4Error);

            _e = Native.c4db_enumerateAllDocs(db, startKey, endKey, &options, &err);
            if (_e == null)
            {
                throw new CBForestException(err.code, err.domain);
            }
        }