Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FilesGroupsAndMasks Class Reference

#include <filegroupsandmasks.h>

Collaboration diagram for FilesGroupsAndMasks:

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...
 

Detailed Description

Definition at line 22 of file filegroupsandmasks.h.

Constructor & Destructor Documentation

◆ FilesGroupsAndMasks() [1/2]

FilesGroupsAndMasks::FilesGroupsAndMasks ( )

Definition at line 23 of file filegroupsandmasks.cpp.

References Load(), m_Groups, and SetDefault().

◆ FilesGroupsAndMasks() [2/2]

FilesGroupsAndMasks::FilesGroupsAndMasks ( const FilesGroupsAndMasks rhs)

Definition at line 32 of file filegroupsandmasks.cpp.

References CopyFrom().

◆ ~FilesGroupsAndMasks()

FilesGroupsAndMasks::~FilesGroupsAndMasks ( )

Definition at line 38 of file filegroupsandmasks.cpp.

References Clear(), and Save().

Member Function Documentation

◆ AddGroup()

unsigned int FilesGroupsAndMasks::AddGroup ( const wxString name)

Add a file group.

Parameters
nameFile group name
Returns
The group index

Definition at line 135 of file filegroupsandmasks.cpp.

References FileGroups::groupName, and m_Groups.

Referenced by Load(), ProjectsFileMasksDlg::OnAdd(), and SetDefault().

◆ Clear()

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().

◆ CopyFrom()

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().

◆ DeleteGroup()

void FilesGroupsAndMasks::DeleteGroup ( unsigned int  group)

Delete a group.

Parameters
groupGroup index to delete

Definition at line 152 of file filegroupsandmasks.cpp.

References m_Groups.

Referenced by ProjectsFileMasksDlg::OnDelete().

◆ GetFileMasks()

wxString FilesGroupsAndMasks::GetFileMasks ( unsigned int  group) const

Return a specific group file mask.

Parameters
groupGroup index to query
Returns
The group's file masks

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().

◆ GetGroupName()

wxString FilesGroupsAndMasks::GetGroupName ( unsigned int  group) const

Return a specific group name.

Parameters
groupGroup index to query
Returns
The group's name

Definition at line 177 of file filegroupsandmasks.cpp.

References FileGroups::groupName, m_Groups, and wxEmptyString.

Referenced by ProjectManagerUI::BuildProjectTree(), and ProjectsFileMasksDlg::RebuildList().

◆ GetGroupsCount()

unsigned int FilesGroupsAndMasks::GetGroupsCount ( ) const

Return total number of groups.

Returns
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().

◆ Load()

void FilesGroupsAndMasks::Load ( )
private

◆ MatchesMask()

bool FilesGroupsAndMasks::MatchesMask ( const wxString ext,
unsigned int  group 
) const

Return whether a file extension matches a file mask (group)

Parameters
extThe extension to query
groupGroup index to match
Returns
Extension matches the group in question?

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().

◆ RenameGroup()

void FilesGroupsAndMasks::RenameGroup ( unsigned int  group,
const wxString newName 
)

Rename a group.

Parameters
groupGroup index to rename
newNameNew name for the group

Definition at line 143 of file filegroupsandmasks.cpp.

References FileGroups::groupName, and m_Groups.

Referenced by ProjectsFileMasksDlg::OnEdit().

◆ Save()

void FilesGroupsAndMasks::Save ( )

◆ SetDefault()

void FilesGroupsAndMasks::SetDefault ( bool  do_clear = true)

Set the default file groups and masks.

Parameters
do_clearClear 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().

◆ SetFileMasks()

void FilesGroupsAndMasks::SetFileMasks ( unsigned int  group,
const wxString masks 
)

Set file mask for a group (e.g.

*.c;*.cpp)

Parameters
groupGroup index to set
masksFile 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().

Member Data Documentation

◆ m_Groups

FileGroupsArray FilesGroupsAndMasks::m_Groups
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().


The documentation for this class was generated from the following files: