All Classes Files Functions Variables Enumerations Enumerator Macros
writeConf.cpp
Go to the documentation of this file.
1 #include "options.hpp"
7 
11 // Recreate the config file
12 void ConfigOpts::writeConfigFile( string dirOut )
13 {
14  // Create a output file stream object
15  ofstream fout;
16  // Create a char array that can used by the output file stream object
17  const char *dirLoc;
18  // Create a string for the file name and location
19  string fileOut, tmpOut;
20 
21  // Add a slash to filename
22  fileOut = SLASH"clerk.conf";
23  // Concatenate the directory location and file name
24  tmpOut = dirOut + fileOut;
25  // Convert to char array
26  dirLoc = tmpOut.c_str();
27 
28  cout << "Writing " + tmpOut + "... ";
29 
30  // Open file for writting
31  fout.open( dirLoc );
32  fout << "#" << endl
33  << "# " << tmpOut << endl
34  << "#" << endl
35  << "# Configuration file for the clerk" << endl
36  << "#" << endl
37  << "#########################################################" << endl
38  << endl
39  << "# Location of blacklist" << endl
40  << "BLACKLIST="LOC1"blacklist" << endl
41  << endl
42  << "# Location of showlist" << endl
43  << "SHOWLIST="LOC1"showlist" << endl
44  << endl
45  << "#########################################################" << endl
46  << endl
47  << "# Recurse directories" << endl
48  << "RECURSE=NO" << endl
49  << endl
50  << "# Input directory/file" << endl
51  << "INPUT="SLASH"mnt"SLASH"vids" << endl
52  << endl
53  << "# Output directory" << endl
54  << "OUTPUT="SLASH"mnt"SLASH"vids" << endl
55  << endl
56  << "# Script file location and name" << endl
57  << "SCRIPT="LOC1"clerk."SCRIPT2 << endl
58  << endl
59  << "# Log file location and name" << endl
60  << "LOG="LOC1"clerk.log" << endl
61  << endl
62  << "# Xml file location and name" << endl
63  << "XML="LOC1"clerk.xml" << endl
64  << endl
65  << "# Gap file location and name" << endl
66  << "GAP="LOC1"clerk.gap" << endl
67  << endl
68  << "#########################################################" << endl
69  << endl
70  << "# Default task (rename|move|copy)" << endl
71  << "MODE=move" << endl
72  << endl
73  << "# Default mode (execute|test|script)" << endl
74  << "EXEC=script" << endl
75  << endl
76  << "# Default output mode (quiet|summary|verbose)" << endl
77  << "LEVEL=verbose" << endl
78  << endl
79  << "#########################################################" << endl
80  << endl
81  << "# max file size, in bytes" << endl
82  << "# 629145600 = 600MB" << endl
83  << "SIZE=2516582400" << endl
84  << endl
85  << "# Filter out the following files" << endl
86  << "FILTER=txt;jpg;png;gif;nfo;rar;zip;cbz;url;srt;idx;sub;sfv;mht;htm;html;css;torrent;vob;exe;event;db;ini;r;" << endl
87  << endl
88  << "# Filter delimiter" << endl
89  << "FILTERDELIM=;" << endl
90  << endl
91  << "# Showlist delimiters" << endl
92  << "SHOWDELIM=/;*" << endl
93  << endl
94  << "# Space filler" << endl
95  << "FILLER=._" << endl
96  << endl
97  << "# Title separator" << endl
98  << "# Name SxxExx Title.avi || Name SxxExx - Title.avi" << endl
99  << "SEPARATE= - " << endl
100  << endl
101  << "# Season Folder is a double digit" << endl
102  << "# [01, 02, 03] vs [1, 2, 3]" << endl
103  << "SEASONDD=NO" << endl
104  << endl
105  << "# Words that should not be uppercased" << endl
106  << "NOCASE= A * Amid * An * And * As * At * Atop * But * By * Down * For * From * In * Into * Is * Like * No * Nor * Near * Next * Of * Off * On * Onto * Or * Out * Over * Pace * Past * Per * Plus * Pro * Qua * Save * So * Than * The * Then * Till * To * Up * Upon * Vs * Via * Vice * With * Yet *" << endl
107  << endl
108  << "# Nocase delimiter" << endl
109  << "NOCASEDELIM=*" << endl;
110  // Close file
111  fout.close();
112 
113  cout << "complete" << endl;
114 };
static void writeConfigFile(string)
Generates a default configuration file in the given directory.
Definition: writeConf.cpp:12
#define SCRIPT2
Definition: options.hpp:31
#define SLASH
Definition: options.hpp:32
#define LOC1
Definition: options.hpp:33
The ConfigOpts class stores all config options, settings, and flags for clerk.