CSS-Sass
view release on metacpan or search on metacpan
libsass/sass2scss.cpp view on Meta::CPAN
// read line with either CR, LF or CR LF format
// http://stackoverflow.com/a/6089413/1550314
static std::istream& safeGetline(std::istream& is, std::string& t)
{
t.clear();
// The characters in the stream are read one-by-one using a std::streambuf.
// That is faster than reading them one-by-one using the std::istream.
// Code that uses streambuf this way must be guarded by a sentry object.
// The sentry object performs various tasks,
// such as thread synchronization and updating the stream state.
std::istream::sentry se(is, true);
std::streambuf* sb = is.rdbuf();
for(;;) {
int c = sb->sbumpc();
switch (c) {
case '\n':
return is;
case '\r':
( run in 0.222 second using v1.01-cache-2.11-cpan-0d8aa00de5b )