Code::Blocks  SVN r11506
personalitymanager.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  *
5  * $Revision: 10104 $
6  * $Id: personalitymanager.cpp 10104 2015-02-08 00:49:58Z jenslody $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/personalitymanager.cpp $
8  */
9 
10 #include "sdk_precomp.h"
11 
12 #ifndef CB_PRECOMP
13  #include "personalitymanager.h"
14  #include "manager.h"
15  #include "configmanager.h"
16  #include <wx/intl.h>
17  #include <wx/dir.h>
18  #include <wx/filename.h>
19 #endif
20 
21 #include <wx/arrstr.h>
22 
23 template<> PersonalityManager* Mgr<PersonalityManager>::instance = nullptr;
24 template<> bool Mgr<PersonalityManager>::isShutdown = false;
25 
27 {
28  PersonalityManager::pers = _T("default");
29 }
30 
31 void PersonalityManager::SetPersonality(const wxString& personality, cb_unused bool createIfNotExist)
32 {
33  pers = personality;
34 }
35 
37 {
38  return pers;
39 }
40 
42 {
43  wxArrayString list;
45 
46  for(size_t i = 0; i < list.GetCount(); ++i)
47  list[i] = wxFileName(list[i]).GetName();
48 
49  return list;
50 }
51 
53 
void SetPersonality(const wxString &personality, bool createIfNotExist=false)
Use this once, on program startup to set the working personality.
const wxString GetPersonality()
Get the working personality string.
Manage different personalities.
#define _T(string)
wxString GetName() const
static size_t GetAllFiles(const wxString &dirname, wxArrayString *files, const wxString &filespec=wxEmptyString, int flags=wxDIR_DEFAULT)
const wxArrayString GetPersonalitiesList()
Get a list of all the known personalities.
static wxString GetConfigFolder()
Definition: manager.h:183
static wxString pers
size_t GetCount() const