mosesdecoder/phrase-extract/SafeGetline.h File Reference

Go to the source code of this file.

Defines

#define SAFE_GETLINE(_IS, _LINE, _SIZE, _DELIM, _FILE)


Define Documentation

#define SAFE_GETLINE ( _IS,
_LINE,
_SIZE,
_DELIM,
_FILE   ) 

Value:

{            \
    _IS.getline(_LINE, _SIZE, _DELIM);                              \
    if(_IS.fail() && !_IS.bad() && !_IS.eof()) _IS.clear();         \
    if (_IS.gcount() == _SIZE-1) {                                  \
      cerr << "Line too long! Buffer overflow. Delete lines >="     \
       << _SIZE << " chars or raise LINE_MAX_LENGTH in " << _FILE   \
       << endl;                                                     \
      exit(1);                                                      \
    }                                                               \
  }

Definition at line 24 of file SafeGetline.h.


Generated on Thu Jun 4 00:31:00 2015 for Moses by  doxygen 1.5.9