GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
string_converter.h
Go to the documentation of this file.
1 /*!
2  * \file string_converter.h
3  * \brief Interface of a class that interprets the contents of a string
4  * and converts it into different types.
5  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 
22 #ifndef GNSS_SDR_STRING_CONVERTER_H
23 #define GNSS_SDR_STRING_CONVERTER_H
24 
25 #include <cstdint>
26 #include <string>
27 
28 /*!
29  * \brief Class that interprets the contents of a string
30  * and converts it into different types.
31  */
33 {
34 public:
35  StringConverter() = default;
36  ~StringConverter() = default;
37 
38  bool convert(const std::string& value, bool default_value);
39  int64_t convert(const std::string& value, int64_t default_value);
40  uint64_t convert(const std::string& value, uint64_t default_value);
41  int32_t convert(const std::string& value, int32_t default_value);
42  uint32_t convert(const std::string& value, uint32_t default_value);
43  int16_t convert(const std::string& value, int16_t default_value);
44  uint16_t convert(const std::string& value, uint16_t default_value);
45  float convert(const std::string& value, float default_value);
46  double convert(const std::string& value, double default_value);
47 };
48 
49 #endif // GNSS_SDR_STRING_CONVERTER_H
Class that interprets the contents of a string and converts it into different types.