Skip to content

Commit

Permalink
Refactoring functions about append and connect.
Browse files Browse the repository at this point in the history
  • Loading branch information
activesys committed May 3, 2013
1 parent d487b65 commit a5365f3
Show file tree
Hide file tree
Showing 12 changed files with 1,220 additions and 591 deletions.
18 changes: 9 additions & 9 deletions cstl/cstl_basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ extern void basic_string_init_cstr(basic_string_t* pt_basic_string, const void*
* Initialize basic_string container specific sub value string.
* @param pt_basic_string basic_string container.
* @param cpv_value_string value string.
* @param t_length length of sub value string.
* @param t_len length of sub value string.
* @return void.
* @remarks if pt_basic_string == NULL or cpv_value_string == NULL, then the behavior is undefined. pt_basic_string muse be
* created by create_basic_string(), otherwise the behavior is undefined. if t_length greater then the max_size then
* created by create_basic_string(), otherwise the behavior is undefined. if t_len greater then the max_size then
* the behavior is undefined.
*/
extern void basic_string_init_subcstr(basic_string_t* pt_basic_string, const void* cpv_value_string, size_t t_length);
extern void basic_string_init_subcstr(basic_string_t* pt_basic_string, const void* cpv_value_string, size_t t_len);

/**
* Initialize basic_string container with an exist basic_string container.
Expand Down Expand Up @@ -1331,19 +1331,19 @@ extern void basic_string_range_replace(
* @param it_begin the position of first element in the range.
* @param it_end the position of first element beyond the range.
* @param cpt_replace replace basic_string container.
* @param t_position copy position.
* @param t_length copy length.
* @param t_pos copy position.
* @param t_len copy length.
* @return void.
* @remarks if pt_basic_string == NULL or cpt_replace == NULL, then the behavior is undefined. pt_basic_string and cpt_replace
* must be initialized, otherwise the behavior is undefined. the element type of two basic_strings must be same,
* otherwise the behavior is undefined. [it_begin, it_end) must be valid range for pt_basic_string, otherwise the
* behavior is undefined. t_position is valid position for cpt_replace, otherwise the behavior is undefined. if
* t_length == NPOS or t_position + t_length >= basic_string_size(cpt_replace), the user all remain cpt_replace that
* t_len == NPOS or t_position + t_len >= basic_string_size(cpt_replace), the user all remain cpt_replace that
* started from t_position. if pt_basic_string == cpt_replace, then the behavior is undefined.
*/
extern void basic_string_range_replace_substring(
basic_string_t* pt_basic_string, basic_string_iterator_t it_begin, basic_string_iterator_t it_end,
const basic_string_t* cpt_replace, size_t t_position, size_t t_length);
const basic_string_t* cpt_replace, size_t t_pos, size_t t_len);

/**
* Replace elements in a basic_string at a specificed range with specificed value string.
Expand All @@ -1367,12 +1367,12 @@ extern void basic_string_range_replace_cstr(
* @param it_begin the position of first element in the range.
* @param it_end the position of first element beyond the range.
* @param cpv_value_string value string.
* @param t_length sub value string length.
* @param t_len sub value string length.
* @return void.
* @remarks if pt_basic_string == NULL or cpv_value_string == NULL, then the behavior is undefined. pt_basic_string
* must be initialized, otherwise the behavior is undefined. the element type of basic_string and value string must
* be same, otherwise the behavior is undefined. [it_begin, it_end) must be valid range for pt_basic_string,
* otherwise the behavior is undefined. if t_length == NPOS or t_length is equal ot or greater than the length of
* otherwise the behavior is undefined. if t_len == NPOS or t_len is equal ot or greater than the length of
* cpv_value_string, then use all cpv_value_string.
*/
extern void basic_string_range_replace_subcstr(
Expand Down
3 changes: 2 additions & 1 deletion cstl/cstl_basic_string_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ extern size_t _basic_string_rep_get_length(const _basic_string_rep_t* cpt_rep);
/**
* Set length
* @param pt_rep pointer to basic_string_rep_t;
* @param t_len length
* @return void
* @remarks pt_rep must not be NULL and length muse be less than capacity.
*/
extern void _basic_string_rep_set_length(_basic_string_rep_t* pt_rep, size_t t_length);
extern void _basic_string_rep_set_length(_basic_string_rep_t* pt_rep, size_t t_len);

/**
* Check whether the rep is shared.
Expand Down
Loading

0 comments on commit a5365f3

Please sign in to comment.