GNSS-SDR  0.0.19
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  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 
19 #ifndef GNSS_SDR_STRING_CONVERTER_H
20 #define GNSS_SDR_STRING_CONVERTER_H
21 
22 #include <cstdint>
23 #include <string>
24 
25 /** \addtogroup Core
26  * \{ */
27 /** \addtogroup Core_Receiver_Library
28  * \{ */
29 
30 
31 /*!
32  * \brief Class that interprets the contents of a string
33  * and converts it into different types.
34  */
36 {
37 public:
38  StringConverter() = default;
39  ~StringConverter() = default;
40 
41  bool convert(const std::string& value, bool default_value);
42  int64_t convert(const std::string& value, int64_t default_value);
43  uint64_t convert(const std::string& value, uint64_t default_value);
44  int32_t convert(const std::string& value, int32_t default_value);
45  uint32_t convert(const std::string& value, uint32_t default_value);
46  int16_t convert(const std::string& value, int16_t default_value);
47  uint16_t convert(const std::string& value, uint16_t default_value);
48  float convert(const std::string& value, float default_value);
49  double convert(const std::string& value, double default_value);
50 };
51 
52 
53 /** \} */
54 /** \} */
55 #endif // GNSS_SDR_STRING_CONVERTER_H
Class that interprets the contents of a string and converts it into different types.