/** <summary>Create an interface from the input stream</summary> */ public StringTemplateGroupInterface(TextReader r, IStringTemplateErrorListener errors, StringTemplateGroupInterface superInterface) { this._listener = errors; SuperInterface = superInterface; ParseInterface(r); }
public virtual StringTemplateGroupInterface LoadInterface(string interfaceName) { StringTemplateGroupInterface I = null; try { TextReader br = Locate(interfaceName + ".sti"); if (br == null) { Error("no such interface file " + interfaceName + ".sti"); return(null); } I = new StringTemplateGroupInterface(br, _errors); } catch (IOException ioe) { Error("can't load interface " + interfaceName, ioe); } return(I); }
/** <summary>Just track the new interface; check later. Allows dups, but no biggie.</summary> */ public virtual void ImplementInterface( StringTemplateGroupInterface I ) { if ( _interfaces == null ) { _interfaces = new List<StringTemplateGroupInterface>(); } _interfaces.Add( I ); }
/** <summary>Create an interface from the input stream</summary> */ public StringTemplateGroupInterface( TextReader r, IStringTemplateErrorListener errors, StringTemplateGroupInterface superInterface ) { this._listener = errors; SuperInterface = superInterface; ParseInterface( r ); }
public void TestInterfaceFileFormat() { string groupI = "interface test;" + newline + "t();" + newline + "bold(item);" + newline + "optional duh(a,b,c);" + newline; StringTemplateGroupInterface I = new StringTemplateGroupInterface( new StringReader( groupI ) ); string expecting = "interface test;" + newline + "t();" + newline + "bold(item);" + newline + "optional duh(a, b, c);" + newline; Assert.AreEqual( expecting, I.ToString() ); }
public virtual StringTemplateGroupInterface LoadInterface( string interfaceName ) { StringTemplateGroupInterface I = null; try { TextReader br = Locate( interfaceName + ".sti" ); if ( br == null ) { Error( "no such interface file " + interfaceName + ".sti" ); return null; } I = new StringTemplateGroupInterface( br, _errors ); } catch ( IOException ioe ) { Error( "can't load interface " + interfaceName, ioe ); } return I; }