#include <string>
-#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/textstream.h"
namespace gmx
std::string str_;
};
+template<typename T> class ConstArrayRef;
+
+/*! \libinternal \brief
+ * Helper class to convert static string data to a stream.
+ *
+ * Provides a text input stream that returns lines from a string
+ */
+class StringInputStream : public TextInputStream
+{
+ public:
+ /*! \brief
+ * Constructor that stores input lines in a string.
+ *
+ * The string is internally but no processing is done.
+ *
+ * \param[in] input String to be served by the stream.
+ */
+ explicit StringInputStream(const std::string &input);
+ /*! \brief
+ * Constructor that stores input lines in a string.
+ *
+ * The array of char * is stored as a string separated by newline.
+ *
+ * \param[in] input Array of char * to be served by the stream.
+ */
+ explicit StringInputStream(ConstArrayRef<const char *> const &input);
+
+ // From TextInputStream
+ virtual bool readLine(std::string *line);
+ virtual void close() {};
+ private:
+ std::string input_;
+ size_t pos_;
+};
+
} // namespace gmx
#endif