Fabrique

A build language for complex systems

 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fabrique::Bytestream Class Referenceabstract

A ostream-like class that may support formatting. More...

#include <Bytestream.h>

Public Types

enum  Format {
  Action, Comment, Definition, Filename,
  Literal, Operator, Reference, Type,
  Error, Warning, Info, ErrorLoc,
  ErrorMessage, Column, Line, Reset
}
 Output formats that the bytestream may (optionally) support.
 

Public Member Functions

virtual Bytestreamoperator<< (enum Format)=0
 
virtual Bytestreamoperator<< (const Printable &)
 
virtual Bytestreamoperator<< (const std::string &)
 
virtual Bytestreamoperator<< (char)
 
virtual Bytestreamoperator<< (int)
 
virtual Bytestreamoperator<< (unsigned long)
 
std::ostream & raw ()
 

Static Public Member Functions

static BytestreamStdout ()
 
static BytestreamStderr ()
 
static BytestreamNone ()
 
static BytestreamDebug (const std::string &name)
 Retrieve the debug output stream or a do-nothing stream, based on the (hierarchical) debug naming scheme. More...
 
static void SetDebugPattern (const std::string &)
 
static void SetDebugStream (Bytestream &)
 
static BytestreamFormatted (std::ostream &)
 Construct a formatted fabrique::Bytestream to wrap an std::ostream. More...
 
static BytestreamPlain (std::ostream &)
 Construct a plain fabrique::Bytestream to wrap an std::ostream. More...
 

Protected Member Functions

 Bytestream (std::ostream &o)
 

Protected Attributes

std::ostream & out_
 

Detailed Description

A ostream-like class that may support formatting.

Definition at line 43 of file Bytestream.h.

Member Function Documentation

Bytestream & Bytestream::Debug ( const std::string &  name)
static

Retrieve the debug output stream or a do-nothing stream, based on the (hierarchical) debug naming scheme.

Fabrique runs with a debug pattern (that defaults to "") that is used to select how much debug output is actually output. For instance, if running with –debug=*, all names will match, whereas if running with –debug=parser (equivalent to parser.*), Debug("parser.foo") will return the debug stream but Debug("lexer.bar") will return the do-nothing stream.

Definition at line 181 of file Bytestream.cc.

Bytestream * Bytestream::Formatted ( std::ostream &  f)
static

Construct a formatted fabrique::Bytestream to wrap an std::ostream.

The caller is responsible for freeing the returned pointer.

Definition at line 202 of file Bytestream.cc.

Bytestream * Bytestream::Plain ( std::ostream &  f)
static

Construct a plain fabrique::Bytestream to wrap an std::ostream.

The caller is responsible for freeing the returned pointer.

Definition at line 207 of file Bytestream.cc.


The documentation for this class was generated from the following files: