⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 html.cpp

📁 ncbi源码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
CHTML_fieldset::CHTML_fieldset(const string& legend)    : CParent("fieldset", new CHTML_legend(legend)){    return;}CHTML_fieldset::CHTML_fieldset(CHTML_legend* legend)    : CParent("fieldset", legend){    return;}CHTML_fieldset::~CHTML_fieldset(void){    return;}// <label> tag.CHTML_label::CHTML_label(const string& text)    : CParent("label", text){    return;}CHTML_label::CHTML_label(const string& text, const string& idRef)    : CParent("label", text){    SetFor(idRef);}CHTML_label::~CHTML_label(void){    return;}void CHTML_label::SetFor(const string& idRef){    SetAttribute("for", idRef);}// <textarea> tag.CHTML_textarea::CHTML_textarea(const string& name, int cols, int rows)    : CParent("textarea"){    SetNameAttribute(name);    SetAttribute("cols", cols);    SetAttribute("rows", rows);}CHTML_textarea::CHTML_textarea(const string& name, int cols, int rows,                               const string& value)    : CParent("textarea", value){    SetNameAttribute(name);    SetAttribute("cols", cols);    SetAttribute("rows", rows);}CHTML_textarea::~CHTML_textarea(void){    return;}// <input> tag.CHTML_input::CHTML_input(const char* type, const string& name)    : CParent("input"){    SetAttribute("type", type);    SetNameAttribute(name);}CHTML_input::~CHTML_input(void){    return;}// <checkbox> tag.const char CHTML_checkbox::sm_InputType[] = "checkbox";CHTML_checkbox::CHTML_checkbox(const string& name)    : CParent(sm_InputType, name){    return;}CHTML_checkbox::CHTML_checkbox(const string& name, const string& value)    : CParent(sm_InputType, name){    SetOptionalAttribute("value", value);}CHTML_checkbox::CHTML_checkbox(const string& name, bool checked,                               const string& description)    : CParent(sm_InputType, name){    SetOptionalAttribute("checked", checked);    // Add the description at the end    AppendPlainText(description);}CHTML_checkbox::CHTML_checkbox(const string& name, const string& value,                               bool checked, const string& description)    : CParent(sm_InputType, name){    SetOptionalAttribute("value", value);    SetOptionalAttribute("checked", checked);    // Add the description at the end    AppendPlainText(description);  }CHTML_checkbox::~CHTML_checkbox(void){    return;}// <image> tag.const char CHTML_image::sm_InputType[] = "image";CHTML_image::CHTML_image(const string& name, const string& src,                         const string& alt)    : CParent(sm_InputType, name){    SetAttribute("src", src);    SetOptionalAttribute("alt", alt);}CHTML_image::CHTML_image(const string& name, const string& src, int border,                         const string& alt)    : CParent(sm_InputType, name){    SetAttribute("src", src);    SetAttribute("border", border);    SetOptionalAttribute("alt", alt);}CHTML_image::~CHTML_image(void){    return;}// <radio> tag.const char CHTML_radio::sm_InputType[] = "radio";CHTML_radio::CHTML_radio(const string& name, const string& value)    : CParent(sm_InputType, name){    SetAttribute("value", value);}CHTML_radio::CHTML_radio(const string& name, const string& value,                         bool checked, const string& description)    : CParent(sm_InputType, name){    SetAttribute("value", value);    SetOptionalAttribute("checked", checked);    AppendPlainText(description);  // adds the description at the end}CHTML_radio::~CHTML_radio(void){    return;}// <hidden> tag.const char CHTML_hidden::sm_InputType[] = "hidden";CHTML_hidden::CHTML_hidden(const string& name, const string& value)    : CParent(sm_InputType, name){    SetAttribute("value", value);}CHTML_hidden::CHTML_hidden(const string& name, int value)    : CParent(sm_InputType, name){    SetAttribute("value", value);}CHTML_hidden::~CHTML_hidden(void){    return;}// <submit> tag.const char CHTML_submit::sm_InputType[] = "submit";CHTML_submit::CHTML_submit(const string& name)    : CParent(sm_InputType, NcbiEmptyString){    SetOptionalAttribute("value", name);}CHTML_submit::CHTML_submit(const string& name, const string& label)    : CParent(sm_InputType, name){    SetOptionalAttribute("value", label);}CHTML_submit::~CHTML_submit(void){    return;}// <reset> tag.const char CHTML_reset::sm_InputType[] = "reset";CHTML_reset::CHTML_reset(const string& label)    : CParent(sm_InputType, NcbiEmptyString){    SetOptionalAttribute("value", label);}CHTML_reset::~CHTML_reset(void){    return;}// button tag/*  commented out because it's not supported in most browsers  CHTML_button::CHTML_button(const string& text, EButtonType type)  : CParent("button", text)  {  SetType(type);  }  CHTML_button::CHTML_button(CNCBINode* contents, EButtonType type)  : CParent("button", contents)  {  SetType(type);  }  CHTML_button::CHTML_button(const string& text, const string& name,  const string& value)  : CParent("button", text)  {  SetSubmit(name, value);  }  CHTML_button::CHTML_button(CNCBINode* contents, const string& name,  const string& value)  : CParent("button", contents)  {  SetSubmit(name, value);  }  CHTML_button* CHTML_button::SetType(EButtonType type)  {  switch ( type ) {  case eSubmit:  SetAttribute("type", "submit");  break;  case eReset:  SetAttribute("type", "reset");  break;  case eButton:  SetAttribute("type", "button");  break;  }  return this;  }  CHTML_button* CHTML_button::SetSubmit(const string& name,  const string& value)  {  SetNameAttribute(name);  SetOptionalAttribute("value", value);  return this;  }  CHTML_button::~CHTML_button(void)  {  }*/// <text> tag.const char CHTML_text::sm_InputType[] = "text";CHTML_text::CHTML_text(const string& name, const string& value)    : CParent(sm_InputType, name){    SetOptionalAttribute("value", value);}CHTML_text::CHTML_text(const string& name, int size, const string& value)    : CParent(sm_InputType, name){    SetSize(size);    SetOptionalAttribute("value", value);}CHTML_text::CHTML_text(const string& name, int size, int maxlength,                       const string& value)    : CParent(sm_InputType, name){    SetSize(size);    SetAttribute("maxlength", maxlength);    SetOptionalAttribute("value", value);}CHTML_text::~CHTML_text(void){    return;}// <file> tag.const char CHTML_file::sm_InputType[] = "file";CHTML_file::CHTML_file(const string& name, const string& value)    : CParent(sm_InputType, name){    SetOptionalAttribute("value", value);}CHTML_file::~CHTML_file(void){    return;}// <select> tag.const char CHTML_select::sm_TagName[] = "select";CHTML_select::~CHTML_select(void){    return;}CHTML_select* CHTML_select::SetMultiple(void){    SetAttribute("multiple");    return this;}// <option> tag.const char CHTML_option::sm_TagName[] = "option";CHTML_option::~CHTML_option(void){    return;}CHTML_option* CHTML_option::SetValue(const string& value){    SetAttribute("value", value);    return this;}CHTML_option* CHTML_option::SetSelected(void){    SetAttribute("selected");    return this;}// <a> tag.const char CHTML_a::sm_TagName[] = "a";CHTML_a::~CHTML_a(void){    return;}CHTML_a* CHTML_a::SetHref(const string& href){    SetAttribute("href", href);    return this;}// <br> tag.const char CHTML_br::sm_TagName[] = "br";CHTML_br::CHTML_br(int count)    : CParent(sm_TagName){    for ( int i = 1; i < count; ++i ) {        AppendChild(new CHTML_br());    }}CHTML_br::~CHTML_br(void){    return;}CNcbiOstream& CHTML_br::PrintBegin(CNcbiOstream& out, TMode mode){    if ( mode == ePlainText ) {        out << CHTMLHelper::GetNL();        CHECK_STREAM_WRITE(out);    }    else {        CParent::PrintBegin(out, mode);    }    return out;}// <img> tag.CHTML_img::CHTML_img(const string& url, const string& alt)    : CParent("img"){    SetAttribute("src", url);    SetOptionalAttribute("alt", alt);}CHTML_img::CHTML_img(const string& url, int width, int height,                     const string& alt)    : CParent("img"){    SetAttribute("src", url);    SetOptionalAttribute("alt", alt);    SetWidth(width);    SetHeight(height);}CHTML_img::~CHTML_img(void){    return;}// <dl> tag.const char CHTML_dl::sm_TagName[] = "dl";CHTML_dl::~CHTML_dl(void){    return;}CHTML_dl* CHTML_dl::AppendTerm(const string& term, const string& definition){    AppendChild(new CHTML_dt(term));    if ( !definition.empty() )        AppendChild(new CHTML_dd(definition));    return this;}CHTML_dl* CHTML_dl::AppendTerm(const string& term, CNCBINode* definition){    AppendChild(new CHTML_dt(term));    if ( definition )        AppendChild(new CHTML_dd(definition));    return this;}CHTML_dl* CHTML_dl::AppendTerm(CNCBINode* term, const string& definition){    AppendChild(new CHTML_dt(term));    if ( !definition.empty() ) {        AppendChild(new CHTML_dd(definition));    }    return this;}CHTML_dl* CHTML_dl::AppendTerm(CNCBINode* term, CNCBINode* definition){    AppendChild(new CHTML_dt(term));    if ( definition )        AppendChild(new CHTML_dd(definition));    return this;}CHTML_dl* CHTML_dl::SetCompact(void){    SetAttribute("compact");    return this;}// <ol> tag.const char CHTML_ol::sm_TagName[] = "ol";CHTML_ol::~CHTML_ol(void){}CHTML_ol* CHTML_ol::SetStart(int start){    SetAttribute("start", start);    return this;}// <ul> tag.const char CHTML_ul::sm_TagName[] = "ul";CHTML_ul::~CHTML_ul(void){    return;}// <dir> tag.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -