ConversionUtils.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/core/utils/ConversionUtils.hpp"

strToInt32

Namespace: oatpp::utils::conversion

  1. String to 32-bit integer.
    • @param str - string as const char*.
    • @return - 32-bit integer value.
    v_int32 strToInt32(const char* str)
    
  2. String to 32-bit integer.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 32-bit integer value.
    v_int32 strToInt32(const oatpp::String& str, bool& success)
    

strToInt32

Namespace: oatpp::utils::conversion

  1. String to 32-bit integer.
    • @param str - string as const char*.
    • @return - 32-bit integer value.
    v_int32 strToInt32(const char* str)
    
  2. String to 32-bit integer.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 32-bit integer value.
    v_int32 strToInt32(const oatpp::String& str, bool& success)
    

strToInt64

Namespace: oatpp::utils::conversion

  1. String to 64-bit integer.
    • @param str - string as const char*.
    • @return - 64-bit integer value.
    v_int64 strToInt64(const char* str)
    
  2. String to 64-bit integer.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 64-bit integer value.
    v_int64 strToInt64(const oatpp::String& str, bool& success)
    

strToInt64

Namespace: oatpp::utils::conversion

  1. String to 64-bit integer.
    • @param str - string as const char*.
    • @return - 64-bit integer value.
    v_int64 strToInt64(const char* str)
    
  2. String to 64-bit integer.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 64-bit integer value.
    v_int64 strToInt64(const oatpp::String& str, bool& success)
    

int32ToCharSequence

Namespace: oatpp::utils::conversion

Convert 32-bit integer to it's string representation.

  • @param value - 32-bit integer value.
  • @param data - buffer to write data to.
  • @return - length of the resultant string.

v_int32 int32ToCharSequence(v_int32 value, p_char8 data)

int64ToCharSequence

Namespace: oatpp::utils::conversion

Convert 64-bit integer to it's string representation.

  • @param value - 64-bit integer value.
  • @param data - buffer to write data to.
  • @return - length of the resultant string.

v_int32 int64ToCharSequence(v_int64 value, p_char8 data)

int32ToStr

Namespace: oatpp::utils::conversion

Convert 32-bit integer to it's string representation.

  • @param value - 32-bit integer value.
  • @return - value as oatpp::String

oatpp::String int32ToStr(v_int32 value)

int64ToStr

Namespace: oatpp::utils::conversion

Convert 64-bit integer to it's string representation.

  • @param value - 64-bit integer value.
  • @return - value as oatpp::String

oatpp::String int64ToStr(v_int64 value)

int32ToStdStr

Namespace: oatpp::utils::conversion

Convert 32-bit integer to it's string representation.

  • @param value - 32-bit integer value.
  • @return - value as std::string

std::string int32ToStdStr(v_int32 value)

int64ToStdStr

Namespace: oatpp::utils::conversion

Convert 64-bit integer to it's string representation.

  • @param value - 64-bit integer value.
  • @return - value as std::string

std::string int64ToStdStr(v_int64 value)

primitiveToCharSequence

Namespace: oatpp::utils::conversion

Write value of primitive type (int, float, etc.) as it's string representation with pattern.

  • @tparam T - primitive value type (int, float, etc.).
  • @param value - actual value.
  • @param data - buffer to write data to.
  • @param pattern - pattern as for sprintf.
  • @return - length of the resultant string.

template<typename T>
v_int32 primitiveToCharSequence(T value, p_char8 data, const char* pattern)

primitiveToStr

Namespace: oatpp::utils::conversion

  1. Write value of primitive type (int, float, etc.) as it's string representation with pattern.
    • @tparam T - primitive value type (int, float, etc.).
    • @param value - actual value.
    • @param pattern - pattern as for sprintf.
    • @return - length of the resultant string.
    template<typename T>
    oatpp::String primitiveToStr(T value, const char* pattern)
    
  2. Write value of oatpp-primitive type (oatpp::Int32, oatpp::Int64, oatpp::Boolean, etc.) as it's string representation.
    • @tparam T - oatpp-primitive type (oatpp::Int32, oatpp::Int64, oatpp::Boolean, etc.).
    • @param primitive - ObjectWrapper.
    • @return - value as string.
    template<class T>
    oatpp::String
    primitiveToStr(const oatpp::data::mapping::type::PolymorphicWrapper<T>& primitive)
    

