reformat file in Include
This commit is contained in:
parent
5d8b4cb261
commit
abd20776a2
@ -53,7 +53,8 @@ struct FixedPointCoordinate
|
|||||||
static double ApproximateEuclideanDistance(const FixedPointCoordinate &c1,
|
static double ApproximateEuclideanDistance(const FixedPointCoordinate &c1,
|
||||||
const FixedPointCoordinate &c2);
|
const FixedPointCoordinate &c2);
|
||||||
|
|
||||||
static double ApproximateEuclideanDistance(const int lat1, const int lon1, const int lat2, const int lon2);
|
static double
|
||||||
|
ApproximateEuclideanDistance(const int lat1, const int lon1, const int lat2, const int lon2);
|
||||||
|
|
||||||
static void convertInternalLatLonToString(const int value, std::string &output);
|
static void convertInternalLatLonToString(const int value, std::string &output);
|
||||||
|
|
||||||
|
@ -30,12 +30,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace http {
|
namespace http
|
||||||
|
{
|
||||||
struct Header {
|
struct Header
|
||||||
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string value;
|
std::string value;
|
||||||
void Clear() {
|
void Clear()
|
||||||
|
{
|
||||||
name.clear();
|
name.clear();
|
||||||
value.clear();
|
value.clear();
|
||||||
}
|
}
|
||||||
|
@ -34,25 +34,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace http {
|
namespace http
|
||||||
|
{
|
||||||
|
|
||||||
const char okHTML[] = "";
|
const char okHTML[] = "";
|
||||||
const char badRequestHTML[] = "{\"status\": 400,\"status_message\":\"Bad Request\"}";
|
const char badRequestHTML[] = "{\"status\": 400,\"status_message\":\"Bad Request\"}";
|
||||||
const char internalServerErrorHTML[] = "{\"status\": 500,\"status_message\":\"Internal Server Error\"}";
|
const char internalServerErrorHTML[] =
|
||||||
|
"{\"status\": 500,\"status_message\":\"Internal Server Error\"}";
|
||||||
const char seperators[] = {':', ' '};
|
const char seperators[] = {':', ' '};
|
||||||
const char crlf[] = {'\r', '\n'};
|
const char crlf[] = {'\r', '\n'};
|
||||||
const std::string okString = "HTTP/1.0 200 OK\r\n";
|
const std::string okString = "HTTP/1.0 200 OK\r\n";
|
||||||
const std::string badRequestString = "HTTP/1.0 400 Bad Request\r\n";
|
const std::string badRequestString = "HTTP/1.0 400 Bad Request\r\n";
|
||||||
const std::string internalServerErrorString = "HTTP/1.0 500 Internal Server Error\r\n";
|
const std::string internalServerErrorString = "HTTP/1.0 500 Internal Server Error\r\n";
|
||||||
|
|
||||||
class Reply {
|
class Reply
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
enum status_type {
|
enum status_type
|
||||||
ok = 200,
|
{ ok = 200,
|
||||||
badRequest = 400,
|
badRequest = 400,
|
||||||
internalServerError = 500
|
internalServerError = 500 } status;
|
||||||
} status;
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<Header> headers;
|
std::vector<Header> headers;
|
||||||
std::vector<boost::asio::const_buffer> toBuffers();
|
std::vector<boost::asio::const_buffer> toBuffers();
|
||||||
@ -63,11 +64,11 @@ public:
|
|||||||
void SetUncompressedSize();
|
void SetUncompressedSize();
|
||||||
|
|
||||||
Reply();
|
Reply();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string ToString(Reply::status_type status);
|
std::string ToString(Reply::status_type status);
|
||||||
boost::asio::const_buffer ToBuffer(Reply::status_type status);
|
boost::asio::const_buffer ToBuffer(Reply::status_type status);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // REPLY_H
|
#endif // REPLY_H
|
||||||
|
@ -28,8 +28,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef SERVER_PATH_H
|
#ifndef SERVER_PATH_H
|
||||||
#define SERVER_PATH_H
|
#define SERVER_PATH_H
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user