string_array.h
Go to the documentation of this file.
1 /*!**********************************************************************
2 *
3 * @copyright Copyright (C) 2016 Siemens Aktiengesellschaft.\n
4 * All rights reserved.
5 *
6 *************************************************************************
7 *
8 * @file string_array.h
9 * @date Aug 19, 2016
10 * @brief String array module header file.
11 *
12 * String Array is used to collect different #string_t string objects.
13 * By #string_array_to_string() function it gives the capability to concatenate the strings.
14 *
15 ************************************************************************/
16 
17 #ifndef STRING_ARRAY_H_
18 #define STRING_ARRAY_H_
19 
20 #include "string_type.h"
21 
28 #define DEFAULT_INCREMENT_VALUE 5
29 
34 typedef struct string_array_item_t
35 {
39 
43 typedef struct string_array_t
44 {
51 
67 
83 
99 
116 
124 
134 
145 
146 #endif //STRING_ARRAY_H_
mcl_size_t total_length
Total length of string array.
Definition: string_array.h:49
mcl_size_t count
Item count.
Definition: string_array.h:46
mcl_size_t index
Item index.
Definition: string_array.h:47
void string_array_destroy(string_array_t **array)
Destroys the string array handle.
Definition: string_array.c:174
E_MCL_ERROR_CODE
MCL Error code definitions. Every function returning an error code uses this enum values...
Definition: mcl_common.h:137
string_t * string_array_get(string_array_t *array, mcl_size_t index)
To get the string_t string object at a specified index.
Definition: string_array.c:114
E_MCL_ERROR_CODE string_array_initialize(mcl_size_t count, string_array_t **array)
String array initialize method.
Definition: string_array.c:19
string_array_item_t * items
Item of string array.
Definition: string_array.h:45
mcl_bool_t destroy
To decide whether to call string_destroy() for specific item in the array when destroying the string ...
Definition: string_array.h:37
E_MCL_ERROR_CODE string_array_set(string_array_t *array, mcl_size_t index, string_t *string)
To set the string item at a specified index in the string array.
size_t mcl_size_t
Definition: mcl_common.h:38
E_MCL_ERROR_CODE string_array_set_increment(string_array_t *array, mcl_size_t increment_value)
Sets the increment value of the array.
Definition: string_array.c:58
mcl_uint8_t mcl_bool_t
Definition: mcl_common.h:47
string_t * string
String object.
Definition: string_array.h:36
String type module header file.
string_t * string_array_to_string(string_array_t *array)
To concatenate the strings in the array.
Definition: string_array.c:132
E_MCL_ERROR_CODE string_array_add(string_array_t *array, string_t *string, mcl_bool_t destroy)
Adds an string_t string object into the array.
Definition: string_array.c:70
mcl_size_t increment_value
Increment value.
Definition: string_array.h:48