Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
TEXT_p_t PLIST_callout_col::evaluate_auto_data( PLIST_row_p_t row, TEXT_p_t in_text)
{
TEXT_p_t out_text=TEXT_init_string(""), auto_text=NULL, p1, p2 ;
TEXT_p_t symbol_text=TEXT_init_string(PLIST_CALLOUT_TEXT_SYMBOL) ;
TEXT_p_t final_text ;
int symbol_text_length = TEXT_count_characters(symbol_text) ;

if (TEXT_find_string(&p2, in_text, symbol_text))
{
auto_text = get_callout_text(row) ;
}

/* Replace every occurrence of PLIST_CALLOUT_TEXT_SYMBOL with auto text */
p1 = in_text ;
while(TEXT_find_string(&p2, p1, symbol_text))
{
TEXT_p_t temp = TEXT_extract_between(p1, p2) ;
out_text = TEXT_append(out_text, temp) ;
TEXT_free(temp) ;

out_text = TEXT_append(out_text, auto_text) ;
p1 = TEXT_skip_characters(p2, symbol_text_length) ;
}

out_text = TEXT_append(out_text, p1) ;

if (auto_text) TEXT_free(auto_text) ;
TEXT_free(symbol_text) ;

final_text =this->PLIST_callout_col::BASE_CLASS::evaluate_auto_data
(row, out_text) ;
TEXT_free(out_text) ;

return final_text ;
}
Posted
Updated 24-Apr-15 0:07am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900