Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1/* This file is part of Cloudy and is copyright (C)1978-2025 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
13bool lgIsCommentSeq( const string& s, size_t p, bool lgReportVisible );
14
16bool lgIsExpungedCommentSeq( const string& s );
17
23bool lgInputComment( const string& chLine );
24
26bool lgInputEOF( const string& chLine );
27
31void StripComment( string& s, bool lgStripVisible );
32
39size_t GetString( const string& s, size_t p, string& buf );
40
43char GetEscape( const string& s, size_t& p );
44
47string MakeInputLine(long i);
48
50void input_readvector(const string& chFile,
51 vector<double> &vec);
52
53struct CardInfo {
55 string chCardSav;
65 CardInfo() : InclLevel(-1), lgVisible(true) {}
66};
67
68struct t_input : public module {
69
70 const char *chName() const
71 {
72 return "input";
73 }
74
76 void zero() {}
77
79 vector<CardInfo*> crd;
80
82 string chTitle;
83
86
89
91 long int nRead;
92
95
99
103
106
107 void clear()
108 {
109 for( size_t i=0; i < crd.size(); ++i )
110 delete crd[i];
111 crd.clear();
112 curInclLevel = 0;
113 lgInitPresent = false;
114 lgUnderscoreFound = false;
115 lgBracketFound = false;
116 }
117
119 {
120 /* will be set true if no buffering command entered */
121 lgSetNoBuffering = false;
122 }
123
125 {
126 clear();
127 }
128
129private:
130 // friend CodeSmell
131 friend class Parser;
132
137 string readarray(bool *lgEOF);
142 string peekarray(bool *lgEOF);
143
144public:
145 void echo(FILE *ipOUT) const;
146
149 void init()
150 {
151 nRead = -1;
152 }
153};
154extern t_input input;
155
156#endif /* INPUT_H_ */
module()
Definition module.h:29
Definition warnings.h:11
t_input input
Definition input.cpp:13
void StripComment(string &s, bool lgStripVisible)
Definition input.cpp:68
string MakeInputLine(long i)
Definition input.cpp:146
bool lgInputEOF(const string &chLine)
Definition input.cpp:52
void input_readvector(const string &chFile, vector< double > &vec)
Definition input.cpp:261
bool lgIsExpungedCommentSeq(const string &s)
Definition input.cpp:30
bool lgIsCommentSeq(const string &s, size_t p, bool lgReportVisible)
Definition input.cpp:17
size_t GetString(const string &s, size_t p, string &buf)
Definition input.cpp:111
bool lgInputComment(const string &chLine)
Definition input.cpp:44
char GetEscape(const string &s, size_t &p)
Definition input.cpp:132
CardInfo()
Definition input.h:65
int InclLevel
Definition input.h:61
string chCardSav
Definition input.h:55
bool lgVisible
Definition input.h:64
Definition input.h:68
void init()
Definition input.h:149
~t_input()
Definition input.h:124
bool lgUnderscoreFound
Definition input.h:98
string readarray(bool *lgEOF)
Definition input.cpp:218
long int nRead
Definition input.h:91
bool lgBracketFound
Definition input.h:102
void zero()
Definition input.h:76
string peekarray(bool *lgEOF)
Definition input.cpp:244
int curInclLevel
Definition input.h:85
void echo(FILE *ipOUT) const
Definition input.cpp:209
void comment(t_warnings &)
Definition input.h:75
bool lgInitPresent
Definition input.h:94
const char * chName() const
Definition input.h:70
void clear()
Definition input.h:107
bool lgSetNoBuffering
Definition input.h:105
friend class Parser
Definition input.h:131
bool lgVisibilityStatus
Definition input.h:88
t_input()
Definition input.h:118
string chTitle
Definition input.h:82
vector< CardInfo * > crd
Definition input.h:79