CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
Typedefs | Functions | Variables
cccc_htm.cc File Reference
#include "cccc.h"
#include "cccc_itm.h"
#include "cccc_htm.h"
#include <unistd.h>
#include <time.h>
#include <sys/stat.h>
#include "cccc_utl.h"
Include dependency graph for cccc_htm.cc:

Go to the source code of this file.

Typedefs

typedef std::map< string, Source_Anchorsource_anchor_map_t
 

Functions

CCCC_Html_Streamoperator<< (CCCC_Html_Stream &os, const string &stg)
 
CCCC_Html_Streamoperator<< (CCCC_Html_Stream &os, const CCCC_Metric &mtc)
 
int setup_anchor_data ()
 
static string pad_string (int target_width, string the_string, string padding)
 

Variables

source_anchor_map_t source_anchor_map
 

Typedef Documentation

typedef std::map<string,Source_Anchor> source_anchor_map_t

Definition at line 46 of file cccc_htm.cc.

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:

static string pad_string ( int  target_width,
string  the_string,
string  padding 
)
static

Definition at line 1463 of file cccc_htm.cc.

1464 {
1465  int spaces_required=target_width-the_string.size();
1466  string pad_string;
1467  while(spaces_required>0)
1468  {
1469  pad_string+=padding;
1470  spaces_required--;
1471  }
1472  return pad_string+the_string;
1473 }
static string pad_string(int target_width, string the_string, string padding)
Definition: cccc_htm.cc:1463

Here is the caller graph for this function:

int setup_anchor_data ( )

Definition at line 1365 of file cccc_htm.cc.

1366 {
1367  int i=0;
1368  Source_Anchor a1("cccc_use.h",12);
1369  Source_Anchor a2("cccc_htm.h",15);
1370  i++;
1371  string key1=a1.key(), key2=a2.key();
1372  i++;
1373  source_anchor_map_t::value_type v1(key1,a1);
1374  source_anchor_map_t::value_type v2(key2,a2);
1375  i++;
1376  source_anchor_map.insert(v1);
1377  source_anchor_map.insert(v2);
1378  return i;
1379 }
source_anchor_map_t source_anchor_map
Definition: cccc_htm.cc:47

Here is the call graph for this function:

Variable Documentation

source_anchor_map_t source_anchor_map

Definition at line 47 of file cccc_htm.cc.