Ignition Transport

API Reference

6.0.0
Helpers.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef IGN_TRANSPORT_HELPERS_HH_
19 #define IGN_TRANSPORT_HELPERS_HH_
20 
21 #include <cstdint>
22 #include <cstdio>
23 #include <cstring>
24 #include <limits>
25 #include <string>
26 
27 #include "ignition/transport/config.hh"
28 #include "ignition/transport/Export.hh"
29 
30 namespace ignition
31 {
32  namespace transport
33  {
34  // Inline bracket to help doxygen filtering.
35  inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
36  //
39 
44  bool IGNITION_TRANSPORT_VISIBLE env(const std::string &_name,
45  std::string &_value);
46 
47  // Use safer functions on Windows
48  #ifdef _MSC_VER
49  #define ign_strcat strcat_s
50  #define ign_strcpy strcpy_s
51  #define ign_sprintf sprintf_s
52  #define ign_strdup _strdup
53  #else
54  #define ign_strcat std::strcat
55  #define ign_strcpy std::strcpy
56  #define ign_sprintf std::sprintf
57  #define ign_strdup strdup
58  #endif
59  }
60  }
61 }
62 
63 // IGN_TRANSPORT_HELPERS_HH_
64 #endif
STL class.
T max(T... args)
Definition: AdvertiseOptions.hh:28
bool env(const std::string &_name, std::string &_value)
Find the environment variable &#39;_name&#39; and return its value.
static const uint64_t kUnthrottled
Constant used when not interested in throttling.
Definition: Helpers.hh:38