2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file string_converter.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Interface of a class that interprets the contents of a string
|
|
|
|
* and converts it into different types.
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2011-10-01 18:45:20 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_STRING_CONVERTER_H
|
|
|
|
#define GNSS_SDR_STRING_CONVERTER_H
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2018-12-02 04:29:11 +00:00
|
|
|
#include <cstdint>
|
2011-10-01 18:45:20 +00:00
|
|
|
#include <string>
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Core
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Core_Receiver_Library
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2013-01-28 23:50:09 +00:00
|
|
|
/*!
|
|
|
|
* \brief Class that interprets the contents of a string
|
|
|
|
* and converts it into different types.
|
|
|
|
*/
|
2012-01-25 03:16:08 +00:00
|
|
|
class StringConverter
|
|
|
|
{
|
2011-10-01 18:45:20 +00:00
|
|
|
public:
|
2019-07-21 17:32:52 +00:00
|
|
|
StringConverter() = default;
|
|
|
|
~StringConverter() = default;
|
2011-10-01 18:45:20 +00:00
|
|
|
|
2014-09-14 17:08:32 +00:00
|
|
|
bool convert(const std::string& value, bool default_value);
|
2018-12-02 04:29:11 +00:00
|
|
|
int64_t convert(const std::string& value, int64_t default_value);
|
|
|
|
uint64_t convert(const std::string& value, uint64_t default_value);
|
|
|
|
int32_t convert(const std::string& value, int32_t default_value);
|
|
|
|
uint32_t convert(const std::string& value, uint32_t default_value);
|
|
|
|
int16_t convert(const std::string& value, int16_t default_value);
|
|
|
|
uint16_t convert(const std::string& value, uint16_t default_value);
|
2014-09-14 17:08:32 +00:00
|
|
|
float convert(const std::string& value, float default_value);
|
|
|
|
double convert(const std::string& value, double default_value);
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_STRING_CONVERTER_H
|