本文整理汇总了C++中wxString::GetFullPath方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::GetFullPath方法的具体用法?C++ wxString::GetFullPath怎么用?C++ wxString::GetFullPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::GetFullPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool cxProjectInfo::Load(const wxFileName& rootPath, const wxString& path, bool onlyFilters) {
wxFileName projectPath(path, wxEmptyString);
this->path = path;
this->isRoot = (projectPath == rootPath);
projectPath.SetFullName(wxT(".eprj"));
if (!projectPath.FileExists()) return false;
// Load plist file
TiXmlDocument doc;
wxFFile docffile(projectPath.GetFullPath(), _T("rb"));
wxCHECK(docffile.IsOpened() && doc.LoadFile(docffile.fp()), false);
// Get top dict
const TiXmlHandle docHandle(&doc);
const TiXmlElement* topDict = docHandle.FirstChildElement("plist").FirstChildElement().Element();
if (!topDict || strcmp(topDict->Value(), "dict") != 0) return false; // empty plist
// Parse entries
const TiXmlElement* entry = topDict->FirstChildElement();
for(; entry; entry = entry->NextSiblingElement() ) {
if (strcmp(entry->Value(), "key") != 0) return false; // invalid dict
const TiXmlElement* const value = entry->NextSiblingElement();
if (strcmp(entry->GetText(), "filters") == 0) {
// Load all filters
const TiXmlElement* filter = value->FirstChildElement();
for(; filter; filter = filter->NextSiblingElement() ) {
if (strcmp(filter->Value(), "key") != 0) return false; // invalid dict
// Set target array
wxArrayString* filterArray = NULL;
const char* filterName = filter->GetText();
if (strcmp(filterName, "includeDirs") == 0) filterArray = &this->includeDirs;
else if (strcmp(filterName, "excludeDirs") == 0) filterArray = &this->excludeDirs;
else if (strcmp(filterName, "includeFiles") == 0) filterArray = &this->includeFiles;
else if (strcmp(filterName, "excludeFiles") == 0) filterArray = &this->excludeFiles;
else {
wxASSERT(false);
break;
}
const TiXmlElement* const array = filter->NextSiblingElement();
if (strcmp(array->Value(), "array") != 0) return false; // invalid dict
const TiXmlElement* child = array->FirstChildElement();
for(; child; child = child->NextSiblingElement() ) {
const char* valType = child->Value();
if (strcmp(valType, "string") == 0) {
const char* pattern = child->GetText();
if (pattern) filterArray->Add(wxString(pattern, wxConvUTF8));
}
else {
wxASSERT(false);
}
}
filter = array; // jump over value
}
this->hasFilters = true;
if (onlyFilters) return true;
}
else if (strcmp(entry->GetText(), "environment") == 0) {
// Load all env variables
const TiXmlElement* env = value->FirstChildElement();
for(; env; env = env->NextSiblingElement() ) {
// Get Key
if (strcmp(env->Value(), "key") != 0) return false; // invalid dict
const char* key = env->GetText();
const TiXmlElement* const val = env->NextSiblingElement();
if (strcmp(val->Value(), "string") != 0) return false; // invalid dict
const char* value = val->GetText();
if (key) {
this->env[wxString(key, wxConvUTF8)] = value ? wxString(value, wxConvUTF8) : *wxEmptyString;
}
env = val; // jump over value
}
}
else if (strcmp(entry->GetText(), "fileTriggers") == 0) {
// Load all env variables
const TiXmlElement* trigger = value->FirstChildElement();
for(; trigger; trigger = trigger->NextSiblingElement() ) {
// Get Key
if (strcmp(trigger->Value(), "key") != 0) return false; // invalid dict
const char* key = trigger->GetText();
const TiXmlElement* const val = trigger->NextSiblingElement();
if (strcmp(val->Value(), "string") != 0) return false; // invalid dict
const char* value = val->GetText();
if (key && value) {
wxFileName path(wxString(value, wxConvUTF8));
path.MakeAbsolute(rootPath.GetPath());
this->triggers[wxString(key, wxConvUTF8)] = path.GetFullPath();
//.........这里部分代码省略.........