40 #define NCBI_USE_ERRCODE_X Html_Lib
52 #define INIT_STREAM_WRITE \
55 #define CHECK_STREAM_WRITE(out) \
57 int x_errno = errno; \
58 string x_err("write to stream failed"); \
60 const char* x_strerror = strerror(x_errno); \
61 if ( !x_strerror ) { \
62 x_strerror = "Error code is out of range"; \
64 string x_strerrno = NStr::IntToString(x_errno); \
65 x_err += " {errno=" + x_strerrno + ',' + x_strerror + '}'; \
67 NCBI_THROW(CHTMLException, eWrite, x_err); \
77 name +=
"(\"" + v1.substr(0,10) +
"\"";
79 name +=
"|\"" +
v2.substr(0,10) +
"\"";
93 if ( start >= s.size() ) {
96 const char* cstr = s.c_str();
97 const char* p = strstr(cstr + start, target);
98 return p ? p - cstr :
NPOS;
127 return "onmousedown";
131 return "onmousemove";
133 return "onmouseover";
155 if (
value.empty() ) {
233 m_Text(
text), m_EncodeMode(encode_mode)
305 const string& s)
const
324 const string *pstr = &
str;
339 out.write(pstr->data(), pstr->size());
345 #define PRINT_TMP_STR \
346 if ( enable_buffering ) { \
347 pstr->write(tmp.data(), tmp.size()); \
349 PrintString(out, mode, tmp); \
356 if ( tagStart ==
NPOS ) {
363 if ( enable_buffering ) {
368 string tmp =
text.substr(0, tagStart);
376 if ( tagNameEnd ==
NPOS ) {
382 if (
last != tagStart ) {
386 string name =
text.substr(tagNameStart,tagNameEnd-tagNameStart);
391 if ( enable_buffering ) {
396 if (
tag->NeedRepeatTag() ) {
406 }
while ( tagStart !=
NPOS );
412 if ( enable_buffering ) {
437 out <<
' ' <<
i->first;
441 !
i->second.IsOptional() ||
442 !
i->second.GetValue().empty() ) {
443 string attr =
i->second.GetValue();
445 if ( attr.empty() ) {
451 if ( attr.find_first_of(
"\"&") !=
NPOS ) {
489 CHECK_STREAM_WRITE(out);
496 CHTMLSingleElement::~CHTMLSingleElement(void)
502 CNcbiOstream& CHTMLSingleElement::PrintBegin(CNcbiOstream& out, TMode mode)
507 CParent::PrintBegin(out, mode);
510 x_PrintBegin(out, mode);
513 CHECK_STREAM_WRITE(out);
520 CHTMLInlineElement::~CHTMLInlineElement(void)
526 CNcbiOstream& CHTMLInlineElement::PrintEnd(CNcbiOstream& out, TMode mode)
534 out << "</" << m_Name << '>
';
535 CHECK_STREAM_WRITE(out);
542 CHTMLElement::~CHTMLElement(void)
548 CNcbiOstream& CHTMLElement::PrintEnd(CNcbiOstream& out, TMode mode)
550 CParent::PrintEnd(out, mode);
556 const TMode* previous = mode.GetPreviousContext();
559 CNCBINode* parent = previous->GetNode();
560 if ( parent && parent->HaveChildren() &&
561 parent->Children().size() > 1 )
562 // separate child nodes by newline
563 out << CHTMLHelper::GetNL();
565 out << CHTMLHelper::GetNL();
567 CHECK_STREAM_WRITE(out);
574 CHTMLBlockElement::~CHTMLBlockElement(void)
580 CNcbiOstream& CHTMLBlockElement::PrintEnd(CNcbiOstream& out, TMode mode)
582 CParent::PrintEnd(out, mode);
586 // Add a newline if no node on the path to the last descendant
587 // is also a block element. We only need one break.
588 CNCBINode* node = this;
589 while (node->HaveChildren()) {
590 node = node->Children().back();
591 if (node && dynamic_cast<CHTMLBlockElement*>(node)) {
596 out << CHTMLHelper::GetNL();
597 CHECK_STREAM_WRITE(out);
610 const char CHTMLComment::sm_TagName[] = "comment";
612 CHTMLComment::~CHTMLComment(void)
617 CNcbiOstream& CHTMLComment::Print(CNcbiOstream& out, TMode mode)
624 CParent::Print(out, mode);
630 CNcbiOstream& CHTMLComment::PrintBegin(CNcbiOstream& out, TMode mode)
639 CHECK_STREAM_WRITE(out);
645 CNcbiOstream& CHTMLComment::PrintEnd(CNcbiOstream& out, TMode mode)
654 CHECK_STREAM_WRITE(out);
660 CHTMLListElement::~CHTMLListElement(void)
665 CHTMLListElement* CHTMLListElement::SetType(const char* type)
667 SetAttribute("type", type);
671 CHTMLListElement* CHTMLListElement::SetType(const string& type)
673 SetAttribute("type", type);
677 CHTMLListElement* CHTMLListElement::SetCompact(void)
679 SetAttribute("compact");
683 CNcbiOstream& CHTMLListElement::PrintChildren(CNcbiOstream& out, TMode mode)
688 CIndentingOstream out2(out);
689 CHTMLElement::PrintChildren(out2, mode);
694 CHTMLElement::PrintChildren(out, mode);
703 CHTMLSpecialChar::CHTMLSpecialChar(const char* html, const char* plain,
707 m_Name = s_GenerateNodeInternalName("specialchar", html);
713 CHTMLSpecialChar::~CHTMLSpecialChar(void)
719 CNcbiOstream& CHTMLSpecialChar::PrintChildren(CNcbiOstream& out, TMode mode)
723 for ( int i = 0; i < m_Count; i++ ) {
726 CHECK_STREAM_WRITE(out);
731 for ( int i = 0; i < m_Count; i++ ) {
733 out << "&" << m_Html << ";";
734 CHECK_STREAM_WRITE(out);
744 const char CHTML_html::sm_TagName[] = "html";
746 CHTML_html::~CHTML_html(void)
751 void CHTML_html::Init(void)
756 CHTML_tr::CHTML_tr(void)
757 : CParent("tr"), m_Parent(0)
762 CHTML_tr::CHTML_tr(CNCBINode* node)
763 : CParent("tr", node), m_Parent(0)
768 CHTML_tr::CHTML_tr(const string& text)
769 : CParent("tr", text), m_Parent(0)
774 void CHTML_tr::DoAppendChild(CNCBINode* node)
776 CHTML_tc* cell = dynamic_cast<CHTML_tc*>(node);
779 _ASSERT(!cell->m_Parent);
781 cell->m_Parent = this;
783 CParent::DoAppendChild(node);
786 void CHTML_tr::AppendCell(CHTML_tc* cell)
788 _ASSERT(!cell->m_Parent);
789 cell->m_Parent = this;
790 CParent::DoAppendChild(cell);
793 void CHTML_tr::ResetTableCache(void)
796 m_Parent->ResetTableCache();
799 CNcbiOstream& CHTML_tr::PrintEnd(CNcbiOstream& out, TMode mode)
801 CParent::PrintEnd(out, mode);
806 out << CHTMLHelper::GetNL();
807 if (m_Parent->m_IsRowSep == CHTML_table::ePrintRowSep) {
808 out << string(GetTextLength(mode), m_Parent->m_RowSepChar)
809 << CHTMLHelper::GetNL();
811 CHECK_STREAM_WRITE(out);
821 CNcbiOstream& CHTML_tr::PrintChildren(CNcbiOstream& out, TMode mode)
823 if ( !HaveChildren() ) {
831 return CParent::PrintChildren(out, mode);
833 out << m_Parent->m_ColSepL;
834 NON_CONST_ITERATE ( TChildren, i, Children() ) {
835 if ( i != Children().begin() ) {
837 out << m_Parent->m_ColSepM;
838 CHECK_STREAM_WRITE(out);
840 Node(i)->Print(out, mode);
843 out << m_Parent->m_ColSepR;
844 CHECK_STREAM_WRITE(out);
849 SIZE_TYPE CHTML_tr::GetTextLength(TMode mode)
851 if ( !HaveChildren() ) {
854 CNcbiOstrstream sout;
857 NON_CONST_ITERATE ( TChildren, i, Children() ) {
858 Node(i)->Print(sout, mode);
861 SIZE_TYPE textlen = (SIZE_TYPE)GetOssSize(sout);
865 textlen += m_Parent->m_ColSepL.length() +
866 m_Parent->m_ColSepR.length();
868 textlen += m_Parent->m_ColSepM.length() * (cols - 1);
878 CHTML_tc::~CHTML_tc(void)
883 CHTML_tc* CHTML_tc::SetRowSpan(TIndex span)
885 SetAttribute("rowspan", span);
889 CHTML_tc* CHTML_tc::SetColSpan(TIndex span)
891 SetAttribute("colspan", span);
896 CHTML_table::TIndex x_GetSpan(const CHTML_tc* node,
897 const string& attributeName)
899 if ( !node->HaveAttribute(attributeName) ) {
902 const string& value = node->GetAttribute(attributeName);
905 CHTML_table::TIndex span = NStr::StringToUInt(value);
910 catch ( exception& ) {
911 // Error will be posted later
913 ERR_POST_X(1, "Bad attribute: " << attributeName << "=\"" << value << "\"");
917 void CHTML_tc::DoSetAttribute(const string& name,
918 const string& value, bool optional)
920 if (name == "rowspan" || name == "colspan") {
921 // Changing cell size
924 CParent::DoSetAttribute(name, value, optional);
927 void CHTML_tc::ResetTableCache(void)
930 m_Parent->ResetTableCache();
934 void CHTML_tc_Cache::SetUsed()
937 NCBI_THROW(CHTMLException, eTableCellUse, "overlapped table cells");
942 void CHTML_tc_Cache::SetCellNode(CHTML_tc* cellNode)
949 CHTML_table::TIndex x_NextSize(CHTML_table::TIndex size,
950 CHTML_table::TIndex limit)
957 } while ( size < limit );
961 CHTML_tc_Cache& CHTML_tr_Cache::GetCellCache(TIndex col)
963 TIndex count = GetCellCount();
964 if ( col >= count ) {
965 TIndex newCount = col + 1;
966 TIndex size = m_CellsSize;
967 if ( newCount > size ) {
968 TIndex newSize = x_NextSize(size, newCount);
969 CHTML_tc_Cache* newCells = new CHTML_tc_Cache[newSize];
970 for ( TIndex i = 0; i < count; ++i )
971 newCells[i] = m_Cells[i];
974 m_CellsSize = newSize;
976 m_CellCount = newCount;
981 void CHTML_tr_Cache::SetUsedCells(TIndex colBegin, TIndex colEnd)
983 for ( TIndex col = colBegin; col < colEnd; ++col ) {
984 GetCellCache(col).SetUsed();
988 void CHTML_tr_Cache::AppendCell(CHTML_tr* rowNode, TIndex col,
989 CHTML_tc* cellNode, TIndex colSpan)
991 _ASSERT(m_FilledCellCount <= col);
992 for ( TIndex i = m_FilledCellCount; i < col; ++i ) {
993 CHTML_tc_Cache& cellCache = GetCellCache(i);
994 if ( !cellCache.IsUsed() ) {
997 rowNode->AppendCell(cell);
998 cellCache.SetCellNode(cell);
1001 CHTML_tc_Cache& cellCache = GetCellCache(col);
1002 _ASSERT(!cellCache.IsUsed());
1003 _ASSERT(x_GetSpan(cellNode, "colspan") == colSpan);
1004 rowNode->AppendCell(cellNode);
1005 cellCache.SetCellNode(cellNode);
1006 if ( colSpan != 1 ) {
1007 SetUsedCells(col + 1, col + colSpan);
1009 m_FilledCellCount = col + colSpan;
1012 void CHTML_tr_Cache::SetUsedCells(CHTML_tc* cellNode,
1013 TIndex colBegin, TIndex colEnd)
1015 GetCellCache(colBegin).SetCellNode(cellNode);
1016 SetUsedCells(colBegin + 1, colEnd);
1017 m_FilledCellCount = colEnd;
1021 CHTML_table_Cache::~CHTML_table_Cache(void)
1023 for ( TIndex i = 0; i < GetRowCount(); ++i ) {
1030 CHTML_tr_Cache& CHTML_table_Cache::GetRowCache(TIndex row)
1032 TIndex count = GetRowCount();
1033 if ( row >= count ) {
1034 TIndex newCount = row + 1;
1035 TIndex size = m_RowsSize;
1036 if ( newCount > size ) {
1037 TIndex newSize = x_NextSize(size, newCount);
1038 CHTML_tr_Cache** newRows = new CHTML_tr_Cache*[newSize];
1039 for ( TIndex i = 0; i < count; ++i )
1040 newRows[i] = m_Rows[i];
1043 m_RowsSize = newSize;
1045 for ( TIndex i = count; i < newCount; ++i )
1046 m_Rows[i] = new CHTML_tr_Cache;
1047 m_RowCount = newCount;
1049 return *m_Rows[row];
1052 void CHTML_table_Cache::InitRow(TIndex row, CHTML_tr* rowNode)
1054 CHTML_tr_Cache& rowCache = GetRowCache(row);
1055 m_Rows[row]->SetRowNode(rowNode);
1056 m_FilledRowCount = row + 1;
1058 // Scan all children (which should be <TH> or <TD> tags)
1059 if ( rowNode->HaveChildren() ) {
1060 // Beginning with column 0
1062 for ( CNCBINode::TChildren::iterator iCol = rowNode->ChildBegin(),
1063 iColEnd = rowNode->ChildEnd();
1064 iCol != iColEnd; ++iCol ) {
1065 CHTML_tc* cellNode =
1066 dynamic_cast<CHTML_tc*>(rowNode->Node(iCol));
1072 // Skip all used cells
1073 while ( rowCache.GetCellCache(col).IsUsed() ) {
1077 // Determine current cell size
1078 TIndex rowSpan = x_GetSpan(cellNode, "rowspan");
1079 TIndex colSpan = x_GetSpan(cellNode, "colspan");
1081 // End of new cell in columns
1082 rowCache.SetUsedCells(cellNode, col, col + colSpan);
1083 if ( rowSpan > 1 ) {
1084 SetUsedCells(row + 1, row + rowSpan, col, col + colSpan);
1095 m_RowCount(0), m_RowsSize(0), m_Rows(0), m_FilledRowCount(0)
1098 if (
table->HaveChildren() ) {
1101 for ( CNCBINode::TChildren::iterator iRow =
table->ChildBegin(),
1102 iRowEnd =
table->ChildEnd(); iRow != iRowEnd; ++iRow ) {
1138 if ( cellCache.
IsNode() ) {
1142 if ( !
dynamic_cast<CHTML_th*
>(cell) )
1144 "wrong cell type: TH expected");
1147 if ( !
dynamic_cast<CHTML_td*
>(cell) )
1149 "wrong cell type: TD expected");
1156 if ( cellCache.
IsUsed() )
1158 "invalid use of big table cell");
1162 cell =
new CHTML_th;
1164 cell =
new CHTML_td;
1177 if ( cellCache.
IsNode() ) {
1181 if ( !
dynamic_cast<CHTML_th*
>(cell) )
1183 "wrong cell type: TH expected");
1186 if ( !
dynamic_cast<CHTML_td*
>(cell) )
1188 "wrong cell type: TD expected");
1193 if (
x_GetSpan(cell,
"rowspan") != rowSpan ||
1196 "cannot change table cell size");
1199 if ( cellCache.
IsUsed() )
1201 "invalid use of big table cell");
1206 cell =
new CHTML_th;
1208 cell =
new CHTML_td;
1210 if ( colSpan != 1 ) {
1213 if ( rowSpan != 1 ) {
1217 if ( rowSpan != 1 ) {
1227 m_RowSepChar(
'-'), m_IsRowSep(eSkipRowSep)
1254 row->m_Parent =
this;
1262 row->m_Parent =
this;
1284 type, rowSpan, colSpan);
1339 for ( CNCBINode::TChildren::iterator iRow =
ChildBegin(),
1340 iRowEnd =
ChildEnd(); iRow != iRowEnd; ++iRow ) {
1360 const string& col_middle,
1361 const string& col_right,
1362 const char row_sep_char,
1407 "application/x-www-form-urlencoded");
1412 "multipart/form-data");
1435 if ( !name.empty() ) {
1521 if ( !name.empty() ) {
1529 const string&
value)
1560 const string& description)
1569 bool checked,
const string& description)
1622 bool checked,
const string& description)
1669 const string&
value)
1677 const string&
value)
1769 const string&
value)
1804 const string& name,
const string&
value)
1812 const string& name,
const string&
value)
1813 :
CParent(sm_TagName, contents)
1836 const string&
value)
1896 for (
int i = 1;
i <
count; ++
i ) {
1949 if ( mapname.find(
"#") ==
NPOS ) {
2026 ITERATE(vector<int>, it, coords) {
2027 if ( it != coords.begin() ) {
2040 ITERATE(list<int>, it, coords) {
2041 if ( it != coords.begin() ) {
2064 if ( !definition.empty() )
2080 if ( !definition.empty() ) {
2265 new CHTMLPlainText(nl +
"<!--" + nl + script +
"-->" + nl,
true));
2272 #define DEFINE_HTML_ELEMENT(Tag) \
2273 CHTML_NAME(Tag)::~CHTML_NAME(Tag)(void) \
2276 const char CHTML_NAME(Tag)::sm_TagName[] = #Tag
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
container_type::const_iterator const_iterator
const_iterator end() const
std::ofstream out("events_result.xml")
main entry point for tests
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
static const column_t columns[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static string GetNL(void)
static string HTMLEncode(const string &str, THTMLEncodeFlags flags=fEncodeAll)
HTML encodes a string. E.g. <.
static string StripHTML(const string &str)
Strip all HTML code from a string.
static string HTMLAttributeEncode(const string &str, THTMLEncodeFlags flags=fSkipEntities)
HTML encodes a tag attribute ('&' and '"' symbols).
@ fCheckPreencoded
Print warning if some preencoded entity found in the string.
CHTML_checkbox(const string &name)
virtual CNcbiOstream & PrintBegin(CNcbiOstream &, TMode mode)
CHTML_input(const char *type, const string &name=kEmptyStr)
static const char sm_InputType[]
CHTML_area * DefineRect(int x1, int y1, int x2, int y2)
virtual CNcbiOstream & PrintChildren(CNcbiOstream &out, TMode mode)
CHTMLPlainText(EEncodeMode encode_mode, const string &text)
static const char sm_TagName[]
CHTML_script * AppendScript(const string &script)
CHTML_input_button(const string &label)
const string & GetText(void) const
void SetUsedCells(TIndex rowBegin, TIndex rowEnd, TIndex colBegin, TIndex colEnd)
static const char sm_TagName[]
const string & GetText(void) const
CHTML_tc_Cache & GetCellCache(TIndex col)
virtual void DoAppendChild(CNCBINode *child)
void SetUsedCells(TIndex colBegin, TIndex colEnd)
bool HaveChildren(void) const
CHTMLDualNode(const char *html, const char *plain)
CHTMLNode * SetNameAttribute(const string &name)
CHTML_tr_Cache & GetRowCache(TIndex row)
void SetEventHandler(const EHTML_EH_Attribute event, const string &value)
CHTML_tc * Cell(TIndex row, TIndex column, ECellType type=eAnyCell)
CHTML_textarea(const string &name, int cols, int rows)
unique_ptr< CHTML_table_Cache > m_Cache
CHTML_tc * GetCellNode(TIndex row, TIndex col, CHTML_table::ECellType type)
virtual CNcbiOstream & PrintChildren(CNcbiOstream &out, TMode mode)
virtual CNcbiOstream & PrintBegin(CNcbiOstream &, TMode mode)
CHTML_meta(EType mtype, const string &var, const string &content)
CHTML_tc * SetColSpan(TIndex span)
void SetPlainSeparators(const string &col_left=kEmptyStr, const string &col_middle=" ", const string &col_right=kEmptyStr, const char row_sep_char='-', ERowPlainSep is_row_sep=eSkipRowSep)
CHTML_table_Cache & GetCache(void) const
list< CNodeRef > TChildren
CHTML_text(const string &name, const string &value=kEmptyStr)
~CHTML_input_button(void)
static const char sm_TagName[]
static const char sm_InputType[]
TIndex CalculateNumberOfRows(void) const
static const char sm_TagName[]
static const char sm_TagName[]
CHTML_image(const string &name, const string &src, const string &alt=kEmptyStr)
CHTMLNode * SetWidth(int width)
CHTML_button(const string &text, EButtonType type=eSubmit, const string &name=kEmptyStr, const string &value=kEmptyStr)
static const char sm_InputType[]
virtual CNcbiOstream & PrintBegin(CNcbiOstream &out, TMode mode)
CHTML_radio(const string &name, const string &value)
CHTML_font * SetRelativeSize(int size)
CHTML_submit(const string &label)
bool HaveAttributes(void) const
void AddHidden(const string &name, const string &value)
CHTML_hidden(const string &name, const string &value)
static const char sm_TagName[]
TIndex CalculateNumberOfColumns(void) const
CNodeRef MapTagAll(const string &tagname, const TMode &mode)
CHTML_tc * GetCellNode(void) const
void Init(const string &url, EMethod method=eGet)
static const char sm_TagName[]
string GetEventHandlerName(const EHTML_EH_Attribute event) const
virtual CNcbiOstream & PrintChildren(CNcbiOstream &out, TMode mode)
TIndex GetRowCount(void) const
CNcbiOstream & PrintString(CNcbiOstream &out, TMode mode, const string &s) const
CHTML_area * DefineCircle(int x, int y, int radius)
const string & GetName(void) const
static const char sm_InputType[]
virtual CNcbiOstream & PrintBegin(CNcbiOstream &, TMode mode)
CHTML_button * SetSubmitData(const string &name, const string &value=kEmptyStr)
CHTML_tc * SetRowSpan(TIndex span)
TIndex GetCellCount(void) const
CHTML_tr * GetRowNode(void) const
CHTML_dl * AppendTerm(const string &term, CNCBINode *definition=0)
static const char sm_InputType[]
CHTML_table_Cache(CHTML_table *table)
int TFlags
Bitwise OR of "EFlags".
CHTML_map(const string &name)
CHTML_script(const string &stype)
CHTML_password(const string &name, const string &value=kEmptyStr)
void RepeatTag(bool enable=true)
static const char sm_TagName[]
CHTMLNode * AppendPlainText(const char *text, bool noEncode=false)
static const char sm_InputType[]
static const char sm_TagName[]
CNCBINode * AppendChild(CNCBINode *child)
CHTML_label(const string &text)
virtual void DoAppendChild(CNCBINode *node)
const string & GetNameAttribute(void) const
CHTML_reset(const string &label=kEmptyStr)
TChildren::iterator ChildEnd(void)
CHTML_hr * SetNoShade(void)
CHTML_legend(const string &legend)
CHTML_file(const string &name, const string &value=kEmptyStr)
static const char sm_TagName[]
void SetOptionalAttribute(const string &name, const string &value)
TAttributes & Attributes(void)
TChildren & Children(void)
TChildren::iterator ChildBegin(void)
static const char sm_InputType[]
CHTML_basefont * SetTypeFace(const string &typeface)
CHTML_area * DefinePolygon(int coords[], int count)
CHTML_ol * SetStart(int start)
static const char sm_TagName[]
CHTML_button * SetType(EButtonType type)
virtual CNcbiOstream & Print(CNcbiOstream &out, TMode mode=eHTML)
CHTML_font * SetTypeFace(const string &typeface)
void SetRowNode(CHTML_tr *rowNode)
CHTML_tr * Row(TIndex row)
void SetAttribute(const string &name, const string &value)
CHTMLNode * SetHeight(int height)
friend class CHTML_table_Cache
virtual CNcbiOstream & PrintBegin(CNcbiOstream &, TMode mode)
static const char sm_TagName[]
static const char sm_TagName[]
void UseMap(const string &mapname)
static const char sm_InputType[]
void AppendRow(CHTML_tr *row)
virtual CNcbiOstream & PrintBegin(CNcbiOstream &out, TMode mode)
CHTMLNode * SetSize(int size)
void CheckTable(void) const
void InitRow(TIndex row, CHTML_tr *rowNode)
static const char sm_TagName[]
CNcbiOstream & x_PrintBegin(CNcbiOstream &, TMode mode)
void ResetTableCache(void)
void AppendCell(CHTML_tr *rowNode, TIndex col, CHTML_tc *cellNode, TIndex colSpan)
CHTML_table::TIndex TIndex
CHTMLTagNode(const char *tag)
static const char sm_InputType[]
virtual CNcbiOstream & PrintBegin(CNcbiOstream &, TMode mode)
void SetFor(const string &idRef)
static const char sm_TagName[]
CHTML_tr * GetRowNode(TIndex row)
static const char sm_TagName[]
static const char sm_TagName[]
static const char sm_InputType[]
CHTML_img(const string &url, const string &alt=kEmptyStr)
CHTMLText(const char *text, TFlags flags=fDefault)
void SetNoEncode(bool noEncode=true)
CHTML_dl * SetCompact(void)
@ eJSONEncode
Encode for JSON output.
@ eNoEncode
Do not encode prior to printing.
@ eHTMLEncode
Encode for HTML output.
@ fStripHtmlMode
Strip text in html mode.
@ fDisableBuffering
Disable printout buffering.
@ fEncodeHtmlMode
Encode text in html mode.
@ fEncodeTextMode
Encode text in plain text mode.
@ fStripTextMode
Strip text in plain text mode.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
CNcbistrstream_Base< IO_PREFIX::ostrstream, IOS_BASE::out > CNcbiOstrstream
NCBI_NS_STD::string::size_type SIZE_TYPE
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string JsonEncode(const CTempString str, EJsonEncode encoding=eJsonEnc_UTF8)
Encode a string for JSON.
@ fWithSign
Prefix the output value with a sign ('+'/'-')
static const char label[]
#define CHECK_STREAM_WRITE(out)
const char * kTagStart
Tag delimiters.
#define DEFINE_HTML_ELEMENT(Tag)
const SIZE_TYPE kTagStartLen
static string s_GenerateNodeInternalName(const string &basename, const string &v1, const string &v2=kEmptyStr)
static CHTML_table::TIndex x_GetSpan(const CHTML_tc *node, const string &attributeName)
#define INIT_STREAM_WRITE
const char * kTagEnd
Tag end.
static SIZE_TYPE s_Find(const string &s, const char *target, SIZE_TYPE start=0)
HTML library helper classes and functions.
Definition of all error codes used in html library (xhtml.lib).
Indenting output stream support.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n th
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n td
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
#define row(bind, expected)