-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbasicfunctions.h
65 lines (53 loc) · 2.01 KB
/
basicfunctions.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/////////////////////////////////////////////////////////////////////////////////
// Author: Steven Lamerton
// Copyright: Copyright (C) 2007-2010 Steven Lamerton
// License: GNU GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
/////////////////////////////////////////////////////////////////////////////////
#ifndef H_BASICFUNCTIONS
#define H_BASICFUNCTIONS
class wxComboBox;
class wxString;
class wxArrayString;
void SetupLanguageMap();
//Turns an array string into a string with the strings seperated by seperator, used when writing to ini files
wxString ArrayStringToString(const wxArrayString &strings, const wxString &seperator);
//Used for turning a string into an arraystring when the string are seperated by seperator, used when read from ini files
wxArrayString StringToArrayString(const wxString &string, const wxString &seperator);
//Priority codes for progress output, higher codes have higher priority and so
//go to the bottom of the list
enum OutputType{
FinishingLine, //(includes time)
FinishingInfo,
Message, //(increments the progress bar)
StartingInfo,
StartingLine, //(includes time)
Error //(includes time and red colour and increments the progress bar)
};
namespace Jobs{
enum Type{
Sync,
Backup,
Secure,
All
};
};
void OutputProgress(const wxString &message, OutputType type = Message);
//Get a list of jobs of a specific type, or if an emptystring is passed then get
//all job names that are in use
wxArrayString GetJobs(Jobs::Type type);
wxArrayString GetVariables(bool builtin);
wxArrayString GetRules();
wxArrayString GetScripts();
//On each run of Toucan to ensure the jobs are up to date
bool UpdateJobs();
bool UpdateRules();
bool UpdateScripts();
bool UpdateSettings();
wxString ToLang(const wxString &en);
wxString ToEn(const wxString &lang);
//Used by for_each in test.h
void makedir(const wxString &path);
void createfiles(const wxString &path);
void deletedir(const wxString &path);
void deletefiles(const wxString &path);
#endif