library/src/blockclass/subclasses/BP_ApplicationHelpGenerator.cc
// Lookup an option group by name.
Lookup an option group by name.
Lookup an option group by name .
P_BP_AHG_OPTION_GROUP BP_ApplicationHelpGenerator::lookupOptionGroupByName(char * group_name)
{
	if(!group_name)
		return NULL;
	if(!this->groups || !this->group_n)
		return NULL;
	size_t group_name_len = bpstrlen(group_name);
	size_t group_search_len = 0;
	size_t n = 0;
	for(; n < this->group_n; n++)
	{
		group_search_len = bpstrlen(this->groups[n].group_name);
		if(group_search_len != group_name_len)
			continue;
		if(memcmp(this->groups[n].group_name, group_name, group_search_len) == 0)
			return &this->groups[n];
	}
	return NULL;
}
P_BP_AHG_OPTION_GROUP BP_ApplicationHelpGenerator :: lookupOptionGroupByName ( char * group_name ) { if ( ! group_name ) return NULL ; if ( ! this -> groups || ! this -> group_n ) return NULL ; size_t group_name_len = bpstrlen ( group_name ) ; size_t group_search_len = 0 ; size_t n = 0 ; for ( ; n < this -> group_n ; n ++ ) { group_search_len = bpstrlen ( this -> groups [ n ] . group_name ) ; if ( group_search_len != group_name_len ) continue ; if ( memcmp ( this -> groups [ n ] . group_name , group_name , group_search_len ) == 0 ) return & this -> groups [ n ] ; } return NULL ; }
Lookup an option group by name.
Lookup an option group by name .
// ensure we have a group name // ensure we have groups to search // group name // group search length // calculate group name len // ensure that the search length matches the name len // compare name and return the found group if match // exit here if we can't find any group to lookup