Conversion of properties
[GridLAB-D Core]


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_timestamp_stub (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_timestamp_stub (char *buffer, void *data, PROPERTY *prop)
int convert_to_void (char *buffer, void *data, PROPERTY *prop)
 Convert to a void This conversion ignores the data.


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 215 of file convert.c.

Referenced by convert_from_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 692 of file convert.c.

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 558 of file convert.c.

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 517 of file convert.c.

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 476 of file convert.c.

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 435 of file convert.c.

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 83 of file convert.c.

References A, complex::f, complex::i, PI, and complex::r.

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 765 of file convert.c.

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 661 of file convert.c.

References s_delegatedvalue::data, s_delegatedtype::to_string, and s_delegatedvalue::type.

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 50 of file convert.c.

Referenced by compare_real_li(), and compare_real_nl().

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 748 of file convert.c.

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 154 of file convert.c.

References s_keyword::name, s_keyword::next, and s_keyword::value.

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 342 of file convert.c.

Referenced by compare_integer16_li(), and compare_integer16_nl().

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 373 of file convert.c.

Referenced by compare_integer32_li(), and compare_integer32_nl().

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 404 of file convert.c.

References FMT_INT64, and int64.

Referenced by compare_integer64_li(), compare_integer64_nl(), compare_integer_li(), and compare_integer_nl().

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 599 of file convert.c.

References s_object_list::id, s_class_list::name, s_object_list::name, and s_object_list::oclass.

Referenced by exec_debug_cmd(), 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 216 of file convert.c.

References s_keyword::name, s_keyword::next, PF_CHARSET, SETDELIM, and s_keyword::value.

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 24 of file convert.c.

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 710 of file convert.c.

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 582 of file convert.c.

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 541 of file convert.c.

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 500 of file convert.c.

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 459 of file convert.c.

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 113 of file convert.c.

References A, CNOTATION_DEFAULT, complex::f, complex::i, PI, and complex::r.

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 773 of file convert.c.

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 677 of file convert.c.

References s_delegatedvalue::data, s_delegatedtype::from_string, and s_delegatedvalue::type.

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 71 of file convert.c.

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 757 of file convert.c.

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 193 of file convert.c.

References s_keyword::name, s_keyword::next, and s_keyword::value.

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 362 of file convert.c.

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 393 of file convert.c.

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 424 of file convert.c.

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 625 of file convert.c.

References s_class_list::name, object_find_by_id(), object_find_name(), and s_object_list::oclass.

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 276 of file convert.c.

References s_keyword::next, PF_CHARSET, 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 38 of file convert.c.


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