Orbiter 2022
Combinatorial Objects
create_file_description.cpp
Go to the documentation of this file.
1/*
2 * create_file_description.cpp
3 *
4 * Created on: Jul 2, 2020
5 * Author: betten
6 */
7
8
9
10
11#include "foundations.h"
12
13using namespace std;
14
15
16
17
18namespace orbiter {
19namespace layer1_foundations {
20namespace orbiter_kernel_system {
21
22
24{
26 //file_mask ;
27 f_N = FALSE;
28 N = 0;
29 nb_lines = 0;
30 //const char *lines[MAX_LINES];
32 //const char *final_lines[MAX_LINES];
34 //command;
36 repeat_N = 0;
37 repeat_start = 0;
39 //repeat_mask;
40 f_split = FALSE;
41 split_m = 0;
43 //read_cases_fname = NULL;
47 f_tasks = FALSE;
48 nb_tasks = 0;
49 //tasks_line;
50
51}
52
54{
55
56}
57
58
60 int argc, std::string *argv,
61 int verbose_level)
62{
63 int i;
65
66 cout << "create_file_description::read_arguments" << endl;
67 for (i = 0; i < argc; i++) {
68 if (ST.stringcmp(argv[i], "-file_mask") == 0) {
70 file_mask.assign(argv[++i]);
71 cout << "-file_mask " << file_mask << endl;
72 }
73 else if (ST.stringcmp(argv[i], "-N") == 0) {
74 f_N = TRUE;
75 N = ST.strtoi(argv[++i]);
76 cout << "-N " << N << endl;
77 }
78 else if (ST.stringcmp(argv[i], "-read_cases") == 0) {
80 read_cases_fname.assign(argv[++i]);
81 cout << "-read_cases " << read_cases_fname << endl;
82 }
83 else if (ST.stringcmp(argv[i], "-read_cases_text") == 0) {
85 read_cases_fname.assign(argv[++i]);
86 read_cases_column_of_case = ST.strtoi(argv[++i]);
87 read_cases_column_of_fname = ST.strtoi(argv[++i]);
88 cout << "-read_cases_text " << read_cases_fname << " "
91 }
92 else if (ST.stringcmp(argv[i], "-line") == 0) {
93 lines[nb_lines].assign(argv[++i]);
95 cout << "-line " << lines[nb_lines] << endl;
96 nb_lines++;
97 }
98 else if (ST.stringcmp(argv[i], "-line_numeric") == 0) {
99 lines[nb_lines].assign(argv[++i]);
101 cout << "-line_numeric " << lines[nb_lines] << endl;
102 nb_lines++;
103 }
104 else if (ST.stringcmp(argv[i], "-final_line") == 0) {
105 final_lines[nb_final_lines].assign(argv[++i]);
106 cout << "-final_line " << final_lines[nb_final_lines] << endl;
108 }
109 else if (ST.stringcmp(argv[i], "-command") == 0) {
110 f_command = TRUE;
111 command.assign(argv[++i]);
112 cout << "-command " << command << endl;
113 }
114 else if (ST.stringcmp(argv[i], "-repeat") == 0) {
115 f_repeat = TRUE;
116 repeat_N = ST.strtoi(argv[++i]);
117 repeat_start = ST.strtoi(argv[++i]);
118 repeat_increment = ST.strtoi(argv[++i]);
119 repeat_mask.assign(argv[++i]);
120 cout << "-repeat " << repeat_N
121 << " " << repeat_start
122 << " " << repeat_increment
123 << " " << repeat_mask
124 << endl;
125 }
126 else if (ST.stringcmp(argv[i], "-split") == 0) {
127 f_split = TRUE;
128 split_m = ST.strtoi(argv[++i]);
129 cout << "-split " << split_m << endl;
130 }
131 else if (ST.stringcmp(argv[i], "-tasks") == 0) {
132 f_tasks = TRUE;
133 nb_tasks = ST.strtoi(argv[++i]);
134 tasks_line.assign(argv[++i]);
135 cout << "-tasks " << nb_tasks << " " << tasks_line << endl;
136 }
137 else if (ST.stringcmp(argv[i], "-end") == 0) {
138 cout << "-end" << endl;
139 break;
140 }
141 else {
142 cout << "create_file_description::read_arguments "
143 "unrecognized option " << argv[i] << endl;
144 }
145 } // next i
146 cout << "create_file_description::read_arguments done" << endl;
147 return i + 1;
148}
149
151{
152 if (f_file_mask) {
153 cout << "-file_mask " << file_mask << endl;
154 }
155 if (f_N) {
156 cout << "-N " << N << endl;
157 }
158 if (f_read_cases) {
159 cout << "-read_cases " << read_cases_fname << endl;
160 }
161 if (f_read_cases_text) {
162 cout << "-read_cases_text " << read_cases_fname << " "
165 }
166 if (nb_lines) {
167 int i;
168 for (i = 0; i < nb_lines; i++) {
170 cout << "-line_numeric " << lines[i] << endl;
171 }
172 else {
173 cout << "-line " << lines[i] << endl;
174 }
175 }
176 }
177 if (nb_final_lines) {
178 int i;
179 for (i = 0; i < nb_final_lines; i++) {
180 cout << "-final_line " << final_lines[i] << endl;
181 }
182
183 }
184 if (f_command) {
185 cout << "-command " << command << endl;
186 }
187 if (f_repeat) {
188 cout << "-repeat " << repeat_N
189 << " " << repeat_start
190 << " " << repeat_increment
191 << " " << repeat_mask
192 << endl;
193 }
194 if (f_split) {
195 cout << "-split " << split_m << endl;
196 }
197 if (f_tasks) {
198 cout << "-tasks " << nb_tasks << " " << tasks_line << endl;
199 }
200}
201
202
203}}}
204
205
functions related to strings and character arrays
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
the orbiter library for the classification of combinatorial objects