Blame gettext-tools/gnulib-lib/styled-ostream.h

Packit Bot 06c835
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
Packit Bot 06c835
Packit Bot 06c835
#line 1 "styled-ostream.oo.h"
Packit Bot 06c835
/* Abstract output stream for CSS styled text.
Packit Bot 06c835
   Copyright (C) 2006, 2015 Free Software Foundation, Inc.
Packit Bot 06c835
   Written by Bruno Haible <bruno@clisp.org>, 2006.
Packit Bot 06c835
Packit Bot 06c835
   This program is free software: you can redistribute it and/or modify
Packit Bot 06c835
   it under the terms of the GNU General Public License as published by
Packit Bot 06c835
   the Free Software Foundation; either version 3 of the License, or
Packit Bot 06c835
   (at your option) any later version.
Packit Bot 06c835
Packit Bot 06c835
   This program is distributed in the hope that it will be useful,
Packit Bot 06c835
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 06c835
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Bot 06c835
   GNU General Public License for more details.
Packit Bot 06c835
Packit Bot 06c835
   You should have received a copy of the GNU General Public License
Packit Bot 06c835
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Bot 06c835
Packit Bot 06c835
#ifndef _STYLED_OSTREAM_H
Packit Bot 06c835
#define _STYLED_OSTREAM_H
Packit Bot 06c835
Packit Bot 06c835
#include "ostream.h"
Packit Bot 06c835
Packit Bot 06c835
Packit Bot 06c835
/* A styled output stream is an object to which one can feed a sequence of
Packit Bot 06c835
   bytes, marking some runs of text as belonging to specific CSS classes,
Packit Bot 06c835
   where the rendering of the CSS classes is defined through a CSS (cascading
Packit Bot 06c835
   style sheet).  */
Packit Bot 06c835
Packit Bot 06c835
#line 33 "styled-ostream.h"
Packit Bot 06c835
struct styled_ostream_representation;
Packit Bot 06c835
/* styled_ostream_t is defined as a pointer to struct styled_ostream_representation.
Packit Bot 06c835
   In C++ mode, we use a smart pointer class.
Packit Bot 06c835
   In C mode, we have no other choice than a typedef to the root class type.  */
Packit Bot 06c835
#if IS_CPLUSPLUS
Packit Bot 06c835
struct styled_ostream_t
Packit Bot 06c835
{
Packit Bot 06c835
private:
Packit Bot 06c835
  struct styled_ostream_representation *_pointer;
Packit Bot 06c835
public:
Packit Bot 06c835
  styled_ostream_t () : _pointer (NULL) {}
Packit Bot 06c835
  styled_ostream_t (struct styled_ostream_representation *pointer) : _pointer (pointer) {}
Packit Bot 06c835
  struct styled_ostream_representation * operator -> () { return _pointer; }
Packit Bot 06c835
  operator struct styled_ostream_representation * () { return _pointer; }
Packit Bot 06c835
  operator struct any_ostream_representation * () { return (struct any_ostream_representation *) _pointer; }
Packit Bot 06c835
  operator void * () { return _pointer; }
Packit Bot 06c835
  bool operator == (const void *p) { return _pointer == p; }
Packit Bot 06c835
  bool operator != (const void *p) { return _pointer != p; }
Packit Bot 06c835
  operator ostream_t () { return (ostream_t) (struct any_ostream_representation *) _pointer; }
Packit Bot 06c835
  explicit styled_ostream_t (ostream_t x) : _pointer ((struct styled_ostream_representation *) (void *) x) {}
Packit Bot 06c835
};
Packit Bot 06c835
#else
Packit Bot 06c835
typedef ostream_t styled_ostream_t;
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
/* Functions that invoke the methods.  */
Packit Bot 06c835
extern        void styled_ostream_write_mem (styled_ostream_t first_arg, const void *data, size_t len);
Packit Bot 06c835
extern         void styled_ostream_flush (styled_ostream_t first_arg);
Packit Bot 06c835
extern         void styled_ostream_free (styled_ostream_t first_arg);
Packit Bot 06c835
extern          void styled_ostream_begin_use_class (styled_ostream_t first_arg, const char *classname);
Packit Bot 06c835
extern          void styled_ostream_end_use_class (styled_ostream_t first_arg, const char *classname);
Packit Bot 06c835
Packit Bot 06c835
/* Type representing an implementation of styled_ostream_t.  */
Packit Bot 06c835
struct styled_ostream_implementation
Packit Bot 06c835
{
Packit Bot 06c835
  const typeinfo_t * const *superclasses;
Packit Bot 06c835
  size_t superclasses_length;
Packit Bot 06c835
  size_t instance_size;
Packit Bot 06c835
#define THIS_ARG styled_ostream_t first_arg
Packit Bot 06c835
#include "styled_ostream.vt.h"
Packit Bot 06c835
#undef THIS_ARG
Packit Bot 06c835
};
Packit Bot 06c835
Packit Bot 06c835
/* Public portion of the object pointed to by a styled_ostream_t.  */
Packit Bot 06c835
struct styled_ostream_representation_header
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable;
Packit Bot 06c835
};
Packit Bot 06c835
Packit Bot 06c835
#if HAVE_INLINE
Packit Bot 06c835
Packit Bot 06c835
/* Define the functions that invoke the methods as inline accesses to
Packit Bot 06c835
   the styled_ostream_implementation.
Packit Bot 06c835
   Use #define to avoid a warning because of extern vs. static.  */
