/// <summary> /// Returns the next document from an enumerator, or NULL if there are no more. /// The caller is responsible for freeing the C4Document. /// Don't forget to free the enumerator itself when finished with it. /// </summary> /// <param name="e">The enumerator to operate on</param> /// <param name="outError">The error that occurred if the operation doesn't succeed</param> /// <returns>A pointer to the document on success, otherwise null</returns> public static C4Document* c4enum_nextDocument(C4DocEnumerator *e, C4Error *outError) { #if DEBUG var retVal = _c4enum_nextDocument(e, outError); if(retVal != null) { _AllocatedObjects[(IntPtr)retVal] = "C4Document"; #if ENABLE_LOGGING Console.WriteLine("[c4enum_nextDocument] Allocated 0x{0}", ((IntPtr)retVal).ToString("X")); #endif } return retVal; #else return _c4enum_nextDocument(e, outError); #endif }
public static void c4enum_free(C4DocEnumerator *e) { #if DEBUG var ptr = (IntPtr)e; #if ENABLE_LOGGING if(ptr != IntPtr.Zero && !_AllocatedObjects.ContainsKey(ptr)) { Console.WriteLine("WARNING: [c4enum_free] freeing object 0x{0} that was not found in allocated list", ptr.ToString("X")); } else { #endif _AllocatedObjects.Remove(ptr); #if ENABLE_LOGGING } #endif #endif _c4enum_free(e); }
private static extern C4Document* _c4enum_nextDocument(C4DocEnumerator *e, C4Error *outError);
private static extern void _c4enum_free(C4DocEnumerator *e);