Conversion of properties


Detailed Description

The convert module handles conversion object properties and strings.


Defines

#define SETDELIM   "|"
 Convert from an set Converts a set property to a string.

Functions

int convert_from_boolean (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a boolean data type Converts a boolean data type reference to a string.
int convert_from_char1024 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a char1024 Converts a char1024 property to a string.
int convert_from_char256 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a char256 Converts a char256 property to a string.
int convert_from_char32 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a char32 Converts a char32 property to a string.
int convert_from_char8 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a char8 Converts a char8 property to a string.
int convert_from_complex (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a complex Converts a complex property to a string.
int convert_from_complex_array (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a complex_array data type Converts a complex_array data type reference to a string.
int convert_from_delegated (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a delegated data type Converts a delegated data type reference to a string.
int convert_from_double (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a double Converts from a double property to the string.
int convert_from_double_array (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a double_array data type Converts a double_array data type reference to a string.
int convert_from_enumeration (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from an enumeration Converts an enumeration property to a string.
int convert_from_int16 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from an int16 Converts an int16 property to a string.
int convert_from_int32 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from an int32 Converts an int32 property to a string.
int convert_from_int64 (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from an int64 Converts an int64 property to a string.
int convert_from_object (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from an object Converts an object reference to a string.
int convert_from_set (char *buffer, int size, void *data, PROPERTY *prop)
int convert_from_void (char *buffer, int size, void *data, PROPERTY *prop)
 Convert from a void This conversion does not change the data.
int convert_to_boolean (char *buffer, void *data, PROPERTY *prop)
 Convert to a boolean data type Converts a string to a boolean data type property.
int convert_to_char1024 (char *buffer, void *data, PROPERTY *prop)
 Convert to a char1024 Converts a string to a char1024 property.
int convert_to_char256 (char *buffer, void *data, PROPERTY *prop)
 Convert to a char256 Converts a string to a char256 property.
int convert_to_char32 (char *buffer, void *data, PROPERTY *prop)
 Convert to a char32 Converts a string to a char32 property.
int convert_to_char8 (char *buffer, void *data, PROPERTY *prop)
 Convert to a char8 Converts a string to a char8 property.
int convert_to_complex (char *buffer, void *data, PROPERTY *prop)
 Convert to a complex Converts a string to a complex property.
int convert_to_complex_array (char *buffer, void *data, PROPERTY *prop)
 Convert to a complex_array data type Converts a string to a complex_array data type property.
int convert_to_delegated (char *buffer, void *data, PROPERTY *prop)
 Convert to a delegated data type Converts a string to a delegated data type property.
int convert_to_double (char *buffer, void *data, PROPERTY *prop)
 Convert to a double Converts a string to a double property.
int convert_to_double_array (char *buffer, void *data, PROPERTY *prop)
 Convert to a double_array data type Converts a string to a double_array data type property.
int convert_to_enumeration (char *buffer, void *data, PROPERTY *prop)
 Convert to an enumeration Converts a string to an enumeration property.
int convert_to_int16 (char *buffer, void *data, PROPERTY *prop)
 Convert to an int16 Converts a string to an int16 property.
int convert_to_int32 (char *buffer, void *data, PROPERTY *prop)
 Convert to an int32 Converts a string to an int32 property.
int convert_to_int64 (char *buffer, void *data, PROPERTY *prop)
 Convert to an int64 Converts a string to an int64 property.
int convert_to_object (char *buffer, void *data, PROPERTY *prop)
 Convert to an object Converts a string to an object property.
int convert_to_set (char *buffer, void *data, PROPERTY *prop)
 Convert to a set Converts a string to a set property.
int convert_to_void (char *buffer, void *data, PROPERTY *prop)
 Convert to a void This conversion ignores the data.
int convert_unit_double (char *buffer, char *unit, double *data)
 Convert a string to a double with a given unit.


Define Documentation

#define SETDELIM   "|"

Convert from an set Converts a set property to a string.

Returns:
the number of character written to the string

Definition at line 271 of file convert.cpp.

Referenced by convert_from_set(), and convert_to_set().


Function Documentation

int convert_from_boolean ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a boolean data type Converts a boolean data type reference to a string.

Returns:
the number of characters written to the string

Definition at line 788 of file convert.cpp.

int convert_from_char1024 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a char1024 Converts a char1024 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 639 of file convert.cpp.

int convert_from_char256 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a char256 Converts a char256 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 595 of file convert.cpp.

int convert_from_char32 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a char32 Converts a char32 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 552 of file convert.cpp.

int convert_from_char8 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a char8 Converts a char8 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 509 of file convert.cpp.

int convert_from_complex ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a complex Converts a complex property to a string.

This function uses the global variable global_complex_format to perform the conversion.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 101 of file convert.cpp.

References class_find_property(), output_error(), and unit_convert_ex().

int convert_from_complex_array ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a complex_array data type Converts a complex_array data type reference to a string.

Returns:
the number of character written to the string

Definition at line 862 of file convert.cpp.

int convert_from_delegated ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a delegated data type Converts a delegated data type reference to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 757 of file convert.cpp.

int convert_from_double ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a double Converts from a double property to the string.

This function uses the global variable global_double_format to perform the conversion.

Returns:
the number of characters written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 52 of file convert.cpp.

References class_find_property(), output_error(), and unit_convert_ex().

int convert_from_double_array ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a double_array data type Converts a double_array data type reference to a string.

Returns:
the number of character written to the string

Definition at line 845 of file convert.cpp.

int convert_from_enumeration ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from an enumeration Converts an enumeration property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 201 of file convert.cpp.

int convert_from_int16 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from an int16 Converts an int16 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 416 of file convert.cpp.

int convert_from_int32 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from an int32 Converts an int32 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 447 of file convert.cpp.

int convert_from_int64 ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from an int64 Converts an int64 property to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 478 of file convert.cpp.

References FMT_INT64, and int64.

int convert_from_object ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from an object Converts an object reference to a string.

Returns:
the number of character written to the string
Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 682 of file convert.cpp.

References object_current_namespace(), and object_get_namespace().

Referenced by object_name(), object_saveall(), object_saveall_xml(), and object_saveall_xml_old().

int convert_from_set ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Parameters:
buffer  pointer to the string buffer
size  size of the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 272 of file convert.cpp.

References int64, PF_CHARSET, and SETDELIM.

Referenced by cmex_object_list(), object_dump(), and object_saveall().

int convert_from_void ( char *  buffer,
int  size,
void *  data,
PROPERTY *  prop 
)

Convert from a void This conversion does not change the data.

Returns:
6, the number of characters written to the buffer, 0 if not enough space
Parameters:
buffer  a pointer to the string buffer
size  the size of the string buffer
data  a pointer to the data that is not changed
prop  a pointer to keywords that are supported

Definition at line 26 of file convert.cpp.

int convert_to_boolean ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a boolean data type Converts a string to a boolean data type property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete

Definition at line 807 of file convert.cpp.

int convert_to_char1024 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a char1024 Converts a string to a char1024 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 663 of file convert.cpp.

int convert_to_char256 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a char256 Converts a string to a char256 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 619 of file convert.cpp.

int convert_to_char32 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a char32 Converts a string to a char32 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 576 of file convert.cpp.

int convert_to_char8 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a char8 Converts a string to a char8 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 533 of file convert.cpp.

int convert_to_complex ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a complex Converts a string to a complex property.

This function uses the global variable global_complex_format to perform the conversion.

Returns:
1 when only real is read, 2 imaginary part is also read, 3 when notation is also read, 0 on failure, -1 is conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 160 of file convert.cpp.

References output_error().

int convert_to_complex_array ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a complex_array data type Converts a string to a complex_array data type property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete

Definition at line 870 of file convert.cpp.

int convert_to_delegated ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a delegated data type Converts a string to a delegated data type property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 773 of file convert.cpp.

int convert_to_double ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a double Converts a string to a double property.

This function uses the global variable global_double_format to perform the conversion.

Returns:
1 on success, 0 on failure, -1 is conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 89 of file convert.cpp.

int convert_to_double_array ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a double_array data type Converts a string to a double_array data type property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete

Definition at line 854 of file convert.cpp.

int convert_to_enumeration ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to an enumeration Converts a string to an enumeration property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 240 of file convert.cpp.

References output_error().

int convert_to_int16 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to an int16 Converts a string to an int16 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 436 of file convert.cpp.

int convert_to_int32 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to an int32 Converts a string to an int32 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 467 of file convert.cpp.

int convert_to_int64 ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to an int64 Converts a string to an int64 property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 498 of file convert.cpp.

References FMT_INT64.

int convert_to_object ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to an object Converts a string to an object property.

Returns:
1 on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 721 of file convert.cpp.

References object_find_by_id(), and object_find_name().

Referenced by cmex_get(), cmex_set(), and exec_debug_cmd().

int convert_to_set ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a set Converts a string to a set property.

Returns:
number of values read on success, 0 on failure, -1 if conversion was incomplete
Parameters:
buffer  a pointer to the string buffer
data  a pointer to the data
prop  a pointer to keywords that are supported

Definition at line 336 of file convert.cpp.

References output_error(), PF_CHARSET, SETDELIM, and strnicmp.

int convert_to_void ( char *  buffer,
void *  data,
PROPERTY *  prop 
)

Convert to a void This conversion ignores the data.

Returns:
always 1, indicated data was successfully ignored
Parameters:
buffer  a pointer to the string buffer that is ignored
data  a pointer to the data that is not changed
prop  a pointer to keywords that are supported

Definition at line 40 of file convert.cpp.

int convert_unit_double ( char *  buffer,
char *  unit,
double *  data 
)

Convert a string to a double with a given unit.

Returns:
1 on success, 0 on failure

Definition at line 877 of file convert.cpp.

References unit_convert().

Referenced by convert_to_loadshape().


GridLAB-DTM Version 2.0
An open-source project initiated by the US Department of Energy