MCPcopy Create free account
hub / github.com/cvmfs/cvmfs / GetLineFile

Function GetLineFile

cvmfs/util/string.cc:423–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423bool GetLineFile(FILE *f, std::string *line) {
424 int retval;
425 line->clear();
426 while (true) {
427 retval = fgetc(f);
428 if (ferror(f) && (errno == EINTR)) {
429 clearerr(f);
430 continue;
431 } else if (retval == EOF) {
432 break;
433 }
434 const char c = static_cast<char>(retval);
435 if (c == '\n')
436 break;
437 line->push_back(c);
438 }
439 return (retval != EOF) || !line->empty();
440}
441
442bool GetLineFd(const int fd, std::string *line) {
443 ssize_t retval;

Callers 15

CheckGraftMethod · 0.85
MainMethod · 0.85
ReadFromFileMethod · 0.85
ReadSessionTokenFileMethod · 0.85
TryParsePathMethod · 0.85
ParsePathMethod · 0.85
GetDnsAddressesMethod · 0.85
ParseHostFileMethod · 0.85
ParseMethod · 0.85
ParseMethod · 0.85
CreateMethod · 0.85
CreateFromMethod · 0.85

Calls 1

clearMethod · 0.80

Tested by 1

ParseMethod · 0.68