* libtextstyle/gnulib-local/lib/fd-ostream.oo.h (is_instance_of_fd_ostream): New
declaration.
* libtextstyle/gnulib-local/lib/fd-ostream.oo.c (is_instance_of_fd_ostream): New
function.
* libtextstyle/gnulib-local/lib/file-ostream.oo.h (is_instance_of_file_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/file-ostream.oo.c (is_instance_of_file_ostream):
New function.
* libtextstyle/gnulib-local/lib/html-ostream.oo.h (is_instance_of_html_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/html-ostream.oo.c (is_instance_of_html_ostream):
New function.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.h
(is_instance_of_html_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/html-styled-ostream.oo.c
(is_instance_of_html_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.h
(is_instance_of_iconv_ostream): New declaration.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c
(is_instance_of_iconv_ostream): New function.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.h
(is_instance_of_memory_ostream): New declaration.
* libtextstyle/gnulib-local/lib/memory-ostream.oo.c
(is_instance_of_memory_ostream): New function.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.h
(is_instance_of_noop_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/noop-styled-ostream.oo.c
(is_instance_of_noop_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.h
(is_instance_of_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/styled-ostream.oo.c
(is_instance_of_styled_ostream): New function.
* libtextstyle/gnulib-local/lib/term-ostream.oo.h (is_instance_of_term_ostream):
New declaration.
* libtextstyle/gnulib-local/lib/term-ostream.oo.c (is_instance_of_term_ostream):
New function.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.h
(is_instance_of_term_styled_ostream): New declaration.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.c
(is_instance_of_term_styled_ostream): New function.
* libtextstyle/lib/textstyle.h (is_instance_of_styled_ostream,
is_instance_of_file_ostream, is_instance_of_fd_ostream,
is_instance_of_term_ostream, is_instance_of_memory_ostream,
is_instance_of_iconv_ostream, is_instance_of_html_ostream,
is_instance_of_term_styled_ostream, is_instance_of_html_styled_ostream,
is_instance_of_noop_styled_ostream): New declarations.
* libtextstyle/tests/test-instanceof.c: New file.
* libtextstyle/tests/Makefile.am: Arrange to compile it.
* libtextstyle/doc/libtextstyle.texi (The output stream hierarchy): Mention the
is_instance_of_* predicates.
* libtextstyle/NEWS: Mention the new functions.
/lib/xvasprintf.h
/tests/
!/tests/Makefile.am
+!/tests/test-instanceof.c
# Files brought in by "automake --add-missing --copy":
/build-aux/compile
+New in 0.21.1:
+* Added type test functions:
+ TYPE FUNCTION
+ styled_ostream_t is_instance_of_styled_ostream
+ file_ostream_t is_instance_of_file_ostream
+ fd_ostream_t is_instance_of_fd_ostream
+ term_ostream_t is_instance_of_term_ostream
+ memory_ostream_t is_instance_of_memory_ostream
+ iconv_ostream_t is_instance_of_iconv_ostream
+ html_ostream_t is_instance_of_html_ostream
+ term_styled_ostream_t is_instance_of_term_styled_ostream
+ html_styled_ostream_t is_instance_of_html_styled_ostream
+ noop_styled_ostream_t is_instance_of_noop_styled_ostream
+
New in 0.21:
* Added support for emitting hyperlinks.
New functions:
This manual provides documentation for the GNU @code{libtextstyle} library.
@copying
-Copyright (C) 2018-2019 Free Software Foundation, Inc.
+Copyright (C) 2018-2020 Free Software Foundation, Inc.
This manual is free documentation. It is dually licensed under the
GNU FDL and the GNU GPL. This means that you can redistribute this
@page
@vskip 0pt plus 1filll
@c @insertcopying
-Copyright (C) 2018-2019 Free Software Foundation, Inc.
+Copyright (C) 2018-2020 Free Software Foundation, Inc.
This manual is free documentation. It is dually licensed under the
GNU FDL and the GNU GPL. This means that you can redistribute this
@item
The opposite conversion, from @samp{ostream_t} to @samp{some_ostream_t},
can also be performed, provided that the object is actually an instance
-of @samp{some_ostream_t}.
+of @samp{some_ostream_t}. You can test whether an object is an instance
+of @samp{some_ostream_t} by invoking the method
+@samp{bool is_instance_of_some_ostream (ostream_t stream)}.
@item
Every method @samp{ostream_@var{foobar}} exists also as a method
@samp{some_ostream_@var{foobar}} with compatible argument types and a
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_fd_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, fd_ostream);
+}
/* Output stream referring to a file descriptor.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
bool buffered);
+/* Test whether a given output stream is a fd_ostream. */
+extern bool is_instance_of_fd_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Output stream referring to an stdio FILE.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_file_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, file_ostream);
+}
/* Output stream referring to an stdio FILE.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _FILE_OSTREAM_H
#define _FILE_OSTREAM_H
+#include <stdbool.h>
#include <stdio.h>
#include "ostream.h"
extern file_ostream_t file_ostream_create (FILE *fp);
+/* Test whether a given output stream is a file_ostream. */
+extern bool is_instance_of_file_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_html_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, html_ostream);
+}
/* Output stream that produces HTML output.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _HTML_OSTREAM_H
#define _HTML_OSTREAM_H
+#include <stdbool.h>
+
#include "ostream.h"
extern html_ostream_t html_ostream_create (ostream_t destination);
+/* Test whether a given output stream is a html_ostream. */
+extern bool is_instance_of_html_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Output stream for CSS styled text, producing HTML output.
- Copyright (C) 2006-2007, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_html_styled_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, html_styled_ostream);
+}
/* Output stream for CSS styled text, producing HTML output.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _HTML_STYLED_OSTREAM_H
#define _HTML_STYLED_OSTREAM_H
+#include <stdbool.h>
+
#include "styled-ostream.h"
const char *css_filename);
+/* Test whether a given output stream is a html_styled_ostream. */
+extern bool is_instance_of_html_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
return stream;
}
+/* Instanceof test. */
+
+bool
+is_instance_of_iconv_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, iconv_ostream);
+}
+
#else
static void
abort ();
}
+/* Instanceof test. */
+
+bool
+is_instance_of_iconv_ostream (ostream_t stream)
+{
+ return false;
+}
+
#endif /* HAVE_ICONV */
/* Output stream that converts the output to another encoding.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
/* Note that this stream does not provide accurate error messages with line
and column number when the conversion fails. */
+#include <stdbool.h>
+
#include "ostream.h"
#endif /* HAVE_ICONV */
+/* Test whether a given output stream is an iconv_ostream. */
+extern bool is_instance_of_iconv_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Output stream that accumulates the output in memory.
- Copyright (C) 2006-2007, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_memory_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, memory_ostream);
+}
/* Output stream that accumulates the output in memory.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _MEMORY_OSTREAM_H
#define _MEMORY_OSTREAM_H
+#include <stdbool.h>
#include <stddef.h>
#include "ostream.h"
extern memory_ostream_t memory_ostream_create (void);
+/* Test whether a given output stream is a memory_ostream. */
+extern bool is_instance_of_memory_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Output stream with no-op styling.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2019.
This program is free software: you can redistribute it and/or modify
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_noop_styled_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, noop_styled_ostream);
+}
/* Output stream with no-op styling.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2019.
This program is free software: you can redistribute it and/or modify
noop_styled_ostream_create (ostream_t destination, bool pass_ownership);
+/* Test whether a given output stream is a noop_styled_ostream. */
+extern bool is_instance_of_noop_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Abstract output stream for CSS styled text.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
{
fields:
};
+
+/* Instanceof test. */
+
+bool
+is_instance_of_styled_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, styled_ostream);
+}
/* Abstract output stream for CSS styled text.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _STYLED_OSTREAM_H
#define _STYLED_OSTREAM_H
+#include <stdbool.h>
+
#include "ostream.h"
void flush_to_current_style (styled_ostream_t stream);
};
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Test whether a given output stream is a styled_ostream. */
+extern bool is_instance_of_styled_ostream (ostream_t stream);
+
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _STYLED_OSTREAM_H */
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_term_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, term_ostream);
+}
/* Output stream for attributed text, producing ANSI escape sequences.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _TERM_OSTREAM_H
#define _TERM_OSTREAM_H
+#include <stdbool.h>
+
#include "ostream.h"
term_ostream_create (int fd, const char *filename, ttyctl_t tty_control);
+/* Test whether a given output stream is a term_ostream. */
+extern bool is_instance_of_term_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
return stream;
}
+
+/* Instanceof test. */
+
+bool
+is_instance_of_term_styled_ostream (ostream_t stream)
+{
+ return IS_INSTANCE (stream, ostream, term_styled_ostream);
+}
/* Output stream for CSS styled text, producing ANSI escape sequences.
- Copyright (C) 2006, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2019-2020 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
#ifndef _TERM_STYLED_OSTREAM_H
#define _TERM_STYLED_OSTREAM_H
+#include <stdbool.h>
+
#include "styled-ostream.h"
#include "term-ostream.h"
const char *css_filename);
+/* Test whether a given output stream is a term_styled_ostream. */
+extern bool is_instance_of_term_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
/* Public API of the libtextstyle library.
- Copyright (C) 2006-2007, 2019 Free Software Foundation, Inc.
+ Copyright (C) 2006-2007, 2019-2020 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Test whether a given output stream is a styled_ostream. */
+extern bool is_instance_of_styled_ostream (ostream_t stream);
+
+
+#ifdef __cplusplus
+}
+#endif
+
/* -------------------------- From file-ostream.h -------------------------- */
/* file_ostream_t is a subtype of ostream_t. */
extern file_ostream_t file_ostream_create (FILE *fp);
+/* Test whether a given output stream is a file_ostream. */
+extern bool is_instance_of_file_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
bool buffered);
+/* Test whether a given output stream is a fd_ostream. */
+extern bool is_instance_of_fd_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
term_ostream_create (int fd, const char *filename, ttyctl_t tty_control);
+/* Test whether a given output stream is a term_ostream. */
+extern bool is_instance_of_term_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
extern memory_ostream_t memory_ostream_create (void);
+/* Test whether a given output stream is a memory_ostream. */
+extern bool is_instance_of_memory_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
ostream_t destination);
+/* Test whether a given output stream is an iconv_ostream. */
+extern bool is_instance_of_iconv_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
extern html_ostream_t html_ostream_create (ostream_t destination);
+/* Test whether a given output stream is a html_ostream. */
+extern bool is_instance_of_html_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
const char *css_filename);
+/* Test whether a given output stream is a term_styled_ostream. */
+extern bool is_instance_of_term_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
const char *css_filename);
+/* Test whether a given output stream is a html_styled_ostream. */
+extern bool is_instance_of_html_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
noop_styled_ostream_create (ostream_t destination, bool pass_ownership);
+/* Test whether a given output stream is a noop_styled_ostream. */
+extern bool is_instance_of_noop_styled_ostream (ostream_t stream);
+
+
#ifdef __cplusplus
}
#endif
## Makefile for the tests subdirectory of GNU libtextstyle.
-## Copyright (C) 2009-2019 Free Software Foundation, Inc.
+## Copyright (C) 2009-2020 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
# Ensure that ../lib/config.h is seen before ../config.h.
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/lib -I$(top_builddir)
+TESTS += test-instanceof
+check_PROGRAMS += test-instanceof
+EXTRA_DIST += test-instanceof.c
+AM_CPPFLAGS += -DSRCDIR=\"$(srcdir)/\"
+
# For debugging memory leaks and memory allocation bugs.
# You should build with --disable-shared when using valgrind.
--- /dev/null
+/* Test for the is_instance_of_* functions. */
+
+#include <config.h>
+
+#include "textstyle.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define ASSERT(x) if (!(x)) abort ()
+
+int
+main ()
+{
+ ostream_t stream1 = file_ostream_create (stdout);
+ ostream_t stream2 = fd_ostream_create (1, "(stdout)", false);
+ ostream_t stream3 = term_ostream_create (1, "(stdout)", TTYCTL_AUTO);
+ ostream_t stream4 = memory_ostream_create ();
+ ostream_t stream5 = html_ostream_create (stream1);
+ ostream_t sstream1 =
+ term_styled_ostream_create (1, "(stdout)", TTYCTL_AUTO,
+ SRCDIR "../adhoc-tests/hello-default.css");
+ ostream_t sstream2 =
+ html_styled_ostream_create (stream5,
+ SRCDIR "../adhoc-tests/hello-default.css");
+ ostream_t sstream3 = noop_styled_ostream_create (stream1, false);
+
+ if (stream1 != NULL)
+ {
+ ASSERT (! is_instance_of_styled_ostream (stream1));
+ ASSERT (is_instance_of_file_ostream (stream1));
+ ASSERT (! is_instance_of_fd_ostream (stream1));
+ ASSERT (! is_instance_of_term_ostream (stream1));
+ ASSERT (! is_instance_of_memory_ostream (stream1));
+ ASSERT (! is_instance_of_iconv_ostream (stream1));
+ ASSERT (! is_instance_of_html_ostream (stream1));
+ ASSERT (! is_instance_of_term_styled_ostream (stream1));
+ ASSERT (! is_instance_of_html_styled_ostream (stream1));
+ ASSERT (! is_instance_of_noop_styled_ostream (stream1));
+ }
+
+ if (stream2 != NULL)
+ {
+ ASSERT (! is_instance_of_styled_ostream (stream2));
+ ASSERT (! is_instance_of_file_ostream (stream2));
+ ASSERT (is_instance_of_fd_ostream (stream2));
+ ASSERT (! is_instance_of_term_ostream (stream2));
+ ASSERT (! is_instance_of_memory_ostream (stream2));
+ ASSERT (! is_instance_of_iconv_ostream (stream2));
+ ASSERT (! is_instance_of_html_ostream (stream2));
+ ASSERT (! is_instance_of_term_styled_ostream (stream2));
+ ASSERT (! is_instance_of_html_styled_ostream (stream2));
+ ASSERT (! is_instance_of_noop_styled_ostream (stream2));
+ }
+
+ if (stream3 != NULL)
+ {
+ ASSERT (! is_instance_of_styled_ostream (stream3));
+ ASSERT (! is_instance_of_file_ostream (stream3));
+ ASSERT (! is_instance_of_fd_ostream (stream3));
+ ASSERT (is_instance_of_term_ostream (stream3));
+ ASSERT (! is_instance_of_memory_ostream (stream3));
+ ASSERT (! is_instance_of_iconv_ostream (stream3));
+ ASSERT (! is_instance_of_html_ostream (stream3));
+ ASSERT (! is_instance_of_term_styled_ostream (stream3));
+ ASSERT (! is_instance_of_html_styled_ostream (stream3));
+ ASSERT (! is_instance_of_noop_styled_ostream (stream3));
+ }
+
+ if (stream4 != NULL)
+ {
+ ASSERT (! is_instance_of_styled_ostream (stream4));
+ ASSERT (! is_instance_of_file_ostream (stream4));
+ ASSERT (! is_instance_of_fd_ostream (stream4));
+ ASSERT (! is_instance_of_term_ostream (stream4));
+ ASSERT (is_instance_of_memory_ostream (stream4));
+ ASSERT (! is_instance_of_iconv_ostream (stream4));
+ ASSERT (! is_instance_of_html_ostream (stream4));
+ ASSERT (! is_instance_of_term_styled_ostream (stream4));
+ ASSERT (! is_instance_of_html_styled_ostream (stream4));
+ ASSERT (! is_instance_of_noop_styled_ostream (stream4));
+ }
+
+ if (stream5 != NULL)
+ {
+ ASSERT (! is_instance_of_styled_ostream (stream5));
+ ASSERT (! is_instance_of_file_ostream (stream5));
+ ASSERT (! is_instance_of_fd_ostream (stream5));
+ ASSERT (! is_instance_of_term_ostream (stream5));
+ ASSERT (! is_instance_of_memory_ostream (stream5));
+ ASSERT (! is_instance_of_iconv_ostream (stream5));
+ ASSERT (is_instance_of_html_ostream (stream5));
+ ASSERT (! is_instance_of_term_styled_ostream (stream5));
+ ASSERT (! is_instance_of_html_styled_ostream (stream5));
+ ASSERT (! is_instance_of_noop_styled_ostream (stream5));
+ }
+
+ if (sstream1 != NULL)
+ {
+ ASSERT (is_instance_of_styled_ostream (sstream1));
+ ASSERT (! is_instance_of_file_ostream (sstream1));
+ ASSERT (! is_instance_of_fd_ostream (sstream1));
+ ASSERT (! is_instance_of_term_ostream (sstream1));
+ ASSERT (! is_instance_of_memory_ostream (sstream1));
+ ASSERT (! is_instance_of_iconv_ostream (sstream1));
+ ASSERT (! is_instance_of_html_ostream (sstream1));
+ ASSERT (is_instance_of_term_styled_ostream (sstream1));
+ ASSERT (! is_instance_of_html_styled_ostream (sstream1));
+ ASSERT (! is_instance_of_noop_styled_ostream (sstream1));
+ }
+
+ if (sstream2 != NULL)
+ {
+ ASSERT (is_instance_of_styled_ostream (sstream2));
+ ASSERT (! is_instance_of_file_ostream (sstream2));
+ ASSERT (! is_instance_of_fd_ostream (sstream2));
+ ASSERT (! is_instance_of_term_ostream (sstream2));
+ ASSERT (! is_instance_of_memory_ostream (sstream2));
+ ASSERT (! is_instance_of_iconv_ostream (sstream2));
+ ASSERT (! is_instance_of_html_ostream (sstream2));
+ ASSERT (! is_instance_of_term_styled_ostream (sstream2));
+ ASSERT (is_instance_of_html_styled_ostream (sstream2));
+ ASSERT (! is_instance_of_noop_styled_ostream (sstream2));
+ }
+
+ if (sstream3 != NULL)
+ {
+ ASSERT (is_instance_of_styled_ostream (sstream3));
+ ASSERT (! is_instance_of_file_ostream (sstream3));
+ ASSERT (! is_instance_of_fd_ostream (sstream3));
+ ASSERT (! is_instance_of_term_ostream (sstream3));
+ ASSERT (! is_instance_of_memory_ostream (sstream3));
+ ASSERT (! is_instance_of_iconv_ostream (sstream3));
+ ASSERT (! is_instance_of_html_ostream (sstream3));
+ ASSERT (! is_instance_of_term_styled_ostream (sstream3));
+ ASSERT (! is_instance_of_html_styled_ostream (sstream3));
+ ASSERT (is_instance_of_noop_styled_ostream (sstream3));
+ }
+
+ return 0;
+}