]> www.ginac.de Git - cln.git/blobdiff - src/base/string/input/cl_st_get1.cc
Add index entry for 'cast'.
[cln.git] / src / base / string / input / cl_st_get1.cc
index 697a72fc1944dc611180896167b662d0a0f7a7f5..8524e7db6450de4e21e3697286166e527f442d9b 100644 (file)
@@ -4,29 +4,24 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_string.h"
+#include "cln/string.h"
 
 
 // Implementation.
 
-#ifdef CL_IO_IOSTREAM
-
-#include "cl_io.h"
+#include "cln/io.h"
 #include "cl_spushstring.h"
 
-#if ((defined(__sparc__) || defined(__rs6000__) || defined(__mips__)) && !defined(__GNUC__))
-// Sun C++ doesn't have istream::unget().
-  #define unget()  putback(c)
-#endif
+namespace cln {
 
-const cl_string cl_fget (cl_istream stream, char delim)
+const cl_string cl_fget (std::istream& stream, char delim)
 {
        var cl_spushstring buffer;
        // Handling of eofp is tricky: EOF is reached when (!stream.good()) || (stream.get()==EOF).
        while (stream.good()) {
                var int c = stream.get();
                if (c==EOF)
-                       break;  // ios::eofbit already set
+                       break;  // std::ios::eofbit already set
                if (c==delim) {
                        stream.unget();
                        break;
@@ -36,4 +31,4 @@ const cl_string cl_fget (cl_istream stream, char delim)
        return buffer.contents();
 }
 
-#endif
+}  // namespace cln