index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000000.html
mono
&raquo
dir_000001.html
DBusType
String.cs
00001
using
System;
00002
using
System.Runtime.InteropServices;
00003
using
System.Reflection.Emit;
00004
00005
using
DBus;
00006
00007
namespace
DBus.DBusType
00008 {
classDBus_1_1DBusType_1_1String.html
00012
public
class
classDBus_1_1DBusType_1_1String.html
String
:
interfaceDBus_1_1DBusType_1_1IDBusType.html
IDBusType
00013   {
classDBus_1_1DBusType_1_1String.html#o0
00014
public
const
char
Code =
's'
;
00015
private
string val;
00016
00017
private
classDBus_1_1DBusType_1_1String.html
String
()
00018     {
00019     }
00020
classDBus_1_1DBusType_1_1String.html#a0
00021
public
classDBus_1_1DBusType_1_1String.html
String
(string val,
classDBus_1_1Service.html
Service
service)
00022     {
00023
this
.val = val;
00024     }
00025
classDBus_1_1DBusType_1_1String.html#a1
00026
public
classDBus_1_1DBusType_1_1String.html
String
(IntPtr iter,
classDBus_1_1Service.html
Service
service)
00027     {
00028       IntPtr raw;
00029
00030
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(iter, out raw);
00031
00032
this
.val = Marshal.PtrToStringAnsi (raw);
00033     }
00034
classDBus_1_1DBusType_1_1String.html#a2
00035
public
void
Append(IntPtr iter)
00036     {
00037       IntPtr marshalVal = Marshal.StringToHGlobalAnsi (val);
00038
00039
bool
success =
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(iter, (
int
) Code, ref marshalVal);
00040       Marshal.FreeHGlobal (marshalVal);
00041
00042
if
(!success)
00043
throw
new
ApplicationException(
"Failed to append STRING argument:"
+ val);
00044     }
00045
classDBus_1_1DBusType_1_1String.html#e0
00046
public
static
bool
Suits(System.Type type)
00047     {
00048
switch
(type.ToString()) {
00049
case
"System.String"
:
00050
case
"System.String&"
:
00051
return
true
;
00052       }
00053
00054
return
false
;
00055     }
00056
classDBus_1_1DBusType_1_1String.html#e1
00057
public
static
void
EmitMarshalIn(ILGenerator generator, Type type)
00058     {
00059
if
(type.IsByRef) {
00060         generator.Emit(OpCodes.Ldind_Ref);
00061       }
00062     }
00063
classDBus_1_1DBusType_1_1String.html#e2
00064
public
static
void
EmitMarshalOut(ILGenerator generator, Type type,
bool
isReturn)
00065     {
00066       generator.Emit(OpCodes.Castclass, type);
00067
if
(!isReturn) {
00068         generator.Emit(OpCodes.Stind_Ref);
00069       }
00070     }
00071
classDBus_1_1DBusType_1_1String.html#a3
00072
public
object Get()
00073     {
00074
return
this
.val;
00075     }
00076
classDBus_1_1DBusType_1_1String.html#a4
00077
public
object Get(System.Type type)
00078     {
00079
switch
(type.ToString())
00080         {
00081
case
"System.String"
:
00082
case
"System.String&"
:
00083
return
this
.val;
00084
default
:
00085
throw
new
ArgumentException(
"Cannot cast DBus.Type.String to type '"
+ type.ToString() +
"'"
);
00086         }
00087     }
00088
00089     [DllImport(
"dbus-1"
)]
00090
private
extern
static
void
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(IntPtr iter, out IntPtr value);
00091
00092     [DllImport(
"dbus-1"
)]
00093
private
extern
static
bool
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(IntPtr iter,
int
type, ref IntPtr value);
00094   }
00095 }
Generated on Tue Sep 13 01:28:08 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
