NCBI C++ ToolKit
Macros | Functions | Variables
html.cpp File Reference
#include <ncbi_pch.hpp>
#include <html/html.hpp>
#include <html/htmlhelper.hpp>
#include <html/indentstream.hpp>
#include <html/html_exception.hpp>
#include <html/error_codes.hpp>
#include <errno.h>
#include <string.h>
+ Include dependency graph for html.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define NCBI_USE_ERRCODE_X   Html_Lib
 
#define INIT_STREAM_WRITE    errno = 0
 
#define CHECK_STREAM_WRITE(out)
 
#define PRINT_TMP_STR
 
#define DEFINE_HTML_ELEMENT(Tag)
 

Functions

static string s_GenerateNodeInternalName (const string &basename, const string &v1, const string &v2=kEmptyStr)
 
static SIZE_TYPE s_Find (const string &s, const char *target, SIZE_TYPE start=0)
 
static CHTML_table::TIndex x_GetSpan (const CHTML_tc *node, const string &attributeName)
 
static CHTML_table::TIndex x_NextSize (CHTML_table::TIndex size, CHTML_table::TIndex limit)
 
 CHTML_NAME (head)
 
const char CHTML_NAME(headCHTML_NAME (body)
 
const char CHTML_NAME(body) CHTML_NAME (base)
 
const char CHTML_NAME(base) CHTML_NAME (isindex)
 
const char CHTML_NAME(isindex) CHTML_NAME (link)
 
const char CHTML_NAME(link) CHTML_NAME (noscript)
 
const char CHTML_NAME(noscript) CHTML_NAME (object)
 
const char CHTML_NAME(object) CHTML_NAME (style)
 
const char CHTML_NAME(style) CHTML_NAME (title)
 
const char CHTML_NAME(title) CHTML_NAME (address)
 
const char CHTML_NAME(address) CHTML_NAME (blockquote)
 
const char CHTML_NAME(blockquote) CHTML_NAME (center)
 
const char CHTML_NAME(center) CHTML_NAME (div)
 
const char CHTML_NAME(div) CHTML_NAME (h1)
 
const char CHTML_NAME(h1) CHTML_NAME (h2)
 
const char CHTML_NAME(h2) CHTML_NAME (h3)
 
const char CHTML_NAME(h3) CHTML_NAME (h4)
 
const char CHTML_NAME(h4) CHTML_NAME (h5)
 
const char CHTML_NAME(h5) CHTML_NAME (h6)
 
const char CHTML_NAME(h6) CHTML_NAME (p)
 
const char CHTML_NAME(p) CHTML_NAME (pre)
 
const char CHTML_NAME(pre) CHTML_NAME (dt)
 
const char CHTML_NAME(dt) CHTML_NAME (dd)
 
const char CHTML_NAME(dd) CHTML_NAME (li)
 
const char CHTML_NAME(li) CHTML_NAME (caption)
 
const char CHTML_NAME(caption) CHTML_NAME (col)
 
const char CHTML_NAME(col) CHTML_NAME (colgroup)
 
const char CHTML_NAME(colgroup) CHTML_NAME (thead)
 
const char CHTML_NAME(thead) CHTML_NAME (tbody)
 
const char CHTML_NAME(tbody) CHTML_NAME (tfoot)
 
const char CHTML_NAME(tfoot) CHTML_NAME (th)
 
const char CHTML_NAME(thCHTML_NAME (td)
 
const char CHTML_NAME(tdCHTML_NAME (applet)
 
const char CHTML_NAME(applet) CHTML_NAME (param)
 
const char CHTML_NAME(param) CHTML_NAME (cite)
 
const char CHTML_NAME(cite) CHTML_NAME (code)
 
const char CHTML_NAME(codeCHTML_NAME (dfn)
 
const char CHTML_NAME(dfn) CHTML_NAME (em)
 
const char CHTML_NAME(em) CHTML_NAME (kbd)
 
const char CHTML_NAME(kbd) CHTML_NAME (samp)
 
const char CHTML_NAME(samp) CHTML_NAME (strike)
 
const char CHTML_NAME(strike) CHTML_NAME (strong)
 
const char CHTML_NAME(strong) CHTML_NAME (var)
 
const char CHTML_NAME(var) CHTML_NAME (b)
 
const char CHTML_NAME(bCHTML_NAME (big)
 
const char CHTML_NAME(big) CHTML_NAME (i)
 
const char CHTML_NAME(iCHTML_NAME (s)
 
const char CHTML_NAME(s) CHTML_NAME (small)
 
const char CHTML_NAME(small) CHTML_NAME (sub)
 
const char CHTML_NAME(sub) CHTML_NAME (sup)
 
const char CHTML_NAME(sup) CHTML_NAME (tt)
 
const char CHTML_NAME(tt) CHTML_NAME (u)
 
const char CHTML_NAME(u) CHTML_NAME (blink)
 
const char CHTML_NAME(blink) CHTML_NAME (span)
 

Variables

const char * kTagStart = "<@"
 Tag delimiters. More...
 
const char * kTagEnd = "@>"
 Tag end. More...
 
const SIZE_TYPE kTagStartLen = 2
 

Macro Definition Documentation

◆ CHECK_STREAM_WRITE

#define CHECK_STREAM_WRITE (   out)
Value:
if ( !out ) { \
int x_errno = errno; \
string x_err("write to stream failed"); \
if (x_errno != 0) { \
const char* x_strerror = strerror(x_errno); \
if ( !x_strerror ) { \
x_strerror = "Error code is out of range"; \
} \
string x_strerrno = NStr::IntToString(x_errno); \
x_err += " {errno=" + x_strerrno + ',' + x_strerror + '}'; \
} \
NCBI_THROW(CHTMLException, eWrite, x_err); \
}
CHTMLException –.
std::ofstream out("events_result.xml")
main entry point for tests
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
char * strerror(int n)
Definition: pcregrep.c:835

Definition at line 55 of file html.cpp.

◆ DEFINE_HTML_ELEMENT

#define DEFINE_HTML_ELEMENT (   Tag)
Value:
{ \
} \
const char CHTML_NAME(Tag)::sm_TagName[] = #Tag
string Tag(const string &name, int value)
CHTML_NAME(head)
Definition: html.cpp:2279

Definition at line 2272 of file html.cpp.

◆ INIT_STREAM_WRITE

#define INIT_STREAM_WRITE    errno = 0

Definition at line 52 of file html.cpp.

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Html_Lib

Definition at line 40 of file html.cpp.

◆ PRINT_TMP_STR

#define PRINT_TMP_STR
Value:
if ( enable_buffering ) { \
pstr->write(tmp.data(), tmp.size()); \
} else { \
PrintString(out, mode, tmp); \
}
static char tmp[3200]
Definition: utf8.c:42
mdb_mode_t mode
Definition: lmdb++.h:38

Definition at line 345 of file html.cpp.

Function Documentation

◆ CHTML_NAME() [1/54]

const char CHTML_NAME ( title ) CHTML_NAME ( address  )

Definition at line 2288 of file html.cpp.

◆ CHTML_NAME() [2/54]

const char CHTML_NAME ( td ) CHTML_NAME ( applet  )

Definition at line 2311 of file html.cpp.

◆ CHTML_NAME() [3/54]

const char CHTML_NAME ( var ) CHTML_NAME ( b  )

Definition at line 2322 of file html.cpp.

◆ CHTML_NAME() [4/54]

const char CHTML_NAME ( body ) CHTML_NAME ( base  )

Definition at line 2281 of file html.cpp.

◆ CHTML_NAME() [5/54]

const char CHTML_NAME ( b ) CHTML_NAME ( big  )

Definition at line 2323 of file html.cpp.

◆ CHTML_NAME() [6/54]

const char CHTML_NAME ( u ) CHTML_NAME ( blink  )

Definition at line 2331 of file html.cpp.

◆ CHTML_NAME() [7/54]

const char CHTML_NAME ( address ) CHTML_NAME ( blockquote  )

Definition at line 2289 of file html.cpp.

◆ CHTML_NAME() [8/54]

const char CHTML_NAME ( head ) CHTML_NAME ( body  )

Definition at line 2280 of file html.cpp.

◆ CHTML_NAME() [9/54]

const char CHTML_NAME ( li ) CHTML_NAME ( caption  )

Definition at line 2303 of file html.cpp.

◆ CHTML_NAME() [10/54]

const char CHTML_NAME ( blockquote ) CHTML_NAME ( center  )

Definition at line 2290 of file html.cpp.

◆ CHTML_NAME() [11/54]

const char CHTML_NAME ( param ) CHTML_NAME ( cite  )

Definition at line 2313 of file html.cpp.

◆ CHTML_NAME() [12/54]

const char CHTML_NAME ( cite ) CHTML_NAME ( code  )

Definition at line 2314 of file html.cpp.

◆ CHTML_NAME() [13/54]

const char CHTML_NAME ( caption ) CHTML_NAME ( col  )

Definition at line 2304 of file html.cpp.

◆ CHTML_NAME() [14/54]

const char CHTML_NAME ( col ) CHTML_NAME ( colgroup  )

Definition at line 2305 of file html.cpp.

◆ CHTML_NAME() [15/54]

const char CHTML_NAME ( dt ) CHTML_NAME ( dd  )

Definition at line 2301 of file html.cpp.

◆ CHTML_NAME() [16/54]

const char CHTML_NAME ( code ) CHTML_NAME ( dfn  )

Definition at line 2315 of file html.cpp.

◆ CHTML_NAME() [17/54]

const char CHTML_NAME ( center ) CHTML_NAME ( div  )

Definition at line 2291 of file html.cpp.

◆ CHTML_NAME() [18/54]

const char CHTML_NAME ( pre ) CHTML_NAME ( dt  )

Definition at line 2300 of file html.cpp.

◆ CHTML_NAME() [19/54]

const char CHTML_NAME ( dfn ) CHTML_NAME ( em  )

Definition at line 2316 of file html.cpp.

◆ CHTML_NAME() [20/54]

const char CHTML_NAME ( div ) CHTML_NAME ( h1  )

Definition at line 2292 of file html.cpp.

◆ CHTML_NAME() [21/54]

const char CHTML_NAME ( h1 ) CHTML_NAME ( h2  )

Definition at line 2293 of file html.cpp.

◆ CHTML_NAME() [22/54]

const char CHTML_NAME ( h2 ) CHTML_NAME ( h3  )

Definition at line 2294 of file html.cpp.

◆ CHTML_NAME() [23/54]

const char CHTML_NAME ( h3 ) CHTML_NAME ( h4  )

Definition at line 2295 of file html.cpp.

◆ CHTML_NAME() [24/54]

const char CHTML_NAME ( h4 ) CHTML_NAME ( h5  )

Definition at line 2296 of file html.cpp.

◆ CHTML_NAME() [25/54]

const char CHTML_NAME ( h5 ) CHTML_NAME ( h6  )

Definition at line 2297 of file html.cpp.

◆ CHTML_NAME() [26/54]

CHTML_NAME ( head  )

Definition at line 2279 of file html.cpp.

◆ CHTML_NAME() [27/54]

const char CHTML_NAME ( big ) CHTML_NAME ( i  )

Definition at line 2324 of file html.cpp.

◆ CHTML_NAME() [28/54]

const char CHTML_NAME ( base ) CHTML_NAME ( isindex  )

Definition at line 2282 of file html.cpp.

◆ CHTML_NAME() [29/54]

const char CHTML_NAME ( em ) CHTML_NAME ( kbd  )

Definition at line 2317 of file html.cpp.

◆ CHTML_NAME() [30/54]

const char CHTML_NAME ( dd ) CHTML_NAME ( li  )

Definition at line 2302 of file html.cpp.

◆ CHTML_NAME() [31/54]

const char CHTML_NAME ( isindex ) CHTML_NAME ( link  )

Definition at line 2283 of file html.cpp.

◆ CHTML_NAME() [32/54]

const char CHTML_NAME ( link ) CHTML_NAME ( noscript  )

Definition at line 2284 of file html.cpp.

◆ CHTML_NAME() [33/54]

const char CHTML_NAME ( noscript ) CHTML_NAME ( object  )

Definition at line 2285 of file html.cpp.

◆ CHTML_NAME() [34/54]

const char CHTML_NAME ( h6 ) CHTML_NAME ( )

Definition at line 2298 of file html.cpp.

◆ CHTML_NAME() [35/54]

const char CHTML_NAME ( applet ) CHTML_NAME ( param  )

Definition at line 2312 of file html.cpp.

◆ CHTML_NAME() [36/54]

const char CHTML_NAME ( p ) CHTML_NAME ( pre  )

Definition at line 2299 of file html.cpp.

◆ CHTML_NAME() [37/54]

const char CHTML_NAME ( i ) CHTML_NAME ( )

Definition at line 2325 of file html.cpp.

◆ CHTML_NAME() [38/54]

const char CHTML_NAME ( kbd ) CHTML_NAME ( samp  )

Definition at line 2318 of file html.cpp.

◆ CHTML_NAME() [39/54]

const char CHTML_NAME ( s ) CHTML_NAME ( small  )

Definition at line 2326 of file html.cpp.

◆ CHTML_NAME() [40/54]

const char CHTML_NAME ( blink ) CHTML_NAME ( span  )

Definition at line 2332 of file html.cpp.

◆ CHTML_NAME() [41/54]

const char CHTML_NAME ( samp ) CHTML_NAME ( strike  )

Definition at line 2319 of file html.cpp.

◆ CHTML_NAME() [42/54]

const char CHTML_NAME ( strike ) CHTML_NAME ( strong  )

Definition at line 2320 of file html.cpp.

◆ CHTML_NAME() [43/54]

const char CHTML_NAME ( object ) CHTML_NAME ( style  )

Definition at line 2286 of file html.cpp.

◆ CHTML_NAME() [44/54]

const char CHTML_NAME ( small ) CHTML_NAME ( sub  )

Definition at line 2327 of file html.cpp.

◆ CHTML_NAME() [45/54]

const char CHTML_NAME ( sub ) CHTML_NAME ( sup  )

Definition at line 2328 of file html.cpp.

◆ CHTML_NAME() [46/54]

const char CHTML_NAME ( thead ) CHTML_NAME ( tbody  )

Definition at line 2307 of file html.cpp.

◆ CHTML_NAME() [47/54]

const char CHTML_NAME ( th ) CHTML_NAME ( td  )

Definition at line 2310 of file html.cpp.

◆ CHTML_NAME() [48/54]

const char CHTML_NAME ( tbody ) CHTML_NAME ( tfoot  )

Definition at line 2308 of file html.cpp.

◆ CHTML_NAME() [49/54]

const char CHTML_NAME ( tfoot ) CHTML_NAME ( th  )

Definition at line 2309 of file html.cpp.

◆ CHTML_NAME() [50/54]

const char CHTML_NAME ( colgroup ) CHTML_NAME ( thead  )

Definition at line 2306 of file html.cpp.

◆ CHTML_NAME() [51/54]

const char CHTML_NAME ( style ) CHTML_NAME ( title  )

Definition at line 2287 of file html.cpp.

◆ CHTML_NAME() [52/54]

const char CHTML_NAME ( sup ) CHTML_NAME ( tt  )

Definition at line 2329 of file html.cpp.

◆ CHTML_NAME() [53/54]

const char CHTML_NAME ( tt ) CHTML_NAME ( )

Definition at line 2330 of file html.cpp.

◆ CHTML_NAME() [54/54]

const char CHTML_NAME ( strong ) CHTML_NAME ( var  )

Definition at line 2321 of file html.cpp.

◆ s_Find()

static SIZE_TYPE s_Find ( const string s,
const char *  target,
SIZE_TYPE  start = 0 
)
static

Definition at line 87 of file html.cpp.

References NPOS.

Referenced by CHTMLText::PrintBegin(), and CHTMLOpenElement::x_PrintBegin().

◆ s_GenerateNodeInternalName()

static string s_GenerateNodeInternalName ( const string basename,
const string v1,
const string v2 = kEmptyStr 
)
static

Definition at line 71 of file html.cpp.

References basename, and v2.

◆ x_GetSpan()

static CHTML_table::TIndex x_GetSpan ( const CHTML_tc node,
const string attributeName 
)
static

Definition at line 896 of file html.cpp.

Referenced by CHTML_table_Cache::GetCellNode().

◆ x_NextSize()

static CHTML_table::TIndex x_NextSize ( CHTML_table::TIndex  size,
CHTML_table::TIndex  limit 
)
static

Definition at line 949 of file html.cpp.

Variable Documentation

◆ kTagEnd

const char* kTagEnd = "@>"

Tag end.

Definition at line 48 of file html.cpp.

Referenced by CHTMLText::PrintBegin(), and CHTMLPage::x_LoadTemplateLib().

◆ kTagStart

const char* kTagStart = "<@"

Tag delimiters.

Tag start

Definition at line 47 of file html.cpp.

Referenced by CHTMLText::PrintBegin(), CHTMLPage::x_LoadTemplateLib(), and CHTMLOpenElement::x_PrintBegin().

◆ kTagStartLen

const SIZE_TYPE kTagStartLen = 2

Definition at line 49 of file html.cpp.

Referenced by CHTMLText::PrintBegin().

Modified on Sat May 25 14:22:59 2024 by modify_doxy.py rev. 669887