DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Private Member Functions
DGtal::TraceWriterTerm Class Reference

#include <TraceWriterTerm.h>

Inheritance diagram for DGtal::TraceWriterTerm:
Inheritance graph
[legend]
Collaboration diagram for DGtal::TraceWriterTerm:
Collaboration graph
[legend]

Public Member Functions

 TraceWriterTerm (std::ostream &aoutputStream=std::cerr)
 ~TraceWriterTerm ()
void selfDisplay (std::ostream &out) const
bool isValid () const
std::string prefixWarning ()
std::string prefixInfo ()
std::string prefixError ()
std::string prefixEmphase ()
std::string postfixReset ()
- Public Member Functions inherited from DGtal::TraceWriter
std::ostream & outputStream ()

Private Member Functions

 TraceWriterTerm (const TraceWriterTerm &other)
TraceWriterTermoperator= (const TraceWriterTerm &other)

Additional Inherited Members

- Protected Member Functions inherited from DGtal::TraceWriter
 TraceWriter (std::ostream &aoutputStream)
- Protected Attributes inherited from DGtal::TraceWriter
std::ostream & myOutputStream

Detailed Description

Implements trace prefix for color terminals.

Description of class 'TraceWriterTerm'

Aim:

Todo:
Detect if the terminal has color capabilities
See also:
testTrace.cpp

Definition at line 62 of file TraceWriterTerm.h.


Constructor & Destructor Documentation

DGtal::TraceWriterTerm::TraceWriterTerm ( std::ostream &  aoutputStream = std::cerr)
inline

Constructor.

Parameters:
outputStreamthe current output Stream

Definition at line 71 of file TraceWriterTerm.h.

: TraceWriter(aoutputStream) {};
DGtal::TraceWriterTerm::~TraceWriterTerm ( )
inline

Destructor.

Definition at line 77 of file TraceWriterTerm.h.

{};
DGtal::TraceWriterTerm::TraceWriterTerm ( const TraceWriterTerm other)
private

Copy constructor.

Parameters:
otherthe object to clone. Forbidden by default.

Member Function Documentation

bool DGtal::TraceWriterTerm::isValid ( ) const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Reimplemented from DGtal::TraceWriter.

TraceWriterTerm& DGtal::TraceWriterTerm::operator= ( const TraceWriterTerm other)
private

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'. Forbidden by default.
std::string DGtal::TraceWriterTerm::postfixReset ( )
inlinevirtual

Create a Reset postfix

Returns:
the postfix

Implements DGtal::TraceWriter.

Definition at line 152 of file TraceWriterTerm.h.

{
#if ( (defined(UNIX)||defined(unix)||defined(linux)) )
return "\033[0m";
#else
return "";
#endif
}
std::string DGtal::TraceWriterTerm::prefixEmphase ( )
inlinevirtual

Create an Emphase Prefix

Returns:
the prefix

Implements DGtal::TraceWriter.

Definition at line 139 of file TraceWriterTerm.h.

{
#if ( (defined(UNIX)||defined(unix)||defined(linux)) )
return "\033[0m\033[1m";
#else
return "";
#endif
}
std::string DGtal::TraceWriterTerm::prefixError ( )
inlinevirtual

Create an Error Prefix

Returns:
the prefix

Implements DGtal::TraceWriter.

Definition at line 126 of file TraceWriterTerm.h.

{
#if ( (defined(UNIX)||defined(unix)||defined(linux)) )
return "\033[0m\033[31m[ERR]";
#else
return "";
#endif
}
std::string DGtal::TraceWriterTerm::prefixInfo ( )
inlinevirtual

Create an Info Prefix

Returns:
the prefix

Implements DGtal::TraceWriter.

Definition at line 113 of file TraceWriterTerm.h.

{
#if ( (defined(UNIX)||defined(unix)||defined(linux)) )
return "\033[0m";
#else
return "";
#endif
}
std::string DGtal::TraceWriterTerm::prefixWarning ( )
inlinevirtual

Create a Wrarning Prefix

Returns:
the prefix

Implements DGtal::TraceWriter.

Definition at line 100 of file TraceWriterTerm.h.

{
#if ( (defined(UNIX)||defined(unix)||defined(linux)) )
return "\033[0m\033[35m";
#else
return "";
#endif
}
void DGtal::TraceWriterTerm::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Reimplemented from DGtal::TraceWriter.


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