[go: up one dir, main page]

Menu

[14870f]: / filecounter.h  Maximize  Restore  History

Download this file

47 lines (40 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/////////////////////////////////////////////////////////////////////////////////
// Author: Steven Lamerton
// Copyright: Copyright (C) 2009 Steven Lamerton
// License: GNU GPL 2 (See readme for more info)
/////////////////////////////////////////////////////////////////////////////////
#ifndef H_FILECOUNTER
#define H_FILECOUNTER
#include <wx/arrstr.h>
/*!
* A general class for counting files. Paths are Normalised when they are added.
* Both files and folders can be added and will be counted correctly.
*/
class FileCounter{
public:
/*!
* Constructs a FileCounter instance.
*/
FileCounter();
/*!
* Adds a single path to the list of paths to be counted.
*/
void AddPath(const wxString &path);
/*!
* Adds a set of paths to the list of paths to be counted.
*/
void AddPaths(const wxArrayString &paths);
/*!
* Returns the count as last calculated by Count().
*/
long GetCount();
/*!
* Counts the numer of files in the folders specified in the list
*/
bool Count();
private:
bool CountFolder(wxString path);
wxArrayString m_Paths;
long m_Count;
};
#endif