1 : |
agomez |
1 |
#include "readword.h" |
2 : |
|
|
#include "errorhandler.h" |
3 : |
|
|
#include "gadget.h" |
4 : |
|
|
#include "global.h" |
5 : |
|
|
|
6 : |
|
|
void readWordAndVariable(CommentStream& infile, const char* str, double& number) {
|
7 : |
|
|
char text[MaxStrLength];
|
8 : |
|
|
strncpy(text, "", MaxStrLength);
|
9 : |
|
|
infile >> text;
|
10 : |
|
|
if (strcasecmp(text, str) != 0)
|
11 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
12 : |
|
|
infile >> number >> ws;
|
13 : |
|
|
}
|
14 : |
|
|
|
15 : |
|
|
void readWordAndVariable(CommentStream& infile, const char* str, int& number) {
|
16 : |
|
|
char text[MaxStrLength];
|
17 : |
|
|
strncpy(text, "", MaxStrLength);
|
18 : |
|
|
infile >> text;
|
19 : |
|
|
if (strcasecmp(text, str) != 0)
|
20 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
21 : |
|
|
infile >> number >> ws;
|
22 : |
|
|
}
|
23 : |
|
|
|
24 : |
|
|
void readWordAndValue(CommentStream& infile, const char* str, char* value) {
|
25 : |
|
|
char text[MaxStrLength];
|
26 : |
|
|
strncpy(text, "", MaxStrLength);
|
27 : |
|
|
infile >> text;
|
28 : |
|
|
if (strcasecmp(text, str) != 0)
|
29 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
30 : |
|
|
infile >> value >> ws;
|
31 : |
|
|
}
|
32 : |
|
|
|
33 : |
|
|
void readWordAndVariable(CommentStream& infile, const char* str, Formula& formula) {
|
34 : |
|
|
char text[MaxStrLength];
|
35 : |
|
|
strncpy(text, "", MaxStrLength);
|
36 : |
|
|
infile >> text;
|
37 : |
|
|
if (strcasecmp(text, str) != 0)
|
38 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
39 : |
|
|
infile >> formula >> ws;
|
40 : |
|
|
}
|
41 : |
|
|
|
42 : |
|
|
void readWordAndModelVariable(CommentStream& infile, const char* str, ModelVariable& modelvariable,
|
43 : |
|
|
const TimeClass* const TimeInfo, Keeper* const keeper) {
|
44 : |
|
|
char text[MaxStrLength];
|
45 : |
|
|
strncpy(text, "", MaxStrLength);
|
46 : |
|
|
infile >> text;
|
47 : |
|
|
if (strcasecmp(text, str) != 0)
|
48 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
49 : |
|
|
modelvariable.read(infile, TimeInfo, keeper);
|
50 : |
|
|
}
|
51 : |
|
|
|
52 : |
|
|
void readWordAndTwoVariables(CommentStream& infile, const char* str, double& number1, double& number2) {
|
53 : |
|
|
char text[MaxStrLength];
|
54 : |
|
|
strncpy(text, "", MaxStrLength);
|
55 : |
|
|
infile >> text;
|
56 : |
|
|
if (strcasecmp(text, str) != 0)
|
57 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
58 : |
|
|
infile >> number1 >> number2 >> ws;
|
59 : |
|
|
}
|
60 : |
|
|
|
61 : |
|
|
void readWordAndTwoVariables(CommentStream& infile, const char* str, int& number1, int& number2) {
|
62 : |
|
|
char text[MaxStrLength];
|
63 : |
|
|
strncpy(text, "", MaxStrLength);
|
64 : |
|
|
infile >> text;
|
65 : |
|
|
if (strcasecmp(text, str) != 0)
|
66 : |
|
|
handle.logFileUnexpected(LOGFAIL, str, text);
|
67 : |
|
|
infile >> number1 >> number2 >> ws;
|
68 : |
|
|
}
|