Google
Web alhem.net

Cgi::Select Class Reference

#include <Select.h>

Inheritance diagram for Cgi::Select:

Inheritance graph
Collaboration diagram for Cgi::Select:

Collaboration graph
List of all members.

Public Member Functions

 Select (const std::string &name)
 ~Select ()
void Add (const std::string &value)
void Add (long value, const std::string &description)
void Selected (const std::string x)
void Selected (long x)
void Print ()

Private Member Functions

 Select (const Select &)
Selectoperator= (const Select &)

Private Attributes

std::string m_name
std::list< Value * > m_values
long m_selected
std::string m_selected_str

Friends

class Value

Classes

class  Multi
class  Value

Detailed Description

Definition at line 33 of file Select.h.


Constructor & Destructor Documentation

Cgi::Select::Select ( const std::string &  name  ) 

Definition at line 29 of file Select.cpp.

00029                                     : Styled(), m_name(name)
00030 {
00031 }

Cgi::Select::~Select (  ) 

Definition at line 34 of file Select.cpp.

00035 {
00036 }

Cgi::Select::Select ( const Select  )  [inline, private]

Definition at line 77 of file Select.h.

00077 {} // copy constructor


Member Function Documentation

void Cgi::Select::Add ( const std::string &  value  ) 

Definition at line 39 of file Select.cpp.

References m_values, and Value.

00040 {
00041         m_values.push_back(new Value(*this, value));
00042 }

void Cgi::Select::Add ( long  value,
const std::string &  description 
)

Definition at line 45 of file Select.cpp.

References m_values.

00046 {
00047         m_values.push_back(new Multi(*this, value, description));
00048 }

void Cgi::Select::Selected ( const std::string  x  )  [inline]

Definition at line 71 of file Select.h.

References m_selected_str.

00071 { m_selected_str = x; }

void Cgi::Select::Selected ( long  x  )  [inline]

Definition at line 72 of file Select.h.

References m_selected.

00072 { m_selected = x; }

void Cgi::Select::Print (  ) 

Definition at line 51 of file Select.cpp.

References Cgi::Styled::GetStyle(), m_name, and m_values.

00052 {
00053         if (GetStyle().size())
00054         {
00055                 printf("<select style='%s' name='%s'>", GetStyle().c_str(), m_name.c_str());
00056         }
00057         else
00058         {
00059                 printf("<select name='%s'>", m_name.c_str());
00060         }
00061         for (std::list<Value *>::iterator it = m_values.begin(); it != m_values.end(); it++)
00062         {
00063                 Value *p = *it;
00064                 p -> Print();
00065         }
00066         printf("</select>");
00067 }

Select& Cgi::Select::operator= ( const Select  )  [inline, private]

Definition at line 78 of file Select.h.

00078 { return *this; } // assignment operator


Friends And Related Function Documentation

friend class Value [friend]

Definition at line 63 of file Select.h.

Referenced by Add().


Member Data Documentation

std::string Cgi::Select::m_name [private]

Definition at line 79 of file Select.h.

Referenced by Print().

std::list<Value *> Cgi::Select::m_values [private]

Definition at line 80 of file Select.h.

Referenced by Add(), and Print().

long Cgi::Select::m_selected [private]

Definition at line 81 of file Select.h.

Referenced by Selected(), and Cgi::Select::Multi::Selected().

std::string Cgi::Select::m_selected_str [private]

Definition at line 82 of file Select.h.

Referenced by Selected(), and Cgi::Select::Value::Selected().


The documentation for this class was generated from the following files:
Generated for cgi++ by doxygen 1.3.7

Page, code, and content Copyright (C) 2004 by Anders Hedström