Пример #1
0
        /// <summary>
        ///		Provides access to the underlying buffer for the given <see cref="JobPointer"/>.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="job"></param>
        /// <param name="io_id"></param>
        /// <param name="resultBuffer"></param>
        /// <returns></returns>
        /// <exception cref="BufferOverflowException"></exception>
        public static bool imageflow_job_get_output_buffer_by_id(ContextPointer context, JobPointer job, int io_id, out JsonReader resultBuffer)
        {
            IntPtr resultBufferPointer;
            long   bufferSize;
            bool   @return = imageflow_job_get_output_buffer_by_id(context, job, io_id, out resultBufferPointer, out bufferSize);

            if (!@return)
            {
                resultBuffer = null;
                return(false);
            }
#pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation
            resultBuffer = new UnmanagedJsonReader(resultBufferPointer, bufferSize);
#pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation
            return(true);
        }
Пример #2
0
        /// <summary>
        ///		Writes fields from the given imageflow_json_response to the locations referenced.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="response_in"></param>
        /// <param name="status_code_out"></param>
        /// <param name="buffer"></param>
        /// <returns></returns>
        /// <exception cref="BufferOverflowException"></exception>
        public static bool imageflow_json_response_read(ContextPointer context, JsonResponsePointer response_in, out long status_code_out, out JsonReader buffer)
        {
            IntPtr bufferPointer;
            IntPtr bufferSize;
            bool   result = imageflow_json_response_read(context, response_in, out status_code_out, out bufferPointer, out bufferSize);

            if (!result)
            {
                buffer = null;
                return(false);
            }
#pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation
            buffer = new UnmanagedJsonReader(bufferPointer, bufferSize.ToInt64());
#pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation
            return(true);
        }
Пример #3
0
 public static extern JobIoPointer imageflow_io_create_for_file(ContextPointer context, IoMode mode, [MarshalAs(UnmanagedType.LPStr)] string filename, CleanupWith cleanup);
Пример #4
0
 public static extern bool imageflow_context_memory_free(ContextPointer context, InternalMemoryPointer pointer, [MarshalAs(UnmanagedType.LPStr)] string filename = null, int line = -1);
Пример #5
0
 private static extern bool imageflow_json_response_read(ContextPointer context, JsonResponsePointer response_in, out long status_code_out, [Out] out IntPtr buffer_utf8_no_nulls_out, [Out] out IntPtr buffer_size_out);
Пример #6
0
 public static extern bool imageflow_context_raise_error(ContextPointer context, ErrorInt32 error_code, [MarshalAs(UnmanagedType.LPStr)][In] string message, [MarshalAs(UnmanagedType.LPStr)][In] string file = null, int line = -1, [MarshalAs(UnmanagedType.LPStr)][In] string function_name = null);
Пример #7
0
 public static extern ErrorInt32 imageflow_context_error_code(ContextPointer context);
Пример #8
0
 public static extern void imageflow_context_clear_error(ContextPointer context);
Пример #9
0
 public static extern bool imageflow_io_get_output_buffer(ContextPointer context, JobIoPointer io, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)][Out] out byte[] result_buffer, [Out] out long result_buffer_length);
Пример #10
0
 private static extern bool imageflow_job_get_output_buffer_by_id(ContextPointer context, JobPointer job, int io_id, [Out] out IntPtr result_buffer, [Out] out long result_buffer_length);
Пример #11
0
 private static extern JsonResponsePointer imageflow_job_send_json(ContextPointer context, JobPointer job, [MarshalAs(UnmanagedType.LPStr)][In] string method, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)][In] byte[] json_buffer, IntPtr json_buffer_size);
Пример #12
0
 /// <summary>
 ///		Sends a JSON message to the <see cref="JobPointer"/>.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="job">The job.</param>
 /// <param name="method">Determines which code path will be used to process the provided JSON data and compose a response.</param>
 /// <param name="json">The json.</param>
 /// <returns><see cref="JsonResponsePointer.Zero"/> on failure.</returns>
 public static JsonResponsePointer imageflow_job_send_json(ContextPointer context, JobPointer job, string method, string json)
 {
     byte[] json_buffer = Encoding.UTF8.GetBytes(json);
     return(imageflow_job_send_json(context, job, method, json_buffer, new IntPtr(json_buffer.Length)));
 }
Пример #13
0
 public static extern bool imageflow_job_destroy(ContextPointer context, JobPointer job);
Пример #14
0
 public static extern bool imageflow_job_add_io(ContextPointer context, JobPointer job, IntPtr io, int placeholder_id, Direction direction);
Пример #15
0
 public static extern bool imageflow_json_response_destroy(ContextPointer context, JsonResponsePointer response);
Пример #16
0
 public static extern JobIoPointer imageflow_io_create_from_buffer(ContextPointer context, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)][In] byte[] buffer, IntPtr buffer_byte_count, Lifetime lifetime, CleanupWith cleanup);
Пример #17
0
 public static extern JobIoPointer imageflow_io_create_for_output_buffer(ContextPointer context);
Пример #18
0
 public static extern JobPointer imageflow_job_create(ContextPointer context);
Пример #19
0
 public static extern bool imageflow_context_has_error(ContextPointer context);
Пример #20
0
 public static extern JobIoPointer imageflow_job_get_io(ContextPointer context, JobPointer job, int placeholder_id);
Пример #21
0
 public static extern NegativeInt32False imageflow_context_error_and_stacktrace(ContextPointer context, [MarshalAs(UnmanagedType.LPStr)][In][Out] StringBuilder buffer, IntPtr buffer_length, [MarshalAs(UnmanagedType.I1)] bool full_file_path);
Пример #22
0
 public static extern bool imageflow_context_begin_terminate(ContextPointer context);
Пример #23
0
 public static extern bool imageflow_context_print_and_exit_if_error(ContextPointer context);
Пример #24
0
 public static extern void imageflow_context_destroy(ContextPointer context);
Пример #25
0
 public static extern bool imageflow_context_add_to_callstack(ContextPointer context, [MarshalAs(UnmanagedType.LPStr)][In] string filename = null, int line = -1, [MarshalAs(UnmanagedType.LPStr)][In] string function_name = null);
Пример #26
0
 public static extern InternalMemoryPointer imageflow_context_memory_allocate(ContextPointer context, uint bytes, [MarshalAs(UnmanagedType.LPStr)] string filename = null, int line = -1);