19 #include <wx/arrimpl.cpp> 43 TiXmlDocument doc(filename.
mb_str());
49 root = doc.FirstChildElement(
"CodeBlocks_template_file");
53 root = doc.FirstChildElement(
"Code::Blocks_template_file");
56 pMsg->
DebugLog(
_T(
"Not a valid Code::Blocks template file..."));
68 TiXmlElement* node = parentNode->FirstChildElement(
"Template");
71 if (node->Attribute(
"name"))
73 if (node->Attribute(
"title"))
75 if (node->Attribute(
"category"))
77 if (node->Attribute(
"bitmap"))
84 node = node->NextSiblingElement(
"Template");
90 TiXmlElement* node = parentNode->FirstChildElement(
"Notice");
102 TiXmlElement* node = parentNode->FirstChildElement(
"FileSet");
106 if (node->Attribute(
"name"))
107 fs.
name =
cbC2U(node->Attribute(
"name"));
108 if (node->Attribute(
"title"))
117 node = node->NextSiblingElement(
"FileSet");
123 TiXmlElement* node = parentNode->FirstChildElement(
"File");
127 if (node->Attribute(
"source"))
129 if (node->Attribute(
"destination"))
131 if (node->Attribute(
"targets"))
137 node = node->NextSiblingElement(
"File");
143 TiXmlElement* node = parentNode->FirstChildElement(
"Option");
149 if (node->Attribute(
"name"))
150 to.
name =
cbC2U(node->Attribute(
"name"));
154 TiXmlElement* tmpnode = node->FirstChildElement(
"Notice");
170 node = node->NextSiblingElement(
"Option");
176 TiXmlElement* node = parentNode->FirstChildElement(
"Project");
179 if (node->Attribute(
"file"))
180 to.
file =
cbC2U(node->Attribute(
"file"));
181 if (node->Attribute(
"useDefaultCompiler"))
188 TiXmlElement* node = parentNode->FirstChildElement(
"Compiler");
191 if (node->Attribute(
"flag"))
194 node = node->NextSiblingElement(
"Compiler");
200 TiXmlElement* node = parentNode->FirstChildElement(
"Linker");
203 if (node->Attribute(
"flag"))
206 node = node->NextSiblingElement(
"Linker");
void DoOption(TiXmlElement *parentNode)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void DoOptionProject(TiXmlElement *parentNode, TemplateOption &to)
void DoFileSet(TiXmlElement *parentNode)
const wxCharBuffer mb_str(const wxMBConv &conv=wxConvLibc) const
#define wxICON_INFORMATION
TemplateOptionArray m_TemplateOptions
void DoFileSetFile(TiXmlElement *parentNode, FileSet &fs)
DLLIMPORT wxString cbC2U(const char *str)
Return str as a proper unicode-compatible string.
void DoTemplate(TiXmlElement *parentNode)
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
void DoTemplateNotice(TiXmlElement *parentNode)
LogManager * GetLogManager() const
virtual ~ProjectTemplateLoader()
void DoOptionLinker(TiXmlElement *parentNode, TemplateOption &to)
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
size_t Add(const wxString &str, size_t copies=1)
void DoOptionCompiler(TiXmlElement *parentNode, TemplateOption &to)
bool Open(const wxString &filename)
WX_DEFINE_OBJARRAY(FileSetFileArray)