internal LiteCoreDocEnumerator(C4Database *parent, C4SequenceNumber seq, C4EnumeratorOptions options)
 {
     Native = (C4DocEnumerator *)LiteCoreBridge.Check(err =>
     {
         var localOpts = options;
         return(Interop.Native.c4db_enumerateChanges(parent, seq, &localOpts, err));
     });
 }
 public LiteCoreDocEnumerator GetChangesSince(C4SequenceNumber seq, C4EnumeratorOptions options)
 {
     return(new LiteCoreDocEnumerator(_native, seq, options));
 }
 public LiteCoreDocEnumerator GetEnumerator(IEnumerable <string> docIDs, C4EnumeratorOptions options)
 {
     return(new LiteCoreDocEnumerator(_native, docIDs, options));
 }
 public LiteCoreDocEnumerator GetEnumerator(string startDocID, string endDocID, C4EnumeratorOptions options)
 {
     return(new LiteCoreDocEnumerator(_native, startDocID, endDocID, options));
 }
 internal LiteCoreDocEnumerator(C4Database *parent, string startDocId, string endDocId, C4EnumeratorOptions options)
 {
     Native = (C4DocEnumerator *)LiteCoreBridge.Check(err =>
     {
         var localOpts = options;
         return(Interop.Native.c4db_enumerateAllDocs(parent, startDocId, endDocId, &localOpts, err));
     });
 }
 internal LiteCoreDocEnumerator(C4Database *parent, IEnumerable <string> docIDs, C4EnumeratorOptions options)
 {
     Native = (C4DocEnumerator *)LiteCoreBridge.Check(err =>
     {
         var localOpts = options;
         return(Interop.Native.c4db_enumerateSomeDocs(parent, docIDs.ToArray(), &localOpts, err));
     });
 }
Ejemplo n.º 7
0
 private static extern C4DocEnumerator* _c4db_enumerateSomeDocs(C4Database *db, C4Slice* docIDs, uint docIDsCount, 
     C4EnumeratorOptions *options, C4Error *outError);
Ejemplo n.º 8
0
        public static C4DocEnumerator* c4db_enumerateSomeDocs(C4Database *db, string[] docIDs, C4EnumeratorOptions *options,
            C4Error *outError)
        {
            var c4StringArr = docIDs.Select(x => new C4String(x)).ToArray();
            var sliceArr = c4StringArr.Select(x => x.AsC4Slice()).ToArray();
            var retVal = default(C4DocEnumerator*);
            fixed(C4Slice* ptr = sliceArr) {
                retVal = _c4db_enumerateSomeDocs(db, ptr, (uint)docIDs.Length, options, outError);
                #if DEBUG
                if(retVal != null) {
                    _AllocatedObjects[(IntPtr)retVal] = "C4DocEnumerator";
                #if ENABLE_LOGGING
                    Console.WriteLine("[c4db_enumerateSomeDocs] Allocated 0x{0}", ((IntPtr)retVal).ToString("X"));
                #endif
                }
                #endif
            }

            foreach (var c4str in c4StringArr) {
                c4str.Dispose();
            }

            return retVal;
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates an enumerator ordered by docID.
 /// Options have the same meanings as in Couchbase Lite.
 /// There's no 'limit' option; just stop enumerating when you're done.
 /// Caller is responsible for freeing the enumerator when finished with it.
 /// </summary>
 /// <param name="db">The database to operate on</param>
 /// <param name="startDocID">The document ID to begin at</param>
 /// <param name="endDocID">The document ID to end at</param>
 /// <param name="options">Enumeration options (NULL for defaults)</param>
 /// <param name="outError">The error that occurred if the operation doesn't succeed</param>
 /// <returns>A pointer to the enumeator on success, otherwise null</returns>
 public static C4DocEnumerator* c4db_enumerateAllDocs(C4Database *db, string startDocID, string endDocID, C4EnumeratorOptions *options,
     C4Error *outError)
 {
     using(var startDocID_ = new C4String(startDocID))
     using(var endDocID_ = new C4String(endDocID)) {
         return c4db_enumerateAllDocs(db, startDocID_.AsC4Slice(), endDocID_.AsC4Slice(), options, outError);
     }
 }
Ejemplo n.º 10
0
        public static C4DocEnumerator* c4db_enumerateAllDocs(C4Database *db, C4Slice startDocID, C4Slice endDocID, 
            C4EnumeratorOptions *options, C4Error *outError)
        {
            #if DEBUG
            var retVal = _c4db_enumerateAllDocs(db, startDocID, endDocID, options, outError);
            if(retVal != null) {
                _AllocatedObjects[(IntPtr)retVal] = "C4DocEnumerator";
                #if ENABLE_LOGGING
                Console.WriteLine("[c4db_enumerateAllDocs] Allocated 0x{0}", ((IntPtr)retVal).ToString("X"));
                #endif
            }

            return retVal;
            #else
            return _c4db_enumerateAllDocs(db, startDocID, endDocID, options, outError);
            #endif
        }
Ejemplo n.º 11
0
 private static extern C4DocEnumerator* _c4db_enumerateAllDocs(C4Database *db, C4Slice startDocID, C4Slice endDocID, 
     C4EnumeratorOptions *options, C4Error *outError);
Ejemplo n.º 12
0
 private static extern C4DocEnumerator* _c4db_enumerateChanges(C4Database* db, ulong since, C4EnumeratorOptions* options, 
     C4Error* outError);
Ejemplo n.º 13
0
        /// <summary>
        /// Creates an enumerator ordered by sequence.
        /// Caller is responsible for freeing the enumerator when finished with it.
        /// </summary>
        /// <param name="db">The database to operate on</param>
        /// <param name="since">The sequence number to start _after_.Pass 0 to start from the beginning.</param>
        /// <param name="options">Enumeration options (NULL for defaults).</param>
        /// <param name="outError">The error that occurred if the operation doesn't succeed</param>
        /// <returns>A pointer to the enumeator on success, otherwise null</returns>
        public static C4DocEnumerator* c4db_enumerateChanges(C4Database* db, ulong since, C4EnumeratorOptions* options, 
            C4Error* outError)
        {
            #if DEBUG
            var retVal = _c4db_enumerateChanges(db, since, options, outError);
            if(retVal != null) {
                _AllocatedObjects.TryAdd((IntPtr)retVal, "C4DocEnumerator");
                #if ENABLE_LOGGING
                Console.WriteLine("[c4db_enumerateChanges] Allocated 0x{0}", ((IntPtr)retVal).ToString("X"));
                #endif
            }

            return retVal;
            #else
            return _c4db_enumerateChanges(db, since, options, outError);
            #endif
        }