public static Index CreateInDir(string path, BuiltSchema schema, bool copy = false) { if (schema == null) { throw new ArgumentNullException(nameof(schema)); } unsafe { return(MarshalHelper.Utf8Call(path, (buffer, len) => { { Index index; TantivyError e; if (copy) { index = CreateInDirCopyImpl(buffer, len, schema, out e); } else { index = CreateInDirMoveImpl(buffer, len, schema, out e); schema.SetHandleAsInvalid(); } if (index.IsInvalid) { throw new TantivyException(e); } return index; } })); } }
public static Index CreateInRam(BuiltSchema schema, bool copy = false) { if (schema == null) { throw new ArgumentNullException(nameof(schema)); } Index index; if (copy) { index = CreateInRamCopyImpl(schema); } else { index = CreateInRamMoveImpl(schema); schema.SetHandleAsInvalid(); } return(index); }
public static Index CreateFromTempDir(BuiltSchema schema, bool copy = false) { Index index; TantivyError e; if (copy) { index = CreateFromTempDirCopyImpl(schema, out e); } else { index = CreateFromTempDirMoveImpl(schema, out e); schema.SetHandleAsInvalid(); } if (index.IsInvalid) { throw new TantivyException(e); } return(index); }
private static unsafe extern Index CreateInDirMoveImpl(byte *path, UIntPtr pathLength, BuiltSchema schema, out TantivyError error);
private static extern Index CreateFromTempDirMoveImpl(BuiltSchema schema, out TantivyError error);
private static extern Index CreateInRamMoveImpl(BuiltSchema schema);