Пример #1
0
 /// <summary>
 /// Constructor for enumerating over documents which need indexing
 /// by a given indexer
 /// </summary>
 /// <param name="indexer">The indexer to use for enumeration.</param>
 public CBForestDocEnumerator(C4Indexer *indexer)
 {
     _e = (C4DocEnumerator *)RetryHandler.RetryIfBusy().AllowError(0, C4ErrorDomain.Any)
          .Execute(err => Native.c4indexer_enumerateDocuments(indexer, err));
     _currentDocInfo  = (C4DocumentInfo *)Marshal.AllocHGlobal(sizeof(C4DocumentInfo)).ToPointer();
     _validationLogic = doc => !((string)doc->docID).StartsWith("_design/");
 }
Пример #2
0
        public CBForestDocEnumerator(C4Indexer *indexer)
        {
            var err = default(C4Error);

            _e = Native.c4indexer_enumerateDocuments(indexer, &err);
            if (_e == null && (err.code != 0 || err.domain != C4ErrorDomain.ForestDB))
            {
                throw new CBForestException(err.code, err.domain);
            }

            _validationLogic = doc => !((string)doc->docID).StartsWith("_design/");
        }