[vlc-devel] commit: Separate MemoryHandle and StringHandle ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Feb 22 09:56:58 CET 2009
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Feb 22 10:06:15 2009 +0200| [987437599c1e284b11f647e45b6688518909b834] | committer: Rémi Denis-Courmont
Separate MemoryHandle and StringHandle
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=987437599c1e284b11f647e45b6688518909b834
---
bindings/cil/src/libvlc.cs | 2 +-
bindings/cil/src/media.cs | 2 +-
bindings/cil/src/ustring.cs | 14 +++++++++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/bindings/cil/src/libvlc.cs b/bindings/cil/src/libvlc.cs
index 570d189..3fcfe59 100644
--- a/bindings/cil/src/libvlc.cs
+++ b/bindings/cil/src/libvlc.cs
@@ -98,7 +98,7 @@ namespace VideoLAN.LibVLC
[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_mrl")]
public static extern
- MemoryHandle MediaGetMRL (MediaHandle media, NativeException ex);
+ StringHandle MediaGetMRL (MediaHandle media, NativeException ex);
[DllImport ("libvlc.dll", EntryPoint="libvlc_media_duplicate")]
public static extern
diff --git a/bindings/cil/src/media.cs b/bindings/cil/src/media.cs
index 39f0290..a6ed833 100644
--- a/bindings/cil/src/media.cs
+++ b/bindings/cil/src/media.cs
@@ -102,7 +102,7 @@ namespace VideoLAN.LibVLC
{
get
{
- MemoryHandle str = LibVLC.MediaGetMRL (Handle, ex);
+ StringHandle str = LibVLC.MediaGetMRL (Handle, ex);
Raise ();
return str.Transform ();
}
diff --git a/bindings/cil/src/ustring.cs b/bindings/cil/src/ustring.cs
index f70eb2b..e55c425 100644
--- a/bindings/cil/src/ustring.cs
+++ b/bindings/cil/src/ustring.cs
@@ -96,7 +96,7 @@ namespace VideoLAN.LibVLC
* @brief MemoryHandle: heap allocation by the C run-time
* @ingroup Internals
*/
- internal sealed class MemoryHandle : NonNullHandle
+ internal class MemoryHandle : NonNullHandle
{
[DllImport ("libvlc.dll", EntryPoint="libvlc_free")]
private static extern void Free (IntPtr ptr);
@@ -108,7 +108,19 @@ namespace VideoLAN.LibVLC
{
Free (handle);
}
+ };
+ /**
+ * @brief StringHandle: heap-allocated characters array
+ * @ingroup Internals
+ */
+ internal sealed class StringHandle : MemoryHandle
+ {
+ /**
+ * Converts an heap-allocated nul-terminated UTF-8 characters array
+ * into a managed string.
+ * @return the resulting managed string.
+ */
public override string ToString ()
{
return U8String.FromNative (handle);
More information about the vlc-devel
mailing list