View Class Reference
#include <View.h>
List of all members.
Constructor & Destructor Documentation
Member Function Documentation
00034 {
00035 std::string content = content_type;
00036 content += ";charset=";
00037 content += charset;
00038 content += "\n\n";
00039 apr->setHeader("Content-type:", content);
00040 apr->sendHeaders();
00041
00042 std::ifstream htmlStream;
00043
00044 std::string path = templatePath + htmlTemplate;
00045 htmlStream.open(path.c_str());
00046
00047 if (!htmlStream) {
00048
00049 std::cerr << "Can not find template!\n";
00050 exit(-1);
00051 }
00052 int length;
00053 char * buffer;
00054
00055 htmlStream.seekg (0, std::ios::end);
00056 length = htmlStream.tellg();
00057 htmlStream.seekg (0, std::ios::beg);
00058
00059 buffer = new char [length];
00060 htmlStream.read (buffer,length);
00061 htmlStream.close();
00062
00063 std::cout.write(buffer, length);
00064 delete [] buffer;
00065 }
Member Data Documentation
The documentation for this class was generated from the following files: