object to help construct dialog request streams More...
#include <request.h>
Public Types | |
enum | eAxis { eAxis_Horizontal = 1, eAxis_Vertical = 2 } |
Public Member Functions | |
ContainerRequest (eAxis axis=eAxis_Vertical) | |
std::string | get (void) |
void | addLabel (IN const char *label) |
void | addWidthString (IN const char *widthString) |
void | addButton (IN const char *submit, IN const char *label) |
void | addTextbox (IN const char *name, IN const char *value, IN int max, IN bool encrypted=false) |
void | addContainer (IN ContainerRequest &cr) |
void | addCustom (IN const char *string) |
raw access to stream! | |
smart_ptr< Datahash > | getDatahash (void) |
object to help construct dialog request streams
It is recommended that callers use this object instead of directly creating text streams! This way your code is relatively insulated if elements add new attributes, etc. The code is also easier to write and maintain.
Typical usage is to create a ContainerRequest, add a bunch of stuff, and then call get() to retrieve the string that represents the dialog stream.
Once you call get(), the ContainerRequest is considered closed. Any additional attempts to add data to the container is a programming failure and the program will hard stop.
If you want to recursively add subcontainers (nested elements within the dialog), create separate ContainerRequest objects for each child container and add them to the parent container with addContainer(). Note that adding a ContainerRequest to a parent has the side-effect of closing the child container.
Definition at line 69 of file dialog/request.h.
Definition at line 72 of file dialog/request.h.
dialog::ContainerRequest::ContainerRequest | ( | eAxis | axis = eAxis_Vertical |
) | [inline] |
Definition at line 78 of file dialog/request.h.
std::string dialog::ContainerRequest::get | ( | void | ) | [inline] |
Definition at line 86 of file dialog/request.h.
Definition at line 70 of file dialog.cpp.
void dialog::ContainerRequest::addLabel | ( | IN const char * | label | ) | [inline] |
Definition at line 93 of file dialog/request.h.
void dialog::ContainerRequest::addWidthString | ( | IN const char * | widthString | ) | [inline] |
Definition at line 102 of file dialog/request.h.
void dialog::ContainerRequest::addButton | ( | IN const char * | submit, | |
IN const char * | label | |||
) | [inline] |
Definition at line 108 of file dialog/request.h.
void dialog::ContainerRequest::addTextbox | ( | IN const char * | name, | |
IN const char * | value, | |||
IN int | max, | |||
IN bool | encrypted = false | |||
) | [inline] |
Definition at line 119 of file dialog/request.h.
void dialog::ContainerRequest::addContainer | ( | IN ContainerRequest & | cr | ) | [inline] |
Definition at line 136 of file dialog/request.h.
void dialog::ContainerRequest::addCustom | ( | IN const char * | string | ) | [inline] |
raw access to stream!
Definition at line 144 of file dialog/request.h.