1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
ULib/examples/http_header/include/HttpLocation.h
2015-01-23 17:24:36 +01:00

42 lines
862 B
C++

// HttpLocation.h
#ifndef HTTP_LOCATION_H
#define HTTP_LOCATION_H 1
#include <HttpField.h>
class HttpLocation : public HttpField {
public:
UString url;
HttpLocation(const char* name_, unsigned name_len, const char* value_, unsigned value_len);
/**
* @param url_ Redirect URL
*/
HttpLocation(const UString& url_) : HttpField(U_STRING_FROM_CONSTANT("Location")), url(url_)
{
U_TRACE_REGISTER_OBJECT(5, HttpLocation, "%.*S", U_STRING_TO_TRACE(url_))
}
/** Destructor of the class.
*/
virtual ~HttpLocation()
{
U_TRACE_UNREGISTER_OBJECT(0, HttpLocation)
}
/**
* @param field_ String where to save header as string
*/
virtual void stringify(UString& field);
/// DEBUG
#if defined(U_STDCPP_ENABLE) && defined(DEBUG)
const char* dump(bool reset) const;
#endif
};
#endif