[STYLE] remove (void) in () to be c++ coherent
This commit is contained in:
parent
488658aecf
commit
22baa22bc2
@ -12,8 +12,8 @@
|
|||||||
namespace enet {
|
namespace enet {
|
||||||
class Ftp {
|
class Ftp {
|
||||||
public:
|
public:
|
||||||
Ftp(void) { };
|
Ftp() { };
|
||||||
virtual ~Ftp(void) { };
|
virtual ~Ftp() { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,22 +16,22 @@
|
|||||||
#endif
|
#endif
|
||||||
#define __class__ ("Http")
|
#define __class__ ("Http")
|
||||||
|
|
||||||
static std::map<int32_t, std::string> getErrorList(void) {
|
static std::map<int32_t, std::string> getErrorList() {
|
||||||
static std::map<int32_t, std::string> g_list;
|
static std::map<int32_t, std::string> g_list;
|
||||||
return g_list;
|
return g_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
enet::Http::Http(void) :
|
enet::Http::Http() :
|
||||||
m_keepAlive(false) {
|
m_keepAlive(false) {
|
||||||
m_connection.setPort(80);
|
m_connection.setPort(80);
|
||||||
m_connection.setServer(false);
|
m_connection.setServer(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
enet::Http::~Http(void) {
|
enet::Http::~Http() {
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool enet::Http::connect(void) {
|
bool enet::Http::connect() {
|
||||||
if (m_connection.getConnectionStatus() == enet::Tcp::statusLink) {
|
if (m_connection.getConnectionStatus() == enet::Tcp::statusLink) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ std::string enet::Http::getReceiveHeaderProperties(const std::string& _key) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool enet::Http::reset(void) {
|
bool enet::Http::reset() {
|
||||||
if (m_connection.getConnectionStatus() != enet::Tcp::statusLink) {
|
if (m_connection.getConnectionStatus() != enet::Tcp::statusLink) {
|
||||||
m_connection.unlink();
|
m_connection.unlink();
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ bool enet::Http::setPort(uint16_t _port) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool enet::Http::receiveData(void) {
|
bool enet::Http::receiveData() {
|
||||||
std::string header;
|
std::string header;
|
||||||
// Get data
|
// Get data
|
||||||
char data[1025];
|
char data[1025];
|
||||||
@ -298,7 +298,7 @@ bool enet::Http::post(const std::string& _address, const std::string& _contentTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string enet::Http::dataString(void) {
|
std::string enet::Http::dataString() {
|
||||||
std::string data;
|
std::string data;
|
||||||
for (auto element : m_receiveData) {
|
for (auto element : m_receiveData) {
|
||||||
if (element == '\0') {
|
if (element == '\0') {
|
||||||
|
18
enet/Http.h
18
enet/Http.h
@ -17,8 +17,8 @@
|
|||||||
namespace enet {
|
namespace enet {
|
||||||
class Http {
|
class Http {
|
||||||
public:
|
public:
|
||||||
Http(void);
|
Http();
|
||||||
virtual ~Http(void);
|
virtual ~Http();
|
||||||
private:
|
private:
|
||||||
enet::Tcp m_connection;
|
enet::Tcp m_connection;
|
||||||
private:
|
private:
|
||||||
@ -27,7 +27,7 @@ namespace enet {
|
|||||||
void setKeepAlive(bool _keepAlive) {
|
void setKeepAlive(bool _keepAlive) {
|
||||||
m_keepAlive = true;
|
m_keepAlive = true;
|
||||||
}
|
}
|
||||||
bool getKeepAlive(void) {
|
bool getKeepAlive() {
|
||||||
return m_keepAlive;
|
return m_keepAlive;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -35,8 +35,8 @@ namespace enet {
|
|||||||
std::map<std::string, std::string> m_sendHeader;
|
std::map<std::string, std::string> m_sendHeader;
|
||||||
std::map<std::string, std::string> m_receiveHeader;
|
std::map<std::string, std::string> m_receiveHeader;
|
||||||
std::vector<uint8_t> m_receiveData;
|
std::vector<uint8_t> m_receiveData;
|
||||||
bool connect(void);
|
bool connect();
|
||||||
bool reset(void);
|
bool reset();
|
||||||
public:
|
public:
|
||||||
void setSendHeaderProperties(const std::string& _key, const std::string& _val);
|
void setSendHeaderProperties(const std::string& _key, const std::string& _val);
|
||||||
std::string getSendHeaderProperties(const std::string& _key);
|
std::string getSendHeaderProperties(const std::string& _key);
|
||||||
@ -47,16 +47,16 @@ namespace enet {
|
|||||||
bool post(const std::string& _address, const std::map<std::string, std::string>& _values);
|
bool post(const std::string& _address, const std::map<std::string, std::string>& _values);
|
||||||
bool post(const std::string& _address, const std::string& _contentType, const std::string& _data);
|
bool post(const std::string& _address, const std::string& _contentType, const std::string& _data);
|
||||||
|
|
||||||
int32_t dataSize(void) {
|
int32_t dataSize() {
|
||||||
return m_receiveData.size();
|
return m_receiveData.size();
|
||||||
}
|
}
|
||||||
const std::vector<uint8_t>& data(void) {
|
const std::vector<uint8_t>& data() {
|
||||||
return m_receiveData;
|
return m_receiveData;
|
||||||
}
|
}
|
||||||
std::string dataString(void);
|
std::string dataString();
|
||||||
std::string escapeChar(const std::string& _value);
|
std::string escapeChar(const std::string& _value);
|
||||||
std::string unEscapeChar(const std::string& _value);
|
std::string unEscapeChar(const std::string& _value);
|
||||||
bool receiveData(void);
|
bool receiveData();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#define __class__ ("Tcp")
|
#define __class__ ("Tcp")
|
||||||
|
|
||||||
enet::Tcp::Tcp(void) :
|
enet::Tcp::Tcp() :
|
||||||
m_socketId(-1),
|
m_socketId(-1),
|
||||||
m_socketIdClient(-1),
|
m_socketIdClient(-1),
|
||||||
m_host("127.0.0.1"),
|
m_host("127.0.0.1"),
|
||||||
@ -30,7 +30,7 @@ enet::Tcp::Tcp(void) :
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enet::Tcp::~Tcp(void) {
|
enet::Tcp::~Tcp() {
|
||||||
unlink();
|
unlink();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ void enet::Tcp::setServer(bool _status) {
|
|||||||
m_server = _status;
|
m_server = _status;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool enet::Tcp::link(void) {
|
bool enet::Tcp::link() {
|
||||||
if (m_status == statusLink) {
|
if (m_status == statusLink) {
|
||||||
ENET_ERROR("Connection is already started");
|
ENET_ERROR("Connection is already started");
|
||||||
return false;
|
return false;
|
||||||
@ -177,7 +177,7 @@ bool enet::Tcp::link(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool enet::Tcp::unlink(void) {
|
bool enet::Tcp::unlink() {
|
||||||
if (m_socketIdClient >= 0) {
|
if (m_socketIdClient >= 0) {
|
||||||
ENET_INFO(" close client socket");
|
ENET_INFO(" close client socket");
|
||||||
close(m_socketIdClient);
|
close(m_socketIdClient);
|
||||||
|
16
enet/Tcp.h
16
enet/Tcp.h
@ -15,8 +15,8 @@ namespace enet {
|
|||||||
int32_t m_socketId; //!< socket linux interface generic
|
int32_t m_socketId; //!< socket linux interface generic
|
||||||
int32_t m_socketIdClient;
|
int32_t m_socketIdClient;
|
||||||
public:
|
public:
|
||||||
Tcp(void);
|
Tcp();
|
||||||
virtual ~Tcp(void);
|
virtual ~Tcp();
|
||||||
private:
|
private:
|
||||||
std::string m_host; //!< hostname/IP to connect with.
|
std::string m_host; //!< hostname/IP to connect with.
|
||||||
public:
|
public:
|
||||||
@ -37,7 +37,7 @@ namespace enet {
|
|||||||
* @brief Get the decriptive name hot the host
|
* @brief Get the decriptive name hot the host
|
||||||
* @return the string requested
|
* @return the string requested
|
||||||
*/
|
*/
|
||||||
const std::string& getHostName(void) {
|
const std::string& getHostName() {
|
||||||
return m_host;
|
return m_host;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -52,7 +52,7 @@ namespace enet {
|
|||||||
* @brief Get the port number.
|
* @brief Get the port number.
|
||||||
* @return The requested port number.
|
* @return The requested port number.
|
||||||
*/
|
*/
|
||||||
uint16_t getPort(void) {
|
uint16_t getPort() {
|
||||||
return m_port;
|
return m_port;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
@ -67,7 +67,7 @@ namespace enet {
|
|||||||
* @brief Get the server mode status.
|
* @brief Get the server mode status.
|
||||||
* @return true: the tcp interface is configure as a server.
|
* @return true: the tcp interface is configure as a server.
|
||||||
*/
|
*/
|
||||||
int32_t getServer(void) {
|
int32_t getServer() {
|
||||||
return m_server;
|
return m_server;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
@ -83,7 +83,7 @@ namespace enet {
|
|||||||
* @brief Get the current Status of the connection
|
* @brief Get the current Status of the connection
|
||||||
* @return The status.
|
* @return The status.
|
||||||
*/
|
*/
|
||||||
enum status getConnectionStatus(void) {
|
enum status getConnectionStatus() {
|
||||||
return m_status;
|
return m_status;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
@ -92,13 +92,13 @@ namespace enet {
|
|||||||
* @return true if connection is done
|
* @return true if connection is done
|
||||||
* @return false otherwise ...
|
* @return false otherwise ...
|
||||||
*/
|
*/
|
||||||
bool link(void);
|
bool link();
|
||||||
/**
|
/**
|
||||||
* @brief Unlink on a specific interface.
|
* @brief Unlink on a specific interface.
|
||||||
* @return true if connection is removed
|
* @return true if connection is removed
|
||||||
* @return false otherwise ...
|
* @return false otherwise ...
|
||||||
*/
|
*/
|
||||||
bool unlink(void);
|
bool unlink();
|
||||||
/**
|
/**
|
||||||
* @brief Read a chunk of data on the socket
|
* @brief Read a chunk of data on the socket
|
||||||
* @param[in] _data pointer on the data might be write
|
* @param[in] _data pointer on the data might be write
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
namespace enet {
|
namespace enet {
|
||||||
class Udp {
|
class Udp {
|
||||||
public:
|
public:
|
||||||
Udp(void) { };
|
Udp() { };
|
||||||
virtual ~Udp(void) { };
|
virtual ~Udp() { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <enet/debug.h>
|
#include <enet/debug.h>
|
||||||
|
|
||||||
int32_t enet::getLogId(void) {
|
int32_t enet::getLogId() {
|
||||||
static int32_t g_val = etk::log::registerInstance("enet");
|
static int32_t g_val = etk::log::registerInstance("enet");
|
||||||
return g_val;
|
return g_val;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <etk/log.h>
|
#include <etk/log.h>
|
||||||
|
|
||||||
namespace enet {
|
namespace enet {
|
||||||
int32_t getLogId(void);
|
int32_t getLogId();
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
|
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <test/debug.h>
|
#include <test/debug.h>
|
||||||
|
|
||||||
int32_t appl::getLogId(void) {
|
int32_t appl::getLogId() {
|
||||||
static int32_t g_val = etk::log::registerInstance("enettest");
|
static int32_t g_val = etk::log::registerInstance("enettest");
|
||||||
return g_val;
|
return g_val;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include <etk/log.h>
|
#include <etk/log.h>
|
||||||
|
|
||||||
namespace appl {
|
namespace appl {
|
||||||
int32_t getLogId(void);
|
int32_t getLogId();
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
|
// TODO : Review this problem of multiple intanciation of "std::stringbuf sb"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user