SHAPER  9.12.0
XAO::XaoUtils Class Reference

Utilities class to convert types. More...

Static Public Member Functions

static std::string intToString (int value)
 Converts an integer into a string. More...
 
static int stringToInt (const std::string &value)
 Converts a string into an integer. More...
 
static std::string doubleToString (double value)
 Converts a double into a string. More...
 
static double stringToDouble (const std::string &value)
 Converts a string into a double. More...
 
static std::string booleanToString (bool value)
 Converts a boolean into a string. More...
 
static bool stringToBoolean (const std::string &value)
 Converts a string into a boolean. More...
 
static std::string dimensionToString (XAO::Dimension dimension)
 Converts a Dimension to string. More...
 
static XAO::Dimension stringToDimension (const std::string &dimension)
 Converts a string into a Dimension. More...
 
static std::string fieldTypeToString (XAO::Type type)
 Converts a Type to string. More...
 
static XAO::Type stringToFieldType (const std::string &type)
 Converts a string into a Type. More...
 
static std::string shapeFormatToString (XAO::Format format)
 Converts a Format to string. More...
 
static XAO::Format stringToShapeFormat (const std::string &format)
 Converts a string into a Format. More...
 

Detailed Description

Utilities class to convert types.

Member Function Documentation

◆ intToString()

std::string XaoUtils::intToString ( int  value)
static

Converts an integer into a string.

Parameters
valuethe integer to convert.
Returns
the string.

◆ stringToInt()

int XaoUtils::stringToInt ( const std::string &  value)
static

Converts a string into an integer.

Parameters
valuethe string to convert.
Returns
the integer value.
Exceptions
XAO_Exceptionif value cannot be converted to string.

◆ doubleToString()

std::string XaoUtils::doubleToString ( double  value)
static

Converts a double into a string.

Parameters
valuethe double to convert.
Returns
the string.

◆ stringToDouble()

double XaoUtils::stringToDouble ( const std::string &  value)
static

Converts a string into a double.

Parameters
valuethe string to convert.
Returns
the double value.
Exceptions
XAO_Exceptionif value cannot be converted to string.

◆ booleanToString()

std::string XaoUtils::booleanToString ( bool  value)
static

Converts a boolean into a string.

Parameters
valuethe boolean to convert.
Returns
the string.

◆ stringToBoolean()

bool XaoUtils::stringToBoolean ( const std::string &  value)
static

Converts a string into a boolean.

Parameters
valuethe string to convert.
Returns
the boolean value.
Exceptions
XAO_Exceptionif value cannot be converted to boolean.
Note
accepted values are "true", "1", "false", "0".

◆ dimensionToString()

std::string XaoUtils::dimensionToString ( XAO::Dimension  dimension)
static

Converts a Dimension to string.

Parameters
dimensionthe Dimension to convert.
Returns
the dimension as a string.
Exceptions
XAO_Exception

◆ stringToDimension()

XAO::Dimension XaoUtils::stringToDimension ( const std::string &  dimension)
static

Converts a string into a Dimension.

Parameters
dimensionthe dimension as a string.
Returns
the converted Dimension.
Exceptions
XAO_Exceptionif dimension cannot be converted.

◆ fieldTypeToString()

std::string XaoUtils::fieldTypeToString ( XAO::Type  type)
static

Converts a Type to string.

Parameters
typethe Type to convert.
Returns
the Type as a string.
Exceptions
XAO_Exception

◆ stringToFieldType()

XAO::Type XaoUtils::stringToFieldType ( const std::string &  type)
static

Converts a string into a Type.

Parameters
typethe Type as a string.
Returns
the converted Type.
Exceptions
XAO_Exceptionif type cannot be converted.

◆ shapeFormatToString()

std::string XaoUtils::shapeFormatToString ( XAO::Format  format)
static

Converts a Format to string.

Parameters
formatthe Format to convert.
Returns
the Format as a string.
Exceptions
XAO_Exception

◆ stringToShapeFormat()

XAO::Format XaoUtils::stringToShapeFormat ( const std::string &  format)
static

Converts a string into a Format.

Parameters
formatthe Format as a string.
Returns
the converted Format.
Exceptions
XAO_Exceptionif format cannot be converted.