Opentk/Source/Bind/BindStreamWriter.cs
the_fiddler e220f3a71a Updated Build.exe to correctly generate sharpdev and sharpdev2 projects.
Removed some unused variables.
Added licensing information.
2007-08-10 09:27:13 +00:00

60 lines
1.4 KiB
C#

#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Bind.Structures;
namespace Bind
{
class BindStreamWriter : StreamWriter
{
public BindStreamWriter(string file)
: base(file)
{
}
private string indent = "";
public void Indent()
{
indent = " " + indent;
}
public void Unindent()
{
if (!String.IsNullOrEmpty(indent))
indent = indent.Substring(4);
}
public override void Write(string value)
{
base.Write(indent + value);
}
public override void WriteLine(string value)
{
base.WriteLine(indent + value);
}
public void Write(Bind.Structures.Enum e)
{
StringBuilder sb = new StringBuilder(e.ToString());
sb.Replace(System.Environment.NewLine, System.Environment.NewLine + indent);
Write(sb);
}
public void Write(Bind.Structures.Function f)
{
StringBuilder sb = new StringBuilder(f.ToString());
sb.Replace(System.Environment.NewLine, System.Environment.NewLine + indent);
Write(sb);
}
}
}