void doTemplate(Templater t, StreamWriter sw) { t.Add("<<CLASS>>", m_cppName); t.Add("<<CLASS_UPPER>>", m_cppName.ToUpper()); t.Add("<<SERIALIZEE>>", m_serializeeName); t.CopyToStream(sw); }
/// <summary> /// Creates and initializes a new Templater object, the Templater replacements are initialized with all the known context values /// </summary> /// <param name="templateFile"></param> /// <returns></returns> public Templater MakeTemplater(string templateFile) { Templater t = new Templater(templateFile); t.Add("<<WSDL_URL>>", WsdlUrl); t.Add("<<DIRECTORY>>", Directory); t.Add("<<PROJECT>>", ProjectName); return(t); }
public dspProject(string directory, string name) { m_stm = new StreamWriter(Path.Combine(directory, name + ".dsp"), false); m_name = name; Templater t = new Templater("dsp.top.txt"); t.Add("<<PROJECT>>", name); t.Add("<<POCKETSOAPDIR>>", Settings.PocketSOAPDirectory); t.CopyToStream(m_stm); }
void InitFiles(string xmlName) { Templater t = CodeGenContext.Current.MakeTemplater("complextype.cpp.txt"); t.Add("<<CLASS>>", m_cppName); t.Add("<<XML_TYPE_NAME>>", xmlName); t.CopyToStream(m_impl); t = CodeGenContext.Current.MakeTemplater("complextype.h.txt"); t.Add("<<CLASS>>", m_cppName); t.Add("<<CLASS_UPPER>>", m_cppName.ToUpper()); t.Add("<<XML_TYPE_NAME>>", xmlName); t.CopyToStream(m_hdr); }
public void Close() { Templater t = new Templater("dsp.bot.txt"); t.Add("<<PROJECT>>", m_name); t.CopyToStream(m_stm); m_stm.Close(); }
public static string GenerateRgs(string projectName, string tlbId, string baseDirectory, ProjectClass cls) { Templater t = new Templater("rgs.txt"); t.Add("<<PROJECT>>", projectName); t.Add("<<CLASS>>", cls.className); t.Add("<<CLSID>>", cls.clsid.ToString().ToUpper()); t.Add("<<TLBID>>", tlbId.ToUpper()); string fn = cls.className + ".rgs"; using (StreamWriter sw = new StreamWriter(Path.Combine(baseDirectory, fn), false)) { t.CopyToStream(sw); } return(fn); }
public ResourceFile(string directory, string name) { m_stm = new StreamWriter(Path.Combine(directory, name + ".rc"), false); m_resource_h = new StreamWriter(Path.Combine(directory, "resource.h"), false); m_name = name; Templater t = new Templater("rc.top.txt"); t.Add("<<PROJECT>>", name); t.CopyToStream(m_stm); m_resource_h.WriteLine("//{{NO_DEPENDENCIES}}"); m_resource_h.WriteLine("// Microsoft Developer Studio generated include file."); m_resource_h.WriteLine("// Used by cgt.rc"); m_resource_h.WriteLine("//"); m_resource_h.WriteLine("#define IDS_PROJNAME 100"); }
public void Close() { Templater t = new Templater("rc.bot.txt"); t.Add("<<PROJECT>>", m_name); t.CopyToStream(m_stm); m_stm.Close(); m_resource_h.WriteLine(""); m_resource_h.WriteLine("// Next default values for new objects"); m_resource_h.WriteLine("// "); m_resource_h.WriteLine("#ifdef APSTUDIO_INVOKED"); m_resource_h.WriteLine("#ifndef APSTUDIO_READONLY_SYMBOLS"); m_resource_h.WriteLine("#define _APS_NEXT_RESOURCE_VALUE {0}", next_id); m_resource_h.WriteLine("#define _APS_NEXT_COMMAND_VALUE 32768"); m_resource_h.WriteLine("#define _APS_NEXT_CONTROL_VALUE 201"); m_resource_h.WriteLine("#define _APS_NEXT_SYMED_VALUE 101"); m_resource_h.WriteLine("#endif"); m_resource_h.WriteLine("#endif"); m_resource_h.Close(); }