Samchon Framework for CPP  1.0.0
samchon::protocol::IHTMLEntity Class Referenceabstract

An interface supporting conversion to html. More...

#include <IHTMLEntity.hpp>

Public Member Functions

virtual auto toHTML () const -> std::string=0
 Get an html string represents the Entity. More...
 

Static Public Member Functions

template<typename T , typename... _Args>
static auto toTH (const T &val, const _Args &...args) -> std::string
 Get a string represents a <th> tag. More...
 
template<typename T , typename... _Args>
static auto toTR (const T &val, const _Args &...args) -> std::string
 Get a string represents a <tr> tag. More...
 

Detailed Description

An interface supporting conversion to html.

IHTMEntity is an interface supporting conversion method to html tags. The IHTMLEntity is used to documentation or printing data of the entity to web-screen; In C++, documentation is main reason to implementing the IHTMLEntity and in JS, printing on web-screen is main reason.

IHTMLEntity provides abstract method toHTML() and varadic template methods for constituting a table. I'm planning to support lots of utility methods for html tags but I've not exprienced developing the homepage or html service. If you're familiar with the html, please contribute to the IHTMLEntity interface.

Basic Components
Example source

Result of the example

example_entity.png
Author
Jeongho Nam http://samchon.org

Definition at line 39 of file IHTMLEntity.hpp.

Member Function Documentation

template<typename T , typename... _Args>
static auto samchon::protocol::IHTMLEntity::toTH ( const T &  val,
const _Args &...  args 
) -> std::string
inlinestatic

Get a string represents a <th> tag.

Template Parameters
_TyType of an argument to be contained with a <td> tag.
_ArgsLeft varadic template arguments' type

Returns a string represents a title columns with <th> tag by varadic template method.

Supported parameters: that can converted to string

  • number
    • (unsigned) short
    • (unsigned) long
    • (unsigned) long long
    • (unsigned) int
    • float
    • double
    • long double
  • string
Parameters
valAn element to be contained with <td> a tag.
argsLeft argument to be contained with <td> tags.
Returns
A string of <th> tag represents title columns.

Definition at line 83 of file IHTMLEntity.hpp.

template<typename T , typename... _Args>
static auto samchon::protocol::IHTMLEntity::toTR ( const T &  val,
const _Args &...  args 
) -> std::string
inlinestatic

Get a string represents a <tr> tag.

Template Parameters
_TyType of an argument to be contained with a <tr> tag.
_ArgsLeft varadic template arguments' type

Returns a string represents a data columns of a row with <tr> tag by varadic template method.

Supported parameters: that can converted to string

  • number
    • (unsigned) short
    • (unsigned) long
    • (unsigned) long long
    • (unsigned) int
    • float
    • double
    • long double
  • string
Parameters
valAn element to be contained with <tr> a tag.
argsLeft argument to be contained with <tr> tags.
Returns
A string of <th> tag represents data columns of a row.

Definition at line 136 of file IHTMLEntity.hpp.

References toHTML().

Here is the call graph for this function:

virtual auto samchon::protocol::IHTMLEntity::toHTML ( ) const -> std::string
pure virtual

Get an html string represents the Entity.

Returns
A string represents the Entity by html tags.

Referenced by toTR().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: