Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/util/ip.h @ 9305

Last change on this file since 9305 was 9305, checked in by bensch, 18 years ago

compiles again

File size: 770 bytes
Line 
1
2/*!
3 * @file ip.h
4 * @brief Definition of Time Class.
5 *
6 * These are mainly Classes, that are used for wrapping around SDL_thread
7 */
8
9#ifndef __IP_H__
10#define __IP_H__
11
12#include <string>
13
14#include "netdefs.h"
15
16
17//! A class to handle time itself
18class IP
19{
20  public:
21    IP();
22    IP(const std::string& ip);
23    IP(int ip);
24
25
26    int ip() const { return this->_ip; };
27    short port() const { return this->_port; };
28
29    int ip(unsigned int part) const;
30    std::string& ipString() const;
31
32
33
34  public:
35    static int stringToIP(const std::string& ip);
36    static std::string ipToString(const IPaddress& ipaddr);
37    static std::string ipToString(int ip);
38
39  private:
40    int           _ip;  //!< the IP in int form.
41    short         _port;
42
43};
44
45#endif /* __IP_H__ */
Note: See TracBrowser for help on using the repository browser.