Beispiel #1
0
        public void Close()
        {
            Templater t = new Templater("dsp.bot.txt");

            t.Add("<<PROJECT>>", m_name);
            t.CopyToStream(m_stm);
            m_stm.Close();
        }
Beispiel #2
0
        void InitFiles()
        {
            Templater t = CodeGenContext.Current.MakeTemplater("s_complextype.cpp.txt");

            doTemplate(t, m_impl);
            t = CodeGenContext.Current.MakeTemplater("s_complextype.h.txt");
            doTemplate(t, m_hdr);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        /// <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);
        }
Beispiel #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);
            }
        }
Beispiel #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);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
        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();
        }