Packit Bot 06c835
Packit Bot 06c835
# define styled_ostream_write_mem styled_ostream_write_mem_inline
Packit Bot 06c835
static inline void
Packit Bot 06c835
styled_ostream_write_mem (styled_ostream_t first_arg, const void *data, size_t len)
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable =
Packit Bot 06c835
    ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable;
Packit Bot 06c835
  vtable->write_mem (first_arg,data,len);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
# define styled_ostream_flush styled_ostream_flush_inline
Packit Bot 06c835
static inline void
Packit Bot 06c835
styled_ostream_flush (styled_ostream_t first_arg)
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable =
Packit Bot 06c835
    ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable;
Packit Bot 06c835
  vtable->flush (first_arg);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
# define styled_ostream_free styled_ostream_free_inline
Packit Bot 06c835
static inline void
Packit Bot 06c835
styled_ostream_free (styled_ostream_t first_arg)
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable =
Packit Bot 06c835
    ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable;
Packit Bot 06c835
  vtable->free (first_arg);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
# define styled_ostream_begin_use_class styled_ostream_begin_use_class_inline
Packit Bot 06c835
static inline void
Packit Bot 06c835
styled_ostream_begin_use_class (styled_ostream_t first_arg, const char *classname)
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable =
Packit Bot 06c835
    ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable;
Packit Bot 06c835
  vtable->begin_use_class (first_arg,classname);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
# define styled_ostream_end_use_class styled_ostream_end_use_class_inline
Packit Bot 06c835
static inline void
Packit Bot 06c835
styled_ostream_end_use_class (styled_ostream_t first_arg, const char *classname)
Packit Bot 06c835
{
Packit Bot 06c835
  const struct styled_ostream_implementation *vtable =
Packit Bot 06c835
    ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable;
Packit Bot 06c835
  vtable->end_use_class (first_arg,classname);
Packit Bot 06c835
}
Packit Bot 06c835
Packit Bot 06c835
#endif
Packit Bot 06c835
Packit Bot 06c835
extern DLL_VARIABLE const typeinfo_t styled_ostream_typeinfo;
Packit Bot 06c835
#define styled_ostream_SUPERCLASSES &styled_ostream_typeinfo, ostream_SUPERCLASSES
Packit Bot 06c835
#define styled_ostream_SUPERCLASSES_LENGTH (1 + ostream_SUPERCLASSES_LENGTH)
Packit Bot 06c835
Packit Bot 06c835
extern DLL_VARIABLE const struct styled_ostream_implementation styled_ostream_vtable;
Packit Bot 06c835
Packit Bot 06c835
#line 42 "styled-ostream.oo.h"
Packit Bot 06c835
Packit Bot 06c835
Packit Bot 06c835
#endif /* _STYLED_OSTREAM_H */