Added testing function for ZString.
This commit is contained in:
1 parent
191899fbb7
commit
a0129273b3
8 files changed
+99
-70
No files matched your search
+29
-28
@@ -5,32 +5,32 @@
|
||||
#include "IMFMessage.h"
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
||||
///
|
||||
/// IMFResponse
|
||||
///
|
||||
/// Use this object to build a response output for a protocol that uses headers
|
||||
/// and responses as the main communications protocol.
|
||||
///
|
||||
|
||||
|
||||
class IMFResponse : public IMFMessage {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
enum Mode { LENGTH, STREAMING };
|
||||
|
||||
|
||||
///
|
||||
/// The constructor for the object.
|
||||
///
|
||||
|
||||
|
||||
IMFResponse();
|
||||
|
||||
///
|
||||
|
||||
///
|
||||
/// The destructor for the object.
|
||||
///
|
||||
|
||||
~IMFResponse();
|
||||
|
||||
|
||||
~IMFResponse();
|
||||
|
||||
///
|
||||
/// Returns the response generated from the contained values that
|
||||
/// do not return a content length. Using this constructor ensures
|
||||
@@ -38,9 +38,9 @@ namespace coreutils {
|
||||
///
|
||||
/// @return the complete response string to send to client.
|
||||
///
|
||||
|
||||
|
||||
std::stringstream getResponse(Mode mode = LENGTH);
|
||||
|
||||
|
||||
///
|
||||
/// Returns the response plus the content passed as a parameter.
|
||||
///
|
||||
@@ -52,46 +52,47 @@ namespace coreutils {
|
||||
///
|
||||
/// @return the complete response string to send to client.
|
||||
///
|
||||
|
||||
|
||||
std::stringstream getResponse(std::stringstream &content, Mode mode = LENGTH);
|
||||
|
||||
|
||||
///
|
||||
/// Sets the protocol value for the response message. The protocol
|
||||
/// Sets the protocol value for the response message. The protocol
|
||||
/// should match the header received.
|
||||
///
|
||||
/// @param protocol the protocol value to return in response.
|
||||
/// @param protocol the protocol value to return in response.
|
||||
///
|
||||
|
||||
|
||||
void setProtocol(ZString protocol);
|
||||
|
||||
|
||||
///
|
||||
/// Sets the return code value for the response.
|
||||
///
|
||||
/// @param code the response code value to return in the response.
|
||||
///
|
||||
|
||||
|
||||
void setCode(ZString code);
|
||||
|
||||
|
||||
///
|
||||
/// Sets the return code string value for the response.
|
||||
///
|
||||
/// @param text the text value for the response code to return on
|
||||
/// @param text the text value for the response code to return on
|
||||
/// the response.
|
||||
///
|
||||
|
||||
|
||||
void setText(ZString text);
|
||||
|
||||
|
||||
void setCookie(ZString key, ZString data);
|
||||
|
||||
void setCookie(ZString key, std::string data);
|
||||
|
||||
private:
|
||||
ZString protocol;
|
||||
ZString code;
|
||||
ZString text;
|
||||
|
||||
|
||||
const char *CRLF = "\r\n";
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user