MVault 1.0.0
Simple c++ database
Loading...
Searching...
No Matches
Functions
From string functions

All functions for working with reading data from csv. More...

Functions

template<class T >
bool mvlt::FromString (const std::string &stringToCopyDataFrom, T &data) noexcept
 A template method for providing an interface converting string to a any type.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::string &data) noexcept
 FromString specialization for working with std::string.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, bool &data) noexcept
 FromString specialization for working with bool.
 
template<class T >
bool mvlt::FromStringDoubleAndFloat (const std::string &stringToCopyDataFrom, T &data) noexcept
 FromStringDoubleAndFloat template for working with float and double.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, float &data) noexcept
 FromString specialization for working with float.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, double &data) noexcept
 FromString specialization for working with double.
 
template<class T >
bool mvlt::FromStringSignedInt (const std::string &stringToCopyDataFrom, T &data) noexcept
 FromStringSignedInt template for working with all signed integers.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::int16_t &data) noexcept
 FromString specialization for working with std::int16_t int.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::int32_t &data) noexcept
 FromString specialization for working with std::int32_t.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::int64_t &data) noexcept
 FromString specialization for working with std::int64_t.
 
template<class T >
bool mvlt::FromStringUnsignedInt (const std::string &stringToCopyDataFrom, T &data) noexcept
 FromStringSignedInt template for working with all unsigned signed integers.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::uint16_t &data) noexcept
 FromString specialization for working with std::uint16_t.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::uint32_t &data) noexcept
 FromString specialization for working with std::uint32_t.
 
template<>
bool mvlt::FromString (const std::string &stringToCopyDataFrom, std::uint64_t &data) noexcept
 FromString specialization for working with unsigned unsigned std::uint64_t.
 

Detailed Description

All functions for working with reading data from csv.

Function Documentation

◆ FromString() [1/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
bool data 
)
inlinenoexcept

FromString specialization for working with bool.

If the string is true, then data will be true and the function will return true. If the string is false, then data will be false and the function will return true. If the string is not true or false, the function returns false.

Template Parameters
<bool>bool as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type bool
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [2/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
double data 
)
inlinenoexcept

FromString specialization for working with double.

Template Parameters
<double>double as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type float
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [3/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
float data 
)
inlinenoexcept

FromString specialization for working with float.

Template Parameters
<float>float as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type float
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [4/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::int16_t &  data 
)
inlinenoexcept

FromString specialization for working with std::int16_t int.

Template Parameters
<std::int16_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [5/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::int32_t &  data 
)
inlinenoexcept

FromString specialization for working with std::int32_t.

Template Parameters
<std::int32_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [6/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::int64_t &  data 
)
inlinenoexcept

FromString specialization for working with std::int64_t.

Template Parameters
<std::int64_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type std::int64_t
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [7/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::string &  data 
)
inlinenoexcept

FromString specialization for working with std::string.

Template Parameters
<std::string>string as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type std::string
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [8/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::uint16_t &  data 
)
inlinenoexcept

FromString specialization for working with std::uint16_t.

Template Parameters
<std::uint16_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type unsigned int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [9/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::uint32_t &  data 
)
inlinenoexcept

FromString specialization for working with std::uint32_t.

Template Parameters
<std::uint32_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type unsigned int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [10/11]

template<>
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
std::uint64_t &  data 
)
inlinenoexcept

FromString specialization for working with unsigned unsigned std::uint64_t.

Template Parameters
<std::uint64_t>int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type unsigned long int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromString() [11/11]

template<class T >
bool mvlt::FromString ( const std::string &  stringToCopyDataFrom,
T data 
)
inlinenoexcept

A template method for providing an interface converting string to a any type.

This function allows you to use the same interface inside the Vault for any class, since this function accepts any type. Therefore, if you do not plan to use the functionality of saving to files, then there will be no problems when using a custom type. At the same time, if you plan to work with files, you can specialize this function for each required type.

Template Parameters
<T>Any type of data
Parameters
[in]stringToCopyDataFromthe string to be converted to type T
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromStringDoubleAndFloat()

template<class T >
bool mvlt::FromStringDoubleAndFloat ( const std::string &  stringToCopyDataFrom,
T data 
)
inlinenoexcept

FromStringDoubleAndFloat template for working with float and double.

Template Parameters
<T>floatating type
<float>float type
<double>double type
Parameters
[in]stringToCopyDataFromthe string to be converted to type float
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromStringSignedInt()

template<class T >
bool mvlt::FromStringSignedInt ( const std::string &  stringToCopyDataFrom,
T data 
)
inlinenoexcept

FromStringSignedInt template for working with all signed integers.

Template Parameters
<T>signed integer as a type
<std::int16_t>std::int16_t int as a type
<std::int32_t>std::int32_t int as a type
<std::int64_t>std::int64_t int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false

◆ FromStringUnsignedInt()

template<class T >
bool mvlt::FromStringUnsignedInt ( const std::string &  stringToCopyDataFrom,
T data 
)
inlinenoexcept

FromStringSignedInt template for working with all unsigned signed integers.

Template Parameters
<T>unsigned integer as a type
<unsignedshort> unsigned short int as a type
<unsignedint> unsigned signed int as a type
<unsignedlong> unsigned long int as a type
<unsignedlong long> unsigned long long int as a type
Parameters
[in]stringToCopyDataFromthe string to be converted to type int
[out]datathe variable where the converted string will be written
Returns
Returns true if the conversion was successful, otherwise it returns false