forked from enlightenment/efl
csharp: updating eina_binbuf docs and hide api.
Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8293 Differential Revision: https://phab.enlightenment.org/D10310
This commit is contained in:
parent
3f4c7637db
commit
85c57500ea
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Eina
|
namespace Eina
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Generic buffer designed to be a mutable string.
|
/// A Generic buffer designed to be a mutable string.
|
||||||
///
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// Since EFL 1.23.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Binbuf : IDisposable
|
public class Binbuf : IDisposable
|
||||||
{
|
{
|
||||||
|
@ -45,11 +45,16 @@ public class Binbuf : IDisposable
|
||||||
eina_binbuf_slice_get(IntPtr buf);
|
eina_binbuf_slice_get(IntPtr buf);
|
||||||
|
|
||||||
/// <summary>Pointer to the native buffer.</summary>
|
/// <summary>Pointer to the native buffer.</summary>
|
||||||
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public IntPtr Handle {get;set;} = IntPtr.Zero;
|
public IntPtr Handle {get;set;} = IntPtr.Zero;
|
||||||
///<summary>Whether this wrapper owns the native buffer.</summary>
|
/// <summary>Whether this wrapper owns the native buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
public bool Own {get;set;}
|
public bool Own {get;set;}
|
||||||
|
|
||||||
/// <summary> Length of the buffer.</summary>
|
/// <summary> Length of the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
public int Length
|
public int Length
|
||||||
{
|
{
|
||||||
get { return (int)GetLength(); }
|
get { return (int)GetLength(); }
|
||||||
|
@ -67,12 +72,17 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new buffer.
|
/// Create a new buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Binbuf()
|
public Binbuf()
|
||||||
{
|
{
|
||||||
InitNew();
|
InitNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
public Binbuf(byte[] str, uint? length = null)
|
public Binbuf(byte[] str, uint? length = null)
|
||||||
{
|
{
|
||||||
InitNew();
|
InitNew();
|
||||||
|
@ -90,6 +100,7 @@ public class Binbuf : IDisposable
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new buffer with elements.
|
/// Create a new buffer with elements.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// <param name="bb">Elements to initialize the new buffer.</param>
|
/// <param name="bb">Elements to initialize the new buffer.</param>
|
||||||
public Binbuf(Binbuf bb)
|
public Binbuf(Binbuf bb)
|
||||||
{
|
{
|
||||||
|
@ -106,6 +117,7 @@ public class Binbuf : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle">The native handle to be wrapped.</param>
|
/// <param name="handle">The native handle to be wrapped.</param>
|
||||||
/// <param name="own">Whether this wrapper owns the native handle.</param>
|
/// <param name="own">Whether this wrapper owns the native handle.</param>
|
||||||
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public Binbuf(IntPtr handle, bool own)
|
public Binbuf(IntPtr handle, bool own)
|
||||||
{
|
{
|
||||||
Handle = handle;
|
Handle = handle;
|
||||||
|
@ -117,8 +129,11 @@ public class Binbuf : IDisposable
|
||||||
Dispose(false);
|
Dispose(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Disposes of this wrapper, releasing the native buffer if owned.</summary>
|
/// <summary>Disposes of this wrapper, releasing the native buffer if owned.
|
||||||
/// <param name="disposing">True if this was called from <see cref="Dispose()"/> public method. False if
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">True if this was called from
|
||||||
|
/// <see cref="Dispose()"/> public method. False if
|
||||||
/// called from the C# finalizer.</param>
|
/// called from the C# finalizer.</param>
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
@ -137,14 +152,18 @@ public class Binbuf : IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Releases the native resources held by this instance.</summary>
|
/// <summary>Releases the native resources held by this instance.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Releases the native resources held by this instance.</summary>
|
/// <summary>Releases the native resources held by this instance.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
/// </summary>
|
||||||
public void Free()
|
public void Free()
|
||||||
{
|
{
|
||||||
Dispose();
|
Dispose();
|
||||||
|
@ -152,6 +171,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Releases the native buffer.
|
/// Releases the native buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The native buffer.</returns>
|
/// <returns>The native buffer.</returns>
|
||||||
public IntPtr Release()
|
public IntPtr Release()
|
||||||
|
@ -163,6 +183,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets the buffer.
|
/// Resets the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
|
@ -170,7 +191,9 @@ public class Binbuf : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends a string of inputed buffer's length to the buffer, reallocating as necessary.
|
/// Appends a string of inputed buffer's length to the buffer,
|
||||||
|
/// reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str">The string buffer.</param>
|
/// <param name="str">The string buffer.</param>
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
|
@ -180,7 +203,9 @@ public class Binbuf : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends a string of exact length to the buffer, reallocating as necessary.
|
/// Appends a string of exact length to the buffer, reallocating
|
||||||
|
/// as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str">The string buffer.</param>
|
/// <param name="str">The string buffer.</param>
|
||||||
/// <param name="length">The exact length to use.</param>
|
/// <param name="length">The exact length to use.</param>
|
||||||
|
@ -192,6 +217,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends a Binbuf to the buffer.
|
/// Appends a Binbuf to the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="bb">The buffer to be appended.</param>
|
/// <param name="bb">The buffer to be appended.</param>
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
|
@ -202,6 +228,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends a character to the buffer, reallocating as necessary.
|
/// Appends a character to the buffer, reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="c">The char to appended.</param>
|
/// <param name="c">The char to appended.</param>
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
|
@ -212,6 +239,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Appends a slice to the buffer, reallocating as necessary.
|
/// Appends a slice to the buffer, reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slice">The slice to appended.</param>
|
/// <param name="slice">The slice to appended.</param>
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
|
@ -221,7 +249,9 @@ public class Binbuf : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inserts a string of inputed buffer's length into the buffer, reallocating as necessary.
|
/// Inserts a string of inputed buffer's length into the buffer,
|
||||||
|
/// reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str">The string buffer.</param>
|
/// <param name="str">The string buffer.</param>
|
||||||
/// <param name="pos">The position to insert the string.</param>
|
/// <param name="pos">The position to insert the string.</param>
|
||||||
|
@ -232,7 +262,9 @@ public class Binbuf : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inserts a string of exact length into the buffer, reallocating as necessary.
|
/// Inserts a string of exact length into the buffer,
|
||||||
|
/// reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str">The string buffer.</param>
|
/// <param name="str">The string buffer.</param>
|
||||||
/// <param name="length">The exact length to use.</param>
|
/// <param name="length">The exact length to use.</param>
|
||||||
|
@ -245,6 +277,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inserts a character into the buffer, reallocating as necessary.
|
/// Inserts a character into the buffer, reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="c">The char to appended.</param>
|
/// <param name="c">The char to appended.</param>
|
||||||
/// <param name="pos">The position to insert the string.</param>
|
/// <param name="pos">The position to insert the string.</param>
|
||||||
|
@ -256,6 +289,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inserts a slice into the buffer, reallocating as necessary.
|
/// Inserts a slice into the buffer, reallocating as necessary.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="slice">The slice to appended.</param>
|
/// <param name="slice">The slice to appended.</param>
|
||||||
/// <param name="pos">The position to insert the string.</param>
|
/// <param name="pos">The position to insert the string.</param>
|
||||||
|
@ -267,6 +301,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a slice of the buffer.
|
/// Removes a slice of the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="start">The initial (inclusive) slice position to start
|
/// <param name="start">The initial (inclusive) slice position to start
|
||||||
/// removing, in bytes.</param>
|
/// removing, in bytes.</param>
|
||||||
|
@ -280,6 +315,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a string to the contents of the buffer.
|
/// Retrieves a string to the contents of the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The string that is contained in buffer.</returns>
|
/// <returns>The string that is contained in buffer.</returns>
|
||||||
public byte[] GetBytes()
|
public byte[] GetBytes()
|
||||||
|
@ -300,6 +336,7 @@ public class Binbuf : IDisposable
|
||||||
/// Retrieves a string to the contents of the buffer.
|
/// Retrieves a string to the contents of the buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The string that is contained in buffer.</returns>
|
/// <returns>The string that is contained in buffer.</returns>
|
||||||
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public IntPtr GetStringNative()
|
public IntPtr GetStringNative()
|
||||||
{
|
{
|
||||||
return eina_binbuf_string_get(Handle);
|
return eina_binbuf_string_get(Handle);
|
||||||
|
@ -307,6 +344,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Frees the buffer.
|
/// Frees the buffer.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void FreeString()
|
public void FreeString()
|
||||||
{
|
{
|
||||||
|
@ -315,6 +353,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the length of the buffer's contents.
|
/// Retrieves the length of the buffer's contents.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UIntPtr GetLength()
|
public UIntPtr GetLength()
|
||||||
{
|
{
|
||||||
|
@ -323,6 +362,7 @@ public class Binbuf : IDisposable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a slice of the buffer's contents.
|
/// Gets a slice of the buffer's contents.
|
||||||
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Eina.Slice GetSlice()
|
Eina.Slice GetSlice()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue