mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 18:31:12 +02:00
our current experimental Neutrino branch
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@27 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: bc5bd4154e
Author: mrcolor <mrcolor@e54a6e83-5905-42d5-8d5c-058d10e6a962>
Date: 2009-12-08 (Tue, 08 Dec 2009)
------------------
This commit was generated by Migit
This commit is contained in:
56
src/nhttpd/yhttpd_core/yresponse.h
Normal file
56
src/nhttpd/yhttpd_core/yresponse.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//=============================================================================
|
||||
// YHTTPD
|
||||
// Response
|
||||
//=============================================================================
|
||||
|
||||
#ifndef __yhttpd_response_h__
|
||||
#define __yhttpd_response_h__
|
||||
|
||||
// c++
|
||||
#include <string>
|
||||
// yhttpd
|
||||
#include "yconfig.h"
|
||||
#include "ytypes_globals.h"
|
||||
#include "yhook.h"
|
||||
|
||||
// forward declaration
|
||||
class CWebserver;
|
||||
class CWebserverConnection;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
class CWebserverResponse
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
bool WriteData(char const *data, long length);
|
||||
bool Sendfile(std::string filename);
|
||||
std::string redirectURI; // URI for redirection else: empty
|
||||
|
||||
public:
|
||||
class CWebserver *Webserver;
|
||||
class CWebserverConnection *Connection;
|
||||
|
||||
// con/destructors
|
||||
CWebserverResponse();
|
||||
CWebserverResponse(CWebserver *pWebserver);
|
||||
|
||||
// response control
|
||||
bool SendResponse(void);
|
||||
|
||||
// output methods
|
||||
void printf(const char *fmt, ...);
|
||||
bool Write(char const *text);
|
||||
bool WriteLn(char const *text);
|
||||
bool Write(const std::string text) { return Write(text.c_str()); }
|
||||
bool WriteLn(const std::string text) { return WriteLn(text.c_str()); }
|
||||
|
||||
// Headers
|
||||
void SendError(HttpResponseType responseType) {SendHeader(responseType, false, "text/html");}
|
||||
void SendHeader(HttpResponseType responseType, bool cache=false, std::string ContentType="text/html");
|
||||
|
||||
// Helpers
|
||||
std::string GetContentType(std::string ext);
|
||||
};
|
||||
|
||||
#endif /* __yhttpd_response_h__ */
|
Reference in New Issue
Block a user