cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
input.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef INPUT_H_
5 #define INPUT_H_
6 
7 /* input.h */
8 
9 #include "module.h"
10 
12 const int NKRD = 4000;
13 
18 bool lgIsCommentSeq( const char *s, bool lgColumn0, bool lgReportVisible );
19 
21 bool lgIsExpungedCommentSeq( const char *s );
22 
28 bool lgInputComment( const char *chLine );
29 
31 bool lgInputEOF( const char *chLine );
32 
37 void StripComment( string& s, bool lgStripVisible );
38 
45 size_t GetString( const string& s, size_t p, string& buf );
46 
49 char GetEscape( const string& s, size_t& p );
50 
52 void input_readvector(const char* chFile,
53  vector<double> &vec,
54  bool* lgError);
57 void input_readvector(const char* chFile,
58  double vector[],
59  long n,
60  bool* lgEOF);
62 struct t_input : public module {
63 
64  const char *chName() const
65  {
66  return "input";
67  }
68 
69  void zero();
70 
71  void comment(t_warnings&) {}
72 
75 
78 
81 
83  char chDelimiter[3];
84 
93 
96  bool lgVisible[NKRD];
97 
100 
102  long int nSave;
103 
105  long int nRead;
106 
109 
113 
117 
120 
123 
125  {
126  // subdirectory delimiter character
127 # ifdef _WIN32
128  strcpy( chDelimiter, "\\" );
129 # else
130  strcpy( chDelimiter, "/" );
131 # endif
132  /* will be set true if no buffering command entered */
133  lgSetNoBuffering = false;
134  }
135 
136 
143  // friend CodeSmell
144  private:
145  friend class Parser;
146  void readarray(
147  char *chCardStripped,
148  char *chCardComment,
149  bool *lgEOF);
150 
151  public:
152  void echo( FILE *ipOUT);
153 
156  void init(void);
157 
158 
159  };
160 extern t_input input;
161 
162 
163 
164 #endif /* INPUT_H_ */
long int nSave
Definition: input.h:102
void comment(t_warnings &)
Definition: input.h:71
const int NKRD
Definition: input.h:12
t_input input
Definition: input.cpp:12
bool lgInitPresent
Definition: input.h:108
int curInclLevel
Definition: input.h:92
long int nRead
Definition: input.h:105
void zero()
Definition: input.cpp:14
bool lgInputEOF(const char *chLine)
Definition: input.cpp:84
size_t GetString(const string &s, size_t p, string &buf)
Definition: input.cpp:152
char chTitle[INPUT_LINE_LENGTH]
Definition: input.h:80
char chCardStrip[NKRD][INPUT_LINE_LENGTH]
Definition: input.h:77
Definition: parser.h:43
bool lgDeprecatedComment
Definition: input.h:119
bool lgIsCommentSeq(const char *s, bool lgColumn0, bool lgReportVisible)
Definition: input.cpp:31
void StripComment(string &s, bool lgStripVisible)
Definition: input.cpp:98
void input_readvector(const char *chFile, vector< double > &vec, bool *lgError)
Definition: input.cpp:246
bool lgVisible[NKRD]
Definition: input.h:96
void echo(FILE *ipOUT)
Definition: input.cpp:199
const int INPUT_LINE_LENGTH
Definition: cddefines.h:301
bool lgUnderscoreFound
Definition: input.h:112
bool lgBracketFound
Definition: input.h:116
bool lgIsExpungedCommentSeq(const char *s)
Definition: input.cpp:59
bool lgVisibilityStatus
Definition: input.h:99
t_input()
Definition: input.h:124
char chDelimiter[3]
Definition: input.h:83
bool lgSetNoBuffering
Definition: input.h:122
void readarray(char *chCardStripped, char *chCardComment, bool *lgEOF)
Definition: input.cpp:208
bool lgInputComment(const char *chLine)
Definition: input.cpp:72
char GetEscape(const string &s, size_t &p)
Definition: input.cpp:173
char chCardSav[NKRD][INPUT_LINE_LENGTH]
Definition: input.h:74
const char * chName() const
Definition: input.h:64
Definition: module.h:26
Definition: input.h:62
int InclLevel[NKRD]
Definition: input.h:91
void init(void)
Definition: input.cpp:186