38#include "blocxx/BLOCXX_config.h"
54 char * res = std::fgets(dst, dstsize, fp);
68 std::size_t
const end = dstsize - 1;
69 char savechar = dst[end];
71 char * res = std::fgets(dst, dstsize, fp);
72 char endchar = dst[end];
76 if (endchar ==
'\0' && (end == 0 || dst[end - 1] !=
'\n'))
83 std::ungetc(std::fgetc(fp), fp);
106 std::size_t
const BUFSIZE = 8 * 1024;
114 if (sb.
length() > max_chars)
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
#define BLOCXX_THROW_ERR(exType, msg, err)
Throw an exception using FILE and LINE.
StringBuffer & append(char c)
bool endsWith(char ch) const
This String class is an abstract data type that represents as NULL terminated string of characters.
char * fgets_trunc(char *dst, std::size_t dstsize, FILE *fp)
String fget_string(FILE *fp, std::size_t const max_chars)
char * fgets_check(char *dst, std::size_t dstsize, FILE *fp)
int const RESULT_TRUNCATED
Error codes for use with OverflowException class.