Code::Blocks
SVN r11506
|
#include <filegroupsandmasks.h>
Public Member Functions | |
FilesGroupsAndMasks () | |
FilesGroupsAndMasks (const FilesGroupsAndMasks &rhs) | |
~FilesGroupsAndMasks () | |
void | CopyFrom (const FilesGroupsAndMasks &rhs) |
copy ctor helper More... | |
void | SetDefault (bool do_clear=true) |
Set the default file groups and masks. More... | |
void | Save () |
Save groups/masks to config. More... | |
void | Clear () |
Clear any groups/masks. More... | |
unsigned int | AddGroup (const wxString &name) |
Add a file group. More... | |
void | RenameGroup (unsigned int group, const wxString &newName) |
Rename a group. More... | |
void | DeleteGroup (unsigned int group) |
Delete a group. More... | |
void | SetFileMasks (unsigned int group, const wxString &masks) |
Set file mask for a group (e.g. More... | |
unsigned int | GetGroupsCount () const |
Return total number of groups. More... | |
wxString | GetGroupName (unsigned int group) const |
Return a specific group name. More... | |
wxString | GetFileMasks (unsigned int group) const |
Return a specific group file mask. More... | |
bool | MatchesMask (const wxString &ext, unsigned int group) const |
Return whether a file extension matches a file mask (group) More... | |
Private Member Functions | |
void | Load () |
Load groups/masks from config. More... | |
Private Attributes | |
FileGroupsArray | m_Groups |
Internal storage for file groups ans masks. More... | |
Definition at line 22 of file filegroupsandmasks.h.
FilesGroupsAndMasks::FilesGroupsAndMasks | ( | ) |
Definition at line 23 of file filegroupsandmasks.cpp.
References Load(), m_Groups, and SetDefault().
FilesGroupsAndMasks::FilesGroupsAndMasks | ( | const FilesGroupsAndMasks & | rhs | ) |
Definition at line 32 of file filegroupsandmasks.cpp.
References CopyFrom().
FilesGroupsAndMasks::~FilesGroupsAndMasks | ( | ) |
Definition at line 38 of file filegroupsandmasks.cpp.
unsigned int FilesGroupsAndMasks::AddGroup | ( | const wxString & | name | ) |
Add a file group.
name | File group name |
Definition at line 135 of file filegroupsandmasks.cpp.
References FileGroups::groupName, and m_Groups.
Referenced by Load(), ProjectsFileMasksDlg::OnAdd(), and SetDefault().
void FilesGroupsAndMasks::Clear | ( | ) |
Clear any groups/masks.
Definition at line 124 of file filegroupsandmasks.cpp.
References m_Groups.
Referenced by CopyFrom(), Load(), SetDefault(), and ~FilesGroupsAndMasks().
void FilesGroupsAndMasks::CopyFrom | ( | const FilesGroupsAndMasks & | rhs | ) |
copy ctor helper
Definition at line 45 of file filegroupsandmasks.cpp.
References Clear(), FileGroups::fileMasks, FileGroups::groupName, and m_Groups.
Referenced by ProjectsFileMasksDlg::EndModal(), and FilesGroupsAndMasks().
void FilesGroupsAndMasks::DeleteGroup | ( | unsigned int | group | ) |
Delete a group.
group | Group index to delete |
Definition at line 152 of file filegroupsandmasks.cpp.
References m_Groups.
Referenced by ProjectsFileMasksDlg::OnDelete().
wxString FilesGroupsAndMasks::GetFileMasks | ( | unsigned int | group | ) | const |
Return a specific group file mask.
group | Group index to query |
Definition at line 185 of file filegroupsandmasks.cpp.
References FileGroups::fileMasks, GetStringFromArray(), m_Groups, MakeUniqueArray(), and wxEmptyString.
Referenced by ProjectLoader::DoEnvironment(), ProjectsFileMasksDlg::EndModal(), ProjectsFileMasksDlg::ListChange(), and ProjectManagerUI::OnAddFilesToProjectRecursively().
wxString FilesGroupsAndMasks::GetGroupName | ( | unsigned int | group | ) | const |
Return a specific group name.
group | Group index to query |
Definition at line 177 of file filegroupsandmasks.cpp.
References FileGroups::groupName, m_Groups, and wxEmptyString.
Referenced by ProjectManagerUI::BuildProjectTree(), and ProjectsFileMasksDlg::RebuildList().
unsigned int FilesGroupsAndMasks::GetGroupsCount | ( | ) | const |
Return total number of groups.
Definition at line 172 of file filegroupsandmasks.cpp.
References m_Groups.
Referenced by ProjectManagerUI::BuildProjectTree(), ProjectLoader::DoEnvironment(), ProjectManagerUI::OnAddFilesToProjectRecursively(), and ProjectsFileMasksDlg::RebuildList().
|
private |
Load groups/masks from config.
Definition at line 92 of file filegroupsandmasks.cpp.
References _T, AddGroup(), Clear(), ConfigManager::EnumerateSubPaths(), Manager::Get(), Manager::GetConfigManager(), wxArrayString::GetCount(), ConfigManager::Read(), and SetFileMasks().
Referenced by FilesGroupsAndMasks().
bool FilesGroupsAndMasks::MatchesMask | ( | const wxString & | ext, |
unsigned int | group | ||
) | const |
Return whether a file extension matches a file mask (group)
ext | The extension to query |
group | Group index to match |
Definition at line 195 of file filegroupsandmasks.cpp.
References FileGroups::fileMasks, wxArrayString::GetCount(), wxString::IsEmpty(), wxString::Lower(), m_Groups, and wxString::Matches().
Referenced by ProjectManagerUI::BuildProjectTree().
void FilesGroupsAndMasks::RenameGroup | ( | unsigned int | group, |
const wxString & | newName | ||
) |
Rename a group.
group | Group index to rename |
newName | New name for the group |
Definition at line 143 of file filegroupsandmasks.cpp.
References FileGroups::groupName, and m_Groups.
Referenced by ProjectsFileMasksDlg::OnEdit().
void FilesGroupsAndMasks::Save | ( | ) |
Save groups/masks to config.
Definition at line 106 of file filegroupsandmasks.cpp.
References _T, wxString::Clear(), ConfigManager::DeleteSubPath(), FileGroups::fileMasks, wxString::Format(), Manager::Get(), Manager::GetConfigManager(), GetStringFromArray(), FileGroups::groupName, m_Groups, MakeUniqueArray(), and ConfigManager::Write().
Referenced by ProjectManagerUI::OnViewFileMasks(), and ~FilesGroupsAndMasks().
void FilesGroupsAndMasks::SetDefault | ( | bool | do_clear = true | ) |
Set the default file groups and masks.
do_clear | Clear any old groups/masks before |
Definition at line 59 of file filegroupsandmasks.cpp.
References _(), _T, AddGroup(), Clear(), and SetFileMasks().
Referenced by FilesGroupsAndMasks(), and ProjectsFileMasksDlg::OnSetDefault().
void FilesGroupsAndMasks::SetFileMasks | ( | unsigned int | group, |
const wxString & | masks | ||
) |
Set file mask for a group (e.g.
*.c;*.cpp)
group | Group index to set |
masks | File mask to set |
Definition at line 162 of file filegroupsandmasks.cpp.
References _T, FileGroups::fileMasks, GetArrayFromString(), m_Groups, and MakeUniqueArray().
Referenced by ProjectsFileMasksDlg::EndModal(), ProjectsFileMasksDlg::ListChange(), Load(), and SetDefault().
|
private |
Internal storage for file groups ans masks.
Definition at line 76 of file filegroupsandmasks.h.
Referenced by AddGroup(), Clear(), CopyFrom(), DeleteGroup(), FilesGroupsAndMasks(), GetFileMasks(), GetGroupName(), GetGroupsCount(), MatchesMask(), RenameGroup(), Save(), and SetFileMasks().