git-svn-id: svn://db.shs.com.ru/pip@542 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-09-05 15:20:33 +00:00
parent b67512d38c
commit 6f54f501cd
7 changed files with 324 additions and 131 deletions

View File

@@ -1,16 +1,61 @@
#include "pip.h"
#include "pivector2d.h"
#include "pistring.h"
#ifdef QNX
# include <net/if.h>
# include <net/if_dl.h>
# include <hw/nicinfo.h>
# include <netdb.h>
# include <sys/socket.h>
# include <sys/time.h>
# include <sys/types.h>
# include <sys/ioctl.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <ifaddrs.h>
# include <fcntl.h>
# ifdef BLACKBERRY
# include <netinet/in.h>
# else
# include <sys/dcmd_io-net.h>
# endif
# define ip_mreqn ip_mreq
# define imr_address imr_interface
#else
# ifdef WINDOWS
# include <io.h>
# include <winsock2.h>
# include <iphlpapi.h>
# include <psapi.h>
# include <ws2tcpip.h>
# define ip_mreqn ip_mreq
# define imr_address imr_interface
# else
# include <fcntl.h>
# include <sys/ioctl.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <sys/socket.h>
# include <net/if.h>
# include <netdb.h>
# ifndef ANDROID
# include <ifaddrs.h>
# endif
# endif
#endif
#include <errno.h>
int main(int argc, char *argv[]) {
PIString s = PIString::fromUTF8("hello, привет");
/*PIString s = PIString::fromUTF8("hello, привет");
piCout << s;
PIByteArray ba = s.toUTF8();
piCout << ba.toHex();
PIString s2;
s2 = PIString::fromUTF8(ba);
piCout << s2;
piCout << s2;*/
PIEthernet::Address a("127.1", -1);
piCout << a << PICoutManipulators::Hex << a.ip();
return 0;
}