ifm3d
util.h
1 // -*- c++ -*-
2 /*
3  * Copyright 2018 ifm electronic, gmbh
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef IFM3D_DEVICE_UTIL_H
8 #define IFM3D_DEVICE_UTIL_H
9 
10 #include <string>
11 #include <vector>
12 #include <ifm3d/device/module_device.h>
13 #include <cstdint>
14 
15 namespace ifm3d
16 {
20  IFM3D_EXPORT std::string& ltrim(std::string& str,
21  const std::string& chars = "\t\n\v\f\r ");
22 
26  IFM3D_EXPORT std::string& rtrim(std::string& str,
27  const std::string& chars = "\t\n\v\f\r ");
28 
32  IFM3D_EXPORT std::string& trim(std::string& str,
33  const std::string& chars = "\t\n\v\f\r ");
34 
38  IFM3D_EXPORT std::vector<std::string> split(const std::string& in,
39  char delim);
40 
41  IFM3D_EXPORT std::string base64_encode(const std::vector<uint8_t>& data);
42 
43  IFM3D_EXPORT std::vector<uint8_t> base64_decode(const std::string& base64);
44 
45  IFM3D_EXPORT bool IsStdinAvailable(int timeoutSeconds = 2);
46 
47 } // end: namespace ifm3d
48 
49 #endif // IFM3D_CAMERA_UTIL_H