CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
Classes | Enumerations | Functions
cccc_htm.h File Reference
#include "cccc.h"
#include <fstream>
#include <time.h>
#include "cccc_db.h"
#include "cccc_met.h"
Include dependency graph for cccc_htm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CCCC_Html_Stream
 
class  Source_Anchor
 

Enumerations

enum  ReportType {
  rtCONTENTS =0x0001, rtSUMMARY =0x0002, rtOODESIGN =0x0004, rtPROC1 =0x0010,
  rtPROC2 =0x0020, rtSTRUCT1 =0x0040, rtSTRUCT2 =0x0080, rtOTHER =0x0100,
  rtSEPARATE_MODULES =0x0200, rtSOURCE =0x0400, rtSHOW_GEN_TIME =0x800, rtCCCC =0x8000
}
 

Functions

CCCC_Html_Streamoperator<< (CCCC_Html_Stream &os, const string &stg)
 
CCCC_Html_Streamoperator<< (CCCC_Html_Stream &os, const CCCC_Metric &mtc)
 
CCCC_Html_Streamoperator<< (CCCC_Html_Stream &os, const CCCC_Extent &ext)
 

Enumeration Type Documentation

enum ReportType
Enumerator
rtCONTENTS 
rtSUMMARY 
rtOODESIGN 
rtPROC1 
rtPROC2 
rtSTRUCT1 
rtSTRUCT2 
rtOTHER 
rtSEPARATE_MODULES 
rtSOURCE 
rtSHOW_GEN_TIME 
rtCCCC 

Definition at line 31 of file cccc_htm.h.

31  {
32  rtCONTENTS=0x0001, rtSUMMARY=0x0002,
33  rtOODESIGN=0x0004,
34  rtPROC1=0x0010, rtPROC2=0x0020,
35  rtSTRUCT1=0x0040, rtSTRUCT2=0x0080,
36  rtOTHER=0x0100,
37  rtSEPARATE_MODULES=0x0200,
38  rtSOURCE=0x0400,
39  rtSHOW_GEN_TIME=0x800,
40  rtCCCC=0x8000
41 };

Function Documentation

CCCC_Html_Stream& operator<< ( CCCC_Html_Stream os,
const string &  stg 
)

Definition at line 997 of file cccc_htm.cc.

998 {
999  // initialise a character pointer to the start of the string's buffer
1000  const char *cptr=stg.c_str();
1001  while(*cptr!='\000') {
1002  char c=*cptr;
1003 
1004  // the purpose of this is to filter out the characters which
1005  // must be escaped in HTML
1006  switch(c) {
1007  case '>': os.fstr << "&gt;" ; break;
1008  case '<': os.fstr << "&lt;" ; break;
1009  case '&': os.fstr << "&amp;"; break;
1010  // commas and parentheses do not need to be escaped, but
1011  // we want to allow line breaking just inside
1012  // parameter lists and after commas
1013  // we insert a non-breaking space to guarantee a small indent
1014  // on the new line, and one before the right parenthesis for
1015  // symmetry
1016  case ',': os.fstr << ", &nbsp;" ; break;
1017  case '(': os.fstr << "( &nbsp;" ; break;
1018  case ')': os.fstr << "&nbsp;)" ; break;
1019  default : os.fstr << c;
1020  }
1021  cptr++;
1022  }
1023  return os;
1024 }
ofstream fstr
Definition: cccc_htm.h:50
CCCC_Html_Stream& operator<< ( CCCC_Html_Stream os,
const CCCC_Metric mtc 
)

Definition at line 1026 of file cccc_htm.cc.

1027 {
1028  const char *emphasis_prefix[]={"","<EM>","<STRONG>"};
1029  const char *emphasis_suffix[]={"","</EM>","</STRONG>"};
1030 
1031  // by writing to the underlying ostream object, we avoid the escape
1032  // functionality
1033  os.fstr << emphasis_prefix[mtc.emphasis_level()]
1034  << mtc.value_string()
1035  << emphasis_suffix[mtc.emphasis_level()];
1036  return os;
1037 }
EmphasisLevel emphasis_level() const
Definition: cccc_met.cc:85
string value_string() const
Definition: cccc_met.cc:116
ofstream fstr
Definition: cccc_htm.h:50

Here is the call graph for this function:

CCCC_Html_Stream& operator<< ( CCCC_Html_Stream os,
const CCCC_Extent ext 
)