36 #if defined(__APPLE__) && defined(__MACH__) 37 #include <sys/param.h> 38 #include <mach-o/dyld.h> 42 #if wxCHECK_VERSION(3, 0, 0) 43 #include "wx/osx/core/cfstring.h" 45 #include "wx/mac/corefoundation/cfstring.h" 49 #include <CoreFoundation/CFBundle.h> 50 #include <CoreFoundation/CFURL.h> 60 template<>
CfgMgrBldr* Mgr<CfgMgrBldr>::instance =
nullptr;
71 wxString ConfigManager::plugin_path_global;
92 GetModuleFileName(0L, name, MAX_PATH);
94 return fname.
GetPath(wxPATH_GET_VOLUME);
98 char *p =
realpath(
"/proc/self/exe", &c[0]);
102 return fname.
GetPath(wxPATH_GET_VOLUME);
103 #elif defined(sun) || defined(__sun) 105 return fname.
GetPath(wxPATH_GET_VOLUME);
106 #elif defined(__APPLE__) && defined(__MACH__) 107 char path[MAXPATHLEN+1];
108 uint32_t path_len = MAXPATHLEN;
110 _NSGetExecutablePath(path, &path_len);
112 return fname.
GetPath(wxPATH_GET_VOLUME);
121 #if defined(__WXMAC__) 122 CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
123 CFURLRef absoluteURL = CFURLCopyAbsoluteURL(resourcesURL);
124 CFRelease(resourcesURL);
125 CFStringRef cfStrPath = CFURLCopyFileSystemPath(absoluteURL,kCFURLPOSIXPathStyle);
126 CFRelease(absoluteURL);
127 #if wxCHECK_VERSION(3, 0, 0) 133 return ::DetermineExecutablePath() +
_T(
"/..");
158 while (*src ==
_T(
'/'))
182 TiXmlBase::SetCondenseWhiteSpace(
false);
196 doc =
new TiXmlDocument();
197 doc->InsertEndChild(TiXmlDeclaration(
"1.0",
"UTF-8",
"yes"));
198 doc->InsertEndChild(TiXmlElement(
"CodeBlocksConfig"));
211 wxString e(exePath + wxFILE_SEP_PATH + filename);
232 message =
wxString::Format(
_(
"TinyXML error: %s\nIn file: %s\nAt row %d, column: %d.\n\n"),
234 doc.ErrorRow(), doc.ErrorCol());
236 message += additionalMessage;
240 message +
_(
"\n\nDiscard old config file?"),
_(
"Config file read error"),
242 #if wxCHECK_VERSION(3, 0, 0) 249 doc.InsertEndChild(TiXmlDeclaration(
"1.0",
"UTF-8",
"yes"));
250 doc.InsertEndChild(TiXmlElement(
"CodeBlocksConfig"));
256 doc =
new TiXmlDocument();
265 TiXmlElement* docroot =
doc->FirstChildElement(
"CodeBlocksConfig");
271 docroot =
doc->FirstChildElement(
"CodeBlocksConfig");
274 cbThrow(
wxT(
"Something really bad happened while reading the config file. Aborting!"));
277 const char *vers = docroot->Attribute(
"version");
278 if (!vers || atoi(vers) != 1)
285 info.
Printf(
_T(
" application info:\n" 286 "\t svn_revision:\t%u\n" 289 info.
Printf(
_T(
" application info:\n" 290 "\t svn_revision:\t%u\n" 291 "\t build_date:\t%s, %s\n" 293 __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
296 if (platform::windows)
300 if (platform::macosx)
305 info.
append(platform::unicode ?
_T(
"Unicode ") :
_T(
"ANSI "));
308 c.SetValue((
const char*) info.
mb_str());
310 TiXmlNode *firstchild = docroot->FirstChild();
311 if (firstchild && firstchild->ToComment())
313 docroot->RemoveChild(firstchild);
314 firstchild = docroot->FirstChild();
318 docroot->InsertBeforeChild(firstchild, c);
320 docroot->InsertEndChild(c);
327 doc =
new TiXmlDocument();
332 wxURL url(absFileName);
337 if (is && is->IsOk())
339 size_t size = is->GetSize();
341 #if wxCHECK_VERSION(3, 0, 0) 347 #if !wxCHECK_VERSION(3, 0, 0) 351 doc =
new TiXmlDocument();
374 NamespaceMap::iterator it;
397 F(
_T(
"Could not save config file '%s'!"),
cfg.
wx_str()),
401 switch (dlg.ShowModal())
440 cbThrow(
_T(
"You attempted to get a ConfigManager instance without providing a namespace."));
443 NamespaceMap::iterator it =
namespaces.find(name_space);
447 TiXmlElement* docroot;
454 volatile_doc->InsertEndChild(TiXmlElement(
"CodeBlocksConfig"));
457 docroot =
volatile_doc->FirstChildElement(
"CodeBlocksConfig");
461 docroot =
doc->FirstChildElement(
"CodeBlocksConfig");
464 wxString err(
_(
"Fatal error parsing supplied configuration file.\nParser error message:\n"));
470 TiXmlElement* root = docroot->FirstChildElement(
cbU2C(name_space));
474 docroot->InsertEndChild(TiXmlElement(
cbU2C(name_space)));
475 root = docroot->FirstChildElement(
cbU2C(name_space));
479 cbThrow(
_T(
"Unable to create namespace in document tree (actually not possible..?)"));
493 #if wxCHECK_VERSION(3, 0, 0) 500 size_t len = s.
length()+1;
504 if (q >=
'a' && q <=
'z')
511 #if wxCHECK_VERSION(3, 0, 0) 518 size_t len = s.
length()+1;
522 if (q >=
'A' && q <=
'Z')
543 static bool once = 1;
570 return ConfigManager::data_path_global + wxFILE_SEP_PATH +
_T(
"plugins");
572 return ConfigManager::plugin_path_global;
576 return ConfigManager::data_path_user + wxFILE_SEP_PATH + _T(
"plugins");
579 return ConfigManager::data_path_global + wxFILE_SEP_PATH + _T(
"scripts");
582 return ConfigManager::data_path_user + wxFILE_SEP_PATH + _T(
"scripts");
601 if (has_alternate_user_data_path)
602 return alternate_user_data_path;
604 TCHAR buffer[MAX_PATH];
608 return wxStandardPathsBase::Get().GetUserDataDir();
613 return wxStandardPathsBase::Get().GetUserDataDir();
615 #endif // __WINDOWS__ 624 cbMessageBox(
wxString::Format(
_(
"The --user-data-dir directory %s does not exist and could not be created. Please check the path and try again"),
625 user_data_path.
c_str()),
_(
"Command Line Error"));
628 has_alternate_user_data_path =
true;
629 ConfigManager::alternate_user_data_path = udp;
639 searchPaths.
Add(GetPluginsFolder(
false));
641 searchPaths.
Add(GetScriptsFolder(
false));
643 searchPaths.
Add(GetDataFolder(
false));
647 searchPaths.
Add(GetPluginsFolder(
true));
649 searchPaths.
Add(GetScriptsFolder(
true));
651 searchPaths.
Add(GetDataFolder(
true));
657 searchPaths.
Add(GetConfigFolder());
659 searchPaths.
Add(GetHomeFolder());
661 searchPaths.
Add(GetExecutableFolder());
663 searchPaths.
Add(GetTempFolder());
699 ret =
cbC2U(e->Value());
700 while ((e = e->Parent()->ToElement()) && e !=
root)
718 s.
Printf(
_T(
"The %s %s (child of node \"%s\" in namespace \"%s\") does not meet the standard for path naming (must start with a letter)."),
721 cbC2U(localPath->Value()).c_str(),
756 localPath = localPath->Parent()->ToElement();
763 TiXmlElement* n = localPath->FirstChildElement(
cbU2C(sub));
767 localPath = (TiXmlElement*) localPath->InsertEndChild(TiXmlElement(
cbU2C(sub)));
796 doc->RootElement()->RemoveChild(
root);
799 NamespaceMap::iterator it = bld->
namespaces.find(ns);
812 cbThrow(
_T(
"Illegal attempt to invoke DeleteAll()."));
815 doc->RootElement()->Clear();
836 if ((r = p->FirstChildElement(
cbU2C(q))))
839 return (TiXmlElement*)(p->InsertEndChild(TiXmlElement(
cbU2C(q))));
844 TiXmlNode *c = n->FirstChild();
846 n->ReplaceChild(c, t);
848 n->InsertEndChild(t);
870 if (ignoreEmpty && value.
IsEmpty())
883 TiXmlText t(value.
mb_str(wxConvUTF8));
904 if (
Read(name, &ret))
926 TiXmlHandle parentHandle(e);
927 TiXmlText *t = (TiXmlText *) parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"str").FirstChild().Node();
947 s->SetAttribute(
"null",
"true");
948 s->SetAttribute(
"r", 0);
949 s->SetAttribute(
"g", 0);
950 s->SetAttribute(
"b", 0);
954 s->SetAttribute(
"r", c.
Red());
955 s->SetAttribute(
"g", c.
Green());
956 s->SetAttribute(
"b", c.
Blue());
964 if (
Read(name, &ret))
975 TiXmlHandle parentHandle(e);
976 TiXmlElement *c = (TiXmlElement *) parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"colour").Element();
980 const char *isNull = c->Attribute(
"null");
981 if (isNull && strcmp(isNull,
"true") == 0)
989 if (c->QueryIntAttribute(
"r", &r) == TIXML_SUCCESS
990 && c->QueryIntAttribute(
"g", &g) == TIXML_SUCCESS
991 && c->QueryIntAttribute(
"b", &b) == TIXML_SUCCESS)
1008 leaf->SetAttribute(
"int", value);
1015 if (
Read(name, &ret))
1026 TiXmlHandle parentHandle(e);
1027 TiXmlElement *leaf = parentHandle.FirstChild(
cbU2C(key)).Element();
1030 return leaf->QueryIntAttribute(
"int", value) == TIXML_SUCCESS;
1041 leaf->SetAttribute(
"bool", value ?
"1" :
"0");
1048 if (
Read(name, &ret))
1059 TiXmlHandle parentHandle(e);
1060 TiXmlElement *leaf = parentHandle.FirstChild(
cbU2C(key)).Element();
1062 if (leaf && leaf->Attribute(
"bool"))
1064 *value = leaf->Attribute(
"bool")[0] ==
'1';
1077 leaf->SetDoubleAttribute(
"double", value);
1084 if (
Read(name, &ret))
1095 TiXmlHandle parentHandle(e);
1096 TiXmlElement *leaf = parentHandle.FirstChild(
cbU2C(key)).Element();
1099 return leaf->QueryDoubleAttribute(
"double", value) == TIXML_SUCCESS;
1117 e->RemoveChild(leaf);
1125 TiXmlHandle parentHandle(e);
1126 TiXmlElement *leaf = parentHandle.FirstChild(
cbU2C(key)).Element();
1142 leaf->RemoveChild(as);
1145 for (
unsigned int i = 0; i < arrayString.
GetCount(); ++i)
1147 TiXmlElement s(
"s");
1149 TiXmlText t(arrayString[i].mb_str(wxConvUTF8));
1152 s.InsertEndChild(t);
1153 as->InsertEndChild(s);
1162 TiXmlHandle parentHandle(e);
1163 TiXmlNode *asNode = parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"astr").Node();
1165 TiXmlNode *curr =
nullptr;
1168 while ((curr = asNode->IterateChildren(
"s", curr)))
1169 arrayString->
Add(
cbC2U(curr->FirstChild()->ToText()->Value()));
1203 unsigned int crc = 0;
1205 TiXmlHandle parentHandle(e);
1206 TiXmlElement* bin = parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"bin").Element();
1211 if (bin->QueryIntAttribute(
"crc", (
int*)&crc) != TIXML_SUCCESS)
1214 if (
const TiXmlText* t = bin->FirstChild()->ToText())
1231 TiXmlElement *curr =
nullptr;
1234 while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
1236 #if wxCHECK_VERSION(3, 0, 0) 1241 if (c <
_T(
'A') || c >
_T(
'Z'))
1261 wxString illegal(
_T(
" :.,;!\"\'$%&()[]<>{}?*+-|#"));
1266 if (path.
Last() ==
_T(
'/'))
1287 parent = parent->Parent()->ToElement();
1290 TiXmlElement* n = parent->FirstChildElement(
cbU2C(sub));
1302 if (TiXmlNode *toRemove = parent->FirstChild(
cbU2C(path)))
1305 parent->RemoveChild(toRemove);
1317 TiXmlElement *curr =
nullptr;
1320 while (e->IterateChildren(curr) && (curr = e->IterateChildren(curr)->ToElement()))
1322 #if wxCHECK_VERSION(3, 0, 0) 1327 if (c >=
_T(
'A') && c <=
_T(
'Z'))
1351 TiXmlHandle parentHandle(e);
1352 TiXmlText *t = (TiXmlText *) parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"obj").FirstChild().Node();
1369 TiXmlElement *mNode;
1371 leaf->RemoveChild(mNode);
1374 for (ConfigManagerContainer::StringToStringMap::const_iterator it = map.begin(); it != map.end(); ++it)
1376 TiXmlElement s(
cbU2C(it->first));
1378 TiXmlText t(
cbU2C(it->second));
1381 s.InsertEndChild(t);
1382 mNode->InsertEndChild(s);
1391 TiXmlHandle parentHandle(e);
1392 TiXmlNode *mNode = parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"ssmap").Node();
1394 TiXmlNode *curr =
nullptr;
1397 while ((curr = mNode->IterateChildren(curr)))
1398 (*map)[
cbC2U(curr->Value())] =
cbC2U(curr->FirstChild()->ToText()->Value());
1416 TiXmlElement *mNode;
1418 leaf->RemoveChild(mNode);
1422 for (ConfigManagerContainer::IntToStringMap::const_iterator it = map.begin(); it != map.end(); ++it)
1424 tmp.
Printf(
_T(
"x%d"), (
int) it->first);
1425 TiXmlElement s(tmp.
mb_str());
1427 TiXmlText t(
cbU2C(it->second));
1430 s.InsertEndChild(t);
1431 mNode->InsertEndChild(s);
1440 TiXmlHandle parentHandle(e);
1441 TiXmlNode *mNode = parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"ismap").Node();
1443 TiXmlNode *curr =
nullptr;
1447 while ((curr = mNode->IterateChildren(curr)))
1450 (*map)[tmp] =
cbC2U(curr->FirstChild()->ToText()->Value());
1474 TiXmlElement *mNode;
1476 leaf->RemoveChild(mNode);
1479 for (ConfigManagerContainer::StringSet::const_iterator it =
set.begin(); it !=
set.end(); ++it)
1481 TiXmlElement s(
"s");
1483 TiXmlText t(
cbU2C(*it));
1486 s.InsertEndChild(t);
1487 mNode->InsertEndChild(s);
1497 TiXmlHandle parentHandle(e);
1498 TiXmlNode *mNode = parentHandle.FirstChild(
cbU2C(key)).FirstChild(
"sset").Node();
1500 TiXmlNode *curr =
nullptr;
1503 while ((curr = mNode->IterateChildren(curr)))
1504 set->insert(
cbC2U(curr->FirstChild()->ToText()->Value()));
1523 TiXmlElement *mNode;
1525 leaf->RemoveChild(mNode);
1528 for (ConfigManagerContainer::SerializableObjectMap::const_iterator it = map->begin(); it != map->end(); ++it)
1530 TiXmlElement s(
cbU2C(it->first));
1532 mNode->InsertEndChild(s);
1540 ConfigManager::home_folder = wxStandardPathsBase::Get().GetUserConfigDir();
1541 ConfigManager::app_path = ::DetermineExecutablePath();
1542 wxString res_path = ::DetermineResourcesPath();
1547 if (platform::windows)
1548 ConfigManager::data_path_global =
app_path +
_T(
"\\share\\codeblocks");
1549 else if (platform::macosx)
1550 ConfigManager::data_path_global = res_path + _T(
"/share/codeblocks");
1552 ConfigManager::data_path_global = wxStandardPathsBase::Get().GetDataDir();
1558 if (plugin_path_global.IsEmpty())
1560 if (platform::windows)
1562 else if (platform::macosx)
1582 wxString dataPathUser = ConfigManager::config_folder + wxFILE_SEP_PATH +
_T(
"share");
1588 ConfigManager::data_path_user = dataPathUser + wxFILE_SEP_PATH + _T(
"codeblocks");
1597 CreateDir(ConfigManager::data_path_user + _T(
"/scripts/"));
1599 ConfigManager::temp_folder = wxStandardPathsBase::Get().GetTempDir();
1617 wxString oldDataFolder = oldConfigFolder + wxFILE_SEP_PATH +
_T(
"share") + wxFILE_SEP_PATH +
_T(
"codeblocks");
1620 msg =
F(
_(
"The places where the configuration files and user-data files are stored\n" 1621 "have been changed to be more standard-conform.\n" 1623 "Now moving \"%s\"\n" 1629 oldConfigFolder.
wx_str(),
1630 newConfigFolder.
wx_str());
1633 bool success =
true;
1639 wxRmdir(oldConfigFolder + wxFILE_SEP_PATH + _T(
"share"));
1645 success =
wxRenameFile(oldConfigFolder, newConfigFolder);
1649 msg =
F(
_(
"Error moving \"%s\"\n" 1653 "Please check the folders manually (access rights?) !\n" 1654 "A new configuration will be created from scratch!"),
1657 oldConfigFolder.
wx_str(),
1658 newConfigFolder.
wx_str());
1666 if (m_namespace.empty())
1669 c->
Write(m_basepath + name, value, ignoreEmpty);
1674 if (m_namespace.empty())
1677 return c->
Read(m_basepath + key, defaultVal);
1682 if (m_namespace.empty())
1685 return c->
Read(key, str);
1689 if (m_namespace.empty())
1697 if (m_namespace.empty())
1700 c->
Write(m_basepath + name, value);
1704 if (m_namespace.empty())
1707 return c->
Read(m_basepath + name, value);
1712 if (m_namespace.empty())
1715 return c->
ReadInt(m_basepath + name, defaultVal);
1720 if (m_namespace.empty())
1723 c->
Write(m_basepath + name, value);
1727 if (m_namespace.empty())
1730 return c->
Read(m_basepath + name, value);
1734 if (m_namespace.empty())
1737 return c->
ReadBool(m_basepath + name, defaultVal);
1742 if (m_namespace.empty())
1745 c->
Write(m_basepath + name, value);
1749 if (m_namespace.empty())
1752 return c->
Read(m_basepath + name, value);
1756 if (m_namespace.empty())
1759 return c->
ReadDouble(m_basepath + name, defaultVal);
1764 if (platform::windows)
1765 return wxT(
"compiler.dll");
1766 else if (platform::darwin || platform::macosx)
1767 return wxT(
"libcompiler.dylib");
1769 return wxT(
"libcompiler.so");
1789 bbplugins.
Add(compiler);
1790 cbMessageBox(
_(
"The compiler plugin must always be loaded for batch builds!\n" 1791 "Automatically re-enabled."),
1795 bbcfg->
Write(
_T(
"/batch_build_plugins"), bbplugins);
wxString F(const wxChar *msg,...)
sprintf-like function
bool wxRmdir(const wxString &dir, int flags=0)
const wxString data_path(_T("data_path"))
bool wxRenameFile(const wxString &file1, const wxString &file2, bool overwrite=true)
static wxString GetFolder(SearchDirs dir)
Access one of Code::Blocks' folders.
Data folder in user's dir.
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
wxString ReadBinary(const wxString &name)
TiXmlDocument * volatile_doc
ConfigManager * Build(const wxString &name_space)
ConfigManager * GetConfigManager(const wxString &name_space) const
int ReadInt(const wxString &name, int defaultVal=0)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
void to_lower(wxString &s)
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
static wxString GetUserDataFolder()
ConfigManagerContainer::StringToStringMap ReadSSMap(const wxString &name)
bool wxFileExists(const wxString &filename)
virtual unsigned char Red() const
static wxStandardPaths & Get()
Scripts folder in base dir.
static unsigned int GetRevisionNumber()
ConfigManager(TiXmlElement *r)
bool ReadBool(const wxString &name, bool defaultVal=false)
int Index(const wxString &sz, bool bCase=true, bool bFromEnd=false) const
ConfigManagerContainer::IntToStringMap ReadISMap(const wxString &name)
wxColour ReadColour(const wxString &name, const wxColour &defaultVal= *wxBLACK)
Scripts folder in user's dir.
const wxString app_path(_T("app_path"))
void SetPath(const wxString &strPath)
bool ReadBool(const wxString &name, bool defaultVal=false)
bool wxDirExists(const wxString &dirname)
TiXmlElement * AssertPath(wxString &path)
static CfgMgrBldr * Get()
wxString & append(const wxString &str, size_t pos, size_t n)
Convenience value meaning "all sd*Global values".
static wxString temp_folder
TiXmlElement * GetUniqElement(TiXmlElement *p, const wxString &q)
bool LoadDocument(const wxString &filename, TiXmlDocument *doc)
const wxCharBuffer mb_str(const wxMBConv &conv=wxConvLibc) const
static ConfigManager * GetConfigManager(const wxString &name_space)
#define wxICON_INFORMATION
All dirs in the PATH environment variable.
wxString DetermineExecutablePath()
wxString AfterFirst(wxUniChar ch) const
wxURLError GetError() const
int ReadInt(const wxString &name, int defaultVal=0)
wxArrayString ReadArrayString(const wxString &name)
size_t find(const wxString &str, size_t nStart=0) const
void Set(unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=wxALPHA_OPAQUE)
static wxString LocateDataFile(const wxString &filename, int search_dirs=sdAllKnown)
Locate a file in an installation- and platform-independent way.
DLLIMPORT const wxWX2MBbuf cbU2C(const wxString &str)
Return multibyte (C string) representation of the string.
void Set(const wxString &name)
static bool has_alternate_user_data_path
wxUSE_UNICODE_dependent wxChar
void UnSet(const wxString &name)
static wxString alternate_user_data_path
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
bool Contains(const wxString &str) const
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
DLLIMPORT wxString UnixFilename(const wxString &filename, wxPathFormat format=wxPATH_NATIVE)
User's home directory.
size_t find_first_of(const char *sz, size_t nStart=0) const
wxString & RemoveLast(size_t n=1)
static wxString config_folder
void Collapse(wxString &str) const
static wxString GetConfigFolder()
wxArrayString EnumerateSubPaths(const wxString &path)
DLLIMPORT wxString cbC2U(const char *str)
Return str as a proper unicode-compatible string.
DLLIMPORT wxUint32 FromString(const wxString &text)
static wxString FromUTF8(const char *s)
bool Exists(const wxString &name)
DLLIMPORT wxString Encode(const wxUint8 *pData, size_t len)
DLLIMPORT bool CreateDir(const wxString &full_path, int perms=0755)
Convenience value meaning "all sd*User values".
virtual unsigned char Green() const
wxInputStream * GetInputStream()
wxUSE_UNICODE_WCHAR_dependent wxStringCharType
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
LogManager * GetLogManager() const
static wxFileName DirName(const wxString &dir, wxPathFormat format=wxPATH_NATIVE)
wxString & Truncate(size_t len)
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
const wxStringCharType * wx_str() const
virtual unsigned char Blue() const
static wxFontEncoding GetSystemEncoding()
bool Add(const wxString &path)
void cbWriteBatchBuildPlugins(wxArrayString bbplugins, wxWindow *messageBoxParent)
Write the list of batch build plugins in the config.
wxString FindConfigFile(const wxString &filename)
wxString & assign(const wxString &str, size_t pos, size_t n)
void SetProxy(const wxString &url_proxy)
double ReadDouble(const wxString &name, double defaultVal=0.0f)
std::set< wxString > StringSet
All known dirs (i.e. all of the above)
const wxString & _(const wxString &string)
Plugins folder in user's dir.
Plugins folder in base dir.
virtual bool SetYesNoLabels(const ButtonLabel &yes, const ButtonLabel &no)
void SwitchTo(const wxString &absFN)
bool ToLong(long *val, int base=10) const
Code::Blocks' installation base.
static wxString data_path_global
static wxString GetProxy()
DLLIMPORT wxString Decode(const wxString &data)
wxString FindValidPath(const wxString &file) const
void DeleteSubPath(const wxString &strPath)
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
wxString GetPath(int flags=wxPATH_GET_VOLUME, wxPathFormat format=wxPATH_NATIVE) const
static bool SetUserDataFolder(const wxString &user_data_path)
const wxString dotDot(_T(".."))
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
static void MigrateFolders()
static void handleConfigError(TiXmlDocument &doc, const wxString &fileName, const wxString &additionalMessage)
Print error message an allow the user to either discard the old config or close the application...
static wxString data_path_user
wxString & Prepend(const wxString &str)
static wxString getCompilerPluginFilename()
size_t Add(const wxString &str, size_t copies=1)
SearchDirs
Search dirs values.
const wxString ptr(_T("*"))
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
bool SaveDocument(const wxString &, TiXmlDocument *)
wxUniChar GetChar(size_t n) const
virtual wxString GetUserDataDir() const
ConfigManagerContainer::StringSet ReadSSet(const wxString &name)
DLLIMPORT bool CreateDirRecursively(const wxString &full_path, int perms=0755)
void to_upper(wxString &s)
static wxString home_folder
void SwitchToR(const wxString &absFN)
friend class ConfigManager
int Printf(const wxString &pszFormat,...)
void AddEnvList(const wxString &env_variable)
wxArrayString cbReadBatchBuildPlugins()
Read the list of batch build plugins and return them.
wxString GetFullPath(wxPathFormat format=wxPATH_NATIVE) const
wxArrayString EnumerateKeys(const wxString &path)
std::map< wxString, ISerializable * > SerializableObjectMap
static wxString Format(const wxString &format,...)
wxString Mid(size_t first, size_t nCount=wxString::npos) const
Dialog that contains a "Don't annoy me" checkbox.
double ReadDouble(const wxString &name, double defaultVal=0.0f)
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
wxString InvalidNameMessage(const wxString &what, const wxString &sub, TiXmlElement *localPath) const
void SetNodeText(TiXmlElement *n, const TiXmlText &t)
void WriteBinary(const wxString &name, const wxString &source)
wxStringCharType * GetWriteBuf(size_t len)
DLLIMPORT wxString realpath(const wxString &path)
std::map< int, wxString > IntToStringMap
std::map< wxString, wxString > StringToStringMap