Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Atlfast::HeaderPrinter Class Reference

Print maker headers to log file. More...

#include <HeaderPrinter.h>

Collaboration diagram for Atlfast::HeaderPrinter:

Collaboration graph
[legend]
List of all members.

Public Methods

 HeaderPrinter (string title, MsgStream &log)
void add (const string &, std::vector< int >::const_iterator be, std::vector< int >::const_iterator en)
void add (const string &, int)
void add (const string &, double)
void add (const string &, const string &t)
void add (const string &, bool)
void add (const string &)
void print () const

Static Public Attributes

unsigned int width
string m_fullLine

Private Attributes

string m_title
MsgStream & m_log
std::vector< string > m_strings
string m_hollowLine

Detailed Description

Print maker headers to log file.

Definition at line 33 of file HeaderPrinter.h.


Constructor & Destructor Documentation

Atlfast::HeaderPrinter::HeaderPrinter string    title,
MsgStream &    log
 

Definition at line 16 of file HeaderPrinter.cxx.

References m_hollowLine, m_title, and width.

00016                                                           : 
00017     m_title(title), m_log(log){
00018 
00019     //    const unsigned int width = 80;
00020     //    string fullLine(width, '=');
00021     m_hollowLine+=string(1u,'|');
00022     m_hollowLine+=string(width-2,' ');
00023     m_hollowLine+=string(1u,'|');
00024     int nBlanks =width-m_title.size()-2;
00025     if(nBlanks>0){
00026       unsigned int lBlanks = (nBlanks%2==0)? nBlanks/2:1+nBlanks/2;
00027       unsigned int rBlanks = nBlanks/2;
00028       m_title=
00029         string(1u,'|')
00030         +string(lBlanks,' ')
00031         +m_title
00032         +string(rBlanks,' ')
00033         +string(1u,'|');
00034     }
00035   }

Member Function Documentation

void Atlfast::HeaderPrinter::add const string &   ,
std::vector< int >::const_iterator    be,
std::vector< int >::const_iterator    en
 

Definition at line 37 of file HeaderPrinter.cxx.

References m_strings.

00039                                                           {
00040     ostrstream sout;
00041     sout<<s;
00042     for(; it !=en; ++it){
00043       sout<<" "<<*it;
00044     }
00045     sout<<ends;
00046     m_strings.push_back(sout.str());
00047   }

void Atlfast::HeaderPrinter::add const string &   ,
int   
 

Definition at line 49 of file HeaderPrinter.cxx.

References m_strings.

00049                                                {
00050     ostrstream sout;
00051     sout<<s<<" "<<i<<ends;
00052     m_strings.push_back(sout.str());
00053   }

void Atlfast::HeaderPrinter::add const string &   ,
double   
 

Definition at line 55 of file HeaderPrinter.cxx.

References m_strings.

00055                                                   {
00056     ostrstream sout;
00057     sout<<s<<" "<<i<<ends;
00058     m_strings.push_back(sout.str());
00059   }

void Atlfast::HeaderPrinter::add const string &   ,
const string &    t
 

Definition at line 61 of file HeaderPrinter.cxx.

References m_strings.

00061                                                            {
00062     string temp = s1+" "+s2;
00063     m_strings.push_back(temp);
00064   }

void Atlfast::HeaderPrinter::add const string &   ,
bool   
 

Definition at line 65 of file HeaderPrinter.cxx.

References m_strings.

00065                                                 {
00066     string temp = s+" ";
00067     temp +=  b? "true":"false";
00068     m_strings.push_back(temp);
00069   }

void Atlfast::HeaderPrinter::add const string &   
 

Definition at line 70 of file HeaderPrinter.cxx.

References m_strings.

00070                                         {
00071     m_strings.push_back(s);
00072   }

void Atlfast::HeaderPrinter::print   const
 

Definition at line 73 of file HeaderPrinter.cxx.

00073                                 {
00074     
00075     cout<<m_fullLine<<endl;
00076     cout<<m_hollowLine<<endl;
00077     cout<<m_title<<endl;
00078     cout<<m_hollowLine<<endl;
00079     std::vector<string>::const_iterator it = m_strings.begin();
00080     std::vector<string>::const_iterator en = m_strings.end();
00081 
00082     for(;it!=en; ++it){
00083       string temp = *it;
00084       if(temp.size()<width-2){
00085         temp = string(1u,'|')+string(1u,' ')+temp;
00086       }
00087       while(temp.size()<width-1){
00088         temp += string(1u,' ');
00089       }
00090       temp += string(1u,'|');
00091       cout<<temp<<endl;
00092     }   
00093     cout<<m_hollowLine<<endl;
00094     cout<<m_fullLine<<endl;
00095     cout<<endl<<endl;
00096     return;
00097   }

Member Data Documentation

unsigned int Atlfast::HeaderPrinter::width [static]
 

Referenced by HeaderPrinter().

string Atlfast::HeaderPrinter::m_fullLine [static]
 

string Atlfast::HeaderPrinter::m_title [private]
 

Definition at line 49 of file HeaderPrinter.h.

Referenced by HeaderPrinter().

MsgStream& Atlfast::HeaderPrinter::m_log [private]
 

Definition at line 50 of file HeaderPrinter.h.

std::vector<string> Atlfast::HeaderPrinter::m_strings [private]
 

Definition at line 51 of file HeaderPrinter.h.

Referenced by add().

string Atlfast::HeaderPrinter::m_hollowLine [private]
 

Definition at line 52 of file HeaderPrinter.h.

Referenced by HeaderPrinter().


The documentation for this class was generated from the following files:
Generated on Wed Jan 15 11:00:34 2003 for AtlfastUtils by doxygen1.3-rc1