return real_len;
}
+/**
+ * Read and remove a line from the input buffer.
+ * @param delim the line ending character, \\n by default.
+ * @returns A full line including the line ending if available, an empty string otherwise.
+ */
+std::string IOImplementation::getline(char delim)
+{
+ std::string line;
+ std::string::size_type pos=m_input_buffer.find(delim);
+
+ // no line ending in the buffer?
+ if (pos==std::string::npos)
+ return line;
+
+ // copy the line including the delimiter
+ line=m_input_buffer.substr(0,pos+1);
+
+ m_input_buffer.erase(0,pos+1);
+
+ return line;
+}
+
+
/*
* implementation of SimpleIO
*/