generator: Use TextWriter instead of StreamWriter in base classes
Giving users of the writer more possibility, such as generating the code in strings before actually using it.
This commit is contained in:
parent
2d71de1360
commit
2852b771ea
5 changed files with 14 additions and 5 deletions
|
@ -97,7 +97,7 @@ namespace GtkSharp.Generation {
|
|||
return NS + "Sharp." + Name + "Wrapper.GetManagedDelegate (" + var + ")";
|
||||
}
|
||||
|
||||
public void WriteAccessors (StreamWriter sw, string indent, string var)
|
||||
public void WriteAccessors (TextWriter sw, string indent, string var)
|
||||
{
|
||||
sw.WriteLine (indent + "get {");
|
||||
sw.WriteLine (indent + "\treturn " + FromNative (var) + ";");
|
||||
|
|
|
@ -35,6 +35,15 @@ namespace GtkSharp.Generation {
|
|||
}
|
||||
}
|
||||
|
||||
public override string GenerateGetSizeOf () {
|
||||
return NS + "." + Name + ".abi_info.Size";
|
||||
}
|
||||
|
||||
public override string GenerateAlign () {
|
||||
return NS + "." + Name + ".abi_info.Align";
|
||||
}
|
||||
|
||||
|
||||
public override string MarshalType {
|
||||
get {
|
||||
return "IntPtr";
|
||||
|
@ -58,7 +67,7 @@ namespace GtkSharp.Generation {
|
|||
return FromNative (var, false);
|
||||
}
|
||||
|
||||
public void WriteAccessors (StreamWriter sw, string indent, string var)
|
||||
public void WriteAccessors (TextWriter sw, string indent, string var)
|
||||
{
|
||||
sw.WriteLine (indent + "get {");
|
||||
sw.WriteLine (indent + "\treturn " + FromNative (var, false) + ";");
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace GtkSharp.Generation {
|
|||
|
||||
public interface IAccessor {
|
||||
|
||||
void WriteAccessors (System.IO.StreamWriter sw, string indentation, string field_name);
|
||||
void WriteAccessors (System.IO.TextWriter sw, string indentation, string field_name);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace GtkSharp.Generation {
|
|||
return "(long) " + var;
|
||||
}
|
||||
|
||||
public void WriteAccessors (StreamWriter sw, string indent, string var)
|
||||
public void WriteAccessors (TextWriter sw, string indent, string var)
|
||||
{
|
||||
sw.WriteLine (indent + "get {");
|
||||
sw.WriteLine (indent + "\treturn " + FromNative (var) + ";");
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace GtkSharp.Generation {
|
|||
return "(ulong) " + var;
|
||||
}
|
||||
|
||||
public void WriteAccessors (StreamWriter sw, string indent, string var)
|
||||
public void WriteAccessors (TextWriter sw, string indent, string var)
|
||||
{
|
||||
sw.WriteLine (indent + "get {");
|
||||
sw.WriteLine (indent + "\treturn " + FromNative (var) + ";");
|
||||
|
|
Loading…
Reference in a new issue