예제 #1
0
        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);
        }
예제 #2
0
 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);
 }
예제 #3
0
        public void Close()
        {
            Templater t = new Templater("dsp.bot.txt");

            t.Add("<<PROJECT>>", m_name);
            t.CopyToStream(m_stm);
            m_stm.Close();
        }
예제 #4
0
        private ProjectFile MakeTemplateProjectFile(string fileName)
        {
            ProjectFile pf = new ProjectFile(fileName);
            Templater   t  = CodeGenContext.Current.MakeTemplater(fileName + ".txt");

            using (StreamWriter sw = pf.Create())
                t.CopyToStream(sw);
            return(pf);
        }
예제 #5
0
        public static void Generate(string directory, string name)
        {
            Templater t = new Templater("def.txt");

            using (StreamWriter sw = new StreamWriter(Path.Combine(directory, name + ".def"), false))
            {
                t.CopyToStream(sw);
            }
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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");
        }
예제 #9
0
        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();
        }