Eliminate includes file and include locally as required.
This commit is contained in:
parent
be014d0d24
commit
91286649cc
@ -1,7 +1,9 @@
|
||||
#ifndef __DirectoryEntry_h__
|
||||
# define __DirectoryEntry_h__
|
||||
|
||||
# include "includes"
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
5
File.cpp
5
File.cpp
@ -1,5 +1,10 @@
|
||||
#include "File.h"
|
||||
#include "Exception.h"
|
||||
#include <sys/stat.h>
|
||||
#include <sstream>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
3
File.h
3
File.h
@ -1,7 +1,8 @@
|
||||
#ifndef __File_h__
|
||||
#define __File_h__
|
||||
|
||||
#include "includes"
|
||||
#include <string>
|
||||
#include <fcntl.h>
|
||||
|
||||
///
|
||||
/// File
|
||||
|
@ -34,20 +34,10 @@ namespace coreutils {
|
||||
out << newHeaders.str() << "\r\n";
|
||||
}
|
||||
|
||||
void IMFMessage::addHeader(const char *key, const char *value) {
|
||||
newHeaders << key << ": " << value << "\r\n";
|
||||
}
|
||||
|
||||
void IMFMessage::addHeader(const char *key, std::string &value) {
|
||||
newHeaders << key << ": " << value << "\r\n";
|
||||
}
|
||||
|
||||
void IMFMessage::addHeader(ZString &key, ZString &value) {
|
||||
newHeaders << key << ": " << value << "\r\n";
|
||||
}
|
||||
|
||||
void IMFMessage::addHeader(const char *key, ZString &value) {
|
||||
newHeaders << key << ": " << value << "\r\n";
|
||||
void IMFMessage::addHeader(IMFHeader header) {
|
||||
std::stringstream out;
|
||||
header.output(out);
|
||||
newHeaders << out.str() ;
|
||||
}
|
||||
|
||||
ZString IMFMessage::getHeader(ZString key, bool valueOnly) {
|
||||
|
10
IMFMessage.h
10
IMFMessage.h
@ -1,6 +1,7 @@
|
||||
#ifndef __IMFMessage_h__
|
||||
#define __IMFMessage_h__
|
||||
|
||||
#include <typeinfo>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -10,6 +11,10 @@
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
|
||||
class IMFMessage : public ZString {
|
||||
|
||||
public:
|
||||
@ -19,10 +24,7 @@ namespace coreutils {
|
||||
|
||||
void output(std::stringstream &out);
|
||||
|
||||
void addHeader(const char *key, std::string &value);
|
||||
void addHeader(const char *key, const char *value);
|
||||
void addHeader(ZString &key, ZString &value);
|
||||
void addHeader(const char *key, ZString &value);
|
||||
void addHeader(IMFHeader header);
|
||||
|
||||
ZString getHeader(ZString key, bool valueOnly = true);
|
||||
ZString getHeaderKeyPairValue(const char *headerKey, const char *key);
|
||||
|
@ -18,12 +18,12 @@ namespace coreutils {
|
||||
if(mode == LENGTH) {
|
||||
sprintf(contentLength, "%li", content.str().length());
|
||||
ZString conlen(contentLength);
|
||||
addHeader("Content-Length", conlen);
|
||||
addHeader(IMFHeader("Content-Length", conlen));
|
||||
}
|
||||
else
|
||||
addHeader("Transfer-Encoding", "chunked");
|
||||
addHeader(IMFHeader("Transfer-Encoding", "chunked"));
|
||||
|
||||
addHeader("Server", "JETServer v0.0.1");
|
||||
addHeader(IMFHeader("Server", "JETServer v0.0.1"));
|
||||
|
||||
output(response);
|
||||
response << content.str();
|
||||
|
@ -1,8 +1,9 @@
|
||||
#ifndef __IMFResponse_h__
|
||||
#define __IMFResponse_h__
|
||||
|
||||
#include "includes"
|
||||
#include "IMFMessage.h"
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
5
Log.cpp
5
Log.cpp
@ -1,5 +1,10 @@
|
||||
#include "Log.h"
|
||||
#include "LogListener.h"
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
4
Log.h
4
Log.h
@ -1,9 +1,11 @@
|
||||
#ifndef __Log_h__
|
||||
#define __Log_h__
|
||||
|
||||
#include "includes"
|
||||
#include "File.h"
|
||||
#include "LogListener.h"
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user