#include <string>
#include <memory>
+namespace {
+
/* A header of a ui_out_table. */
class ui_out_hdr
std::string m_header;
};
+} // namespace
+
/* A level of nesting (either a list or a tuple) in a ui_out output. */
class ui_out_level
m_table_up = nullptr;
}
-static void
-do_cleanup_table_end (void *data)
-{
- ui_out *uiout = (ui_out *) data;
-
- uiout->table_end ();
-}
-
-struct cleanup *
-make_cleanup_ui_out_table_begin_end (ui_out *uiout, int nr_cols, int nr_rows,
- const char *tblid)
-{
- uiout->table_begin (nr_cols, nr_rows, tblid);
- return make_cleanup (do_cleanup_table_end, uiout);
-}
-
void
ui_out::begin (ui_out_type type, const char *id)
{
}
void
-ui_out::field_stream (const char *fldname, ui_file *stream)
+ui_out::field_stream (const char *fldname, string_file &stream)
{
- std::string buffer = ui_file_as_string (stream);
-
- if (!buffer.empty ())
- field_string (fldname, buffer.c_str ());
+ if (!stream.empty ())
+ field_string (fldname, stream.c_str ());
else
field_skip (fldname);
- ui_file_rewind (stream);
+ stream.clear ();
}
/* Used to omit a field. */