Ignition Transport

API Reference

4.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/Export.hh"
28
29namespace ignition
30{
31 namespace transport
32 {
35
40 bool IGNITION_TRANSPORT_VISIBLE env(const std::string &_name,
41 std::string &_value);
42
43 // Use safer functions on Windows
44 #ifdef _MSC_VER
45 #define ign_strcat strcat_s
46 #define ign_strcpy strcpy_s
47 #define ign_sprintf sprintf_s
48 #define ign_strdup _strdup
49 #else
50 #define ign_strcat std::strcat
51 #define ign_strcpy std::strcpy
52 #define ign_sprintf std::sprintf
53 #define ign_strdup strdup
54 #endif
55 }
56}
57
58// IGN_TRANSPORT_HELPERS_HH_
59#endif
T max(T... args)
bool env(const std::string &_name, std::string &_value)
Find the environment variable '_name' and return its value.
static const uint64_t kUnthrottled
Constant used when not interested in throttling.
Definition Helpers.hh:34
Definition AdvertiseOptions.hh:28