Update of /cvsroot/mahogany/M/src/classes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21212/src/classes

Modified Files:
        Profile.cpp 
Log Message:
added CreateTemplateProfile()

Index: Profile.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/classes/Profile.cpp,v
retrieving revision 1.167
retrieving revision 1.168
diff -b -u -2 -r1.167 -r1.168
--- Profile.cpp 7 Jul 2005 18:48:44 -0000       1.167
+++ Profile.cpp 20 Jul 2005 17:25:33 -0000      1.168
@@ -295,4 +295,23 @@
 };
 
+class TemplateProfile : public ProfileImpl
+{
+public:
+   static TemplateProfile * Create(const String& kind)
+      { return new TemplateProfile(kind); }
+
+   virtual const wxChar * GetProfileSection(void) const
+      {
+         return M_TEMPLATES_CONFIG_SECTION;
+      }
+private:
+   TemplateProfile(const String& kind)
+      {
+         m_ProfileName << GetRootPath() << _T('/') << kind;
+      }
+
+   DECLARE_NO_COPY_CLASS(TemplateProfile)
+};
+
 /// Same as Identity and FilterProfile but for "/Modules" branch
 class ModuleProfile : public ProfileImpl
@@ -488,4 +507,16 @@
 }
 
+/* static */
+Profile *
+Profile::CreateTemplateProfile(const String& kind)
+{
+   ASSERT_MSG( !kind.empty() && *kind.c_str() != _T('/'),
+                  _T("invalid template name") );
+
+   Profile *p =  TemplateProfile::Create(kind);
+   EnforcePolicy(p);
+   return p;
+}
+
 Profile *
 Profile::CreateModuleProfile(const String & classname, Profile const *parent)



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to