#include <Link.h>
Inheritance diagram for Cgi::Link:
Public Member Functions | |
Link (WebForm *, const std::string &action, const std::string &linktext) | |
~Link () | |
void | AddParam (const std::string &name) |
void | AddParam (const std::string &name, const std::string &value) |
void | AddParam (const std::string &name, long value) |
const std::string & | GetLink () |
Private Types | |
typedef std::list< Param * > | param_v |
Private Member Functions | |
Link (const Link &) | |
Link & | operator= (const Link &) |
Private Attributes | |
WebForm * | m_webform |
std::string | m_action |
std::string | m_linktext |
param_v | m_params |
std::string | m_link |
Classes | |
class | Param |
class | Param2 |
Definition at line 37 of file Link.h.
typedef std::list<Param *> Cgi::Link::param_v [private] |
Cgi::Link::Link | ( | WebForm * | , | |
const std::string & | action, | |||
const std::string & | linktext | |||
) |
Cgi::Link::~Link | ( | ) |
Cgi::Link::Link | ( | const Link & | ) | [inline, private] |
void Cgi::Link::AddParam | ( | const std::string & | name | ) |
void Cgi::Link::AddParam | ( | const std::string & | name, | |
const std::string & | value | |||
) |
void Cgi::Link::AddParam | ( | const std::string & | name, | |
long | value | |||
) |
const std::string & Cgi::Link::GetLink | ( | ) |
Definition at line 73 of file Link.cpp.
References Cgi::Styled::GetStyle(), m_action, m_link, m_linktext, m_params, and m_webform.
00074 { 00075 Web *web = m_webform -> GetWeb(); 00076 char slask[1000]; 00077 sprintf(slask, "<a"); 00078 if (GetStyle().size()) 00079 { 00080 sprintf(slask + strlen(slask), " style='%s'", GetStyle().c_str()); 00081 } 00082 sprintf(slask + strlen(slask), " href='%s?%s=%s", web -> GetCgiName().c_str(), 00083 m_webform -> GetFormName().c_str(), m_action.c_str()); 00084 for (param_v::iterator it = m_params.begin(); it != m_params.end(); it++) 00085 { 00086 Param *p = *it; 00087 strcat(slask, p -> Print().c_str()); 00088 } 00089 sprintf(slask + strlen(slask), "'>%s</a>", m_linktext.c_str()); 00090 m_link = slask; 00091 return m_link; 00092 }
WebForm* Cgi::Link::m_webform [private] |
std::string Cgi::Link::m_action [private] |
std::string Cgi::Link::m_linktext [private] |
param_v Cgi::Link::m_params [private] |
std::string Cgi::Link::m_link [private] |