strToFloat32

Namespace: oatpp::utils::conversion

  1. String to 32-bit float.
    • @param str - string as const char*.
    • @return - 32-bit float value.
    v_float32 strToFloat32(const char* str)
    
  2. String to 32-bit float.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 32-bit float value.
    v_float32 strToFloat32(const oatpp::String& str, bool& success)
    

strToFloat32

Namespace: oatpp::utils::conversion

  1. String to 32-bit float.
    • @param str - string as const char*.
    • @return - 32-bit float value.
    v_float32 strToFloat32(const char* str)
    
  2. String to 32-bit float.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 32-bit float value.
    v_float32 strToFloat32(const oatpp::String& str, bool& success)
    

strToFloat64

Namespace: oatpp::utils::conversion

  1. String to 64-bit float.
    • @param str - string as const char*.
    • @return - 64-bit float value.
    v_float64 strToFloat64(const char* str)
    
  2. String to 64-bit float.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 64-bit float value.
    v_float64 strToFloat64(const oatpp::String& str, bool& success)
    

strToFloat64

Namespace: oatpp::utils::conversion

  1. String to 64-bit float.
    • @param str - string as const char*.
    • @return - 64-bit float value.
    v_float64 strToFloat64(const char* str)
    
  2. String to 64-bit float.
    • @param str - string as oatpp::String.
    • @param success - out parameter. true if operation was successful. false otherwise.
    • @return - 64-bit float value.
    v_float64 strToFloat64(const oatpp::String& str, bool& success)
    

float32ToCharSequence

Namespace: oatpp::utils::conversion

Convert 32-bit float to it's string representation.

  • @param value - 32-bit float value.
  • @param data - buffer to write data to.
  • @return - length of the resultant string.

v_int32 float32ToCharSequence(v_float32 value, p_char8 data)

float64ToCharSequence

Namespace: oatpp::utils::conversion

Convert 64-bit float to it's string representation.

  • @param value - 64-bit float value.
  • @param data - buffer to write data to.
  • @return - length of the resultant string.

v_int32 float64ToCharSequence(v_float64 value, p_char8 data)

float32ToStr

Namespace: oatpp::utils::conversion

Convert 32-bit float to it's string representation.

  • @param value - 32-bit float value.
  • @return - value as oatpp::String

oatpp::String float32ToStr(v_float32 value)

float64ToStr

Namespace: oatpp::utils::conversion

Convert 64-bit float to it's string representation.

  • @param value - 64-bit float value.
  • @return - value as oatpp::String

oatpp::String float64ToStr(v_float64 value)

boolToStr

Namespace: oatpp::utils::conversion

Convert boolean to it's string representation.

  • @param value - boolean value.
  • @return - value as oatpp::String;

oatpp::String boolToStr(bool value)

strToBool

Namespace: oatpp::utils::conversion

parse string to boolean value.

  • @param str - string to parse.
  • @param success - out parameter. true if operation was successful. false otherwise.
  • @return - boolean value.

bool strToBool(const oatpp::String& str, bool& success)

primitiveToStr

Namespace: oatpp::utils::conversion

  1. Write value of primitive type (int, float, etc.) as it's string representation with pattern.
    • @tparam T - primitive value type (int, float, etc.).
    • @param value - actual value.
    • @param pattern - pattern as for sprintf.
    • @return - length of the resultant string.
    template<typename T>
    oatpp::String primitiveToStr(T value, const char* pattern)
    
  2. Write value of oatpp-primitive type (oatpp::Int32, oatpp::Int64, oatpp::Boolean, etc.) as it's string representation.
    • @tparam T - oatpp-primitive type (oatpp::Int32, oatpp::Int64, oatpp::Boolean, etc.).
    • @param primitive - ObjectWrapper.
    • @return - value as string.
    template<class T>
    oatpp::String
    primitiveToStr(const oatpp::data::mapping::type::PolymorphicWrapper<T>& primitive)