YARP
Yet Another Robot Platform
NetType.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_OS_NETTYPE_H
11 #define YARP_OS_NETTYPE_H
12 
13 #include <yarp/conf/numeric.h>
14 
15 #include <yarp/os/Bytes.h>
16 #include <yarp/os/InputStream.h>
17 #include <yarp/os/NetFloat64.h>
18 #include <yarp/os/NetInt32.h>
19 
20 #include <string>
21 
22 namespace yarp {
23 namespace os {
24 
29 {
30 public:
31  static int netInt(const yarp::os::Bytes& code);
32  static bool netInt(int data, yarp::os::Bytes& code);
33  static std::string toHexString(int x);
34  static std::string toString(int x);
35  static std::string toString(long x);
36  static std::string toString(unsigned int x);
37  static int toInt(const std::string& x);
38  static unsigned long int getCrc(char* buf, size_t len);
39 };
40 
41 } // namespace os
42 } // namespace yarp
43 
44 #endif // YARP_OS_NETTYPE_H
#define YARP_OS_API
Definition: api.h:19
A simple abstraction for a block of bytes.
Definition: Bytes.h:27
The main, catch-all namespace for YARP.
Definition: numeric.h:47
std::string toString(const T &value)
convert an arbitrary type to string.
Various utilities related to types and formats.
Definition: NetType.h:28