FACT++  1.0
bool ofits::Key::FormatComment ( )
inline

Definition at line 108 of file ofits.h.

References ___err___, gLog, and Trim().

Referenced by check().

109  {
110  comment = Trim(comment);
111 
112 #if GCC_VERSION < 40603
113  for (std::string::const_iterator c=key.begin(); c<key.end(); c++)
114 #else
115  for (std::string::const_iterator c=key.cbegin(); c<key.cend(); c++)
116 #endif
117  if (*c<32 || *c>126)
118  {
119  std::ostringstream sout;
120  sout << "Invalid character '" << *c << "' [" << int(*c) << "] found in comment '" << comment << "'";
121 #ifdef __EXCEPTIONS
122  throw std::runtime_error(sout.str());
123 #else
124  gLog << ___err___ << "ERROR - " << sout.str() << std::endl;
125  return false;
126 #endif
127  }
128 
129  return true;
130  }
std::string key
Definition: ofits.h:37
#define gLog
Definition: fits.h:36
#define ___err___
Definition: fits.h:37
std::string comment
Definition: ofits.h:40
std::string Trim(const std::string &str)
Definition: ofits.h:50

+ Here is the call graph for this function:

+ Here is the caller graph for this function: