model_server/xref/src/XrefQuery.cxx
///////////////////////////////////////////////////////////////////////////////////
// filter found links according to the input kind
filter found links according to the input kind
filter found links according to the input kind
void XrefQuery::filter_kind(ddKind kind, symbolArr& result, 
			    symbolArr& rtl_root_arr, const symbolPtr xrsym, 
			    const int trg, const linkType& link)
{
    Initialize(XrefQuery::filter_kind);
    symbolPtr rsym;
    if(kind >= 0)
    {
	ddKind xrsym_kind = xrsym.get_kind();
	char const *xrsym_name = xrsym.get_name();
	ForEachS(rsym, result)
	{
	    if ( rsym.get_kind() == kind) 
	    {
		if ((trg == SHOW_MEMBER_FUNCS || trg == SHOW_MEMBER_DATA) && 
		    (xrsym_kind == DD_CLASS || xrsym_kind == DD_INTERFACE) &&
		    (link == is_using)) 
		{
		    char const *rsym_name = rsym.get_name();
                    if (xrsym_name && rsym_name) {
                        if (!strchr(xrsym_name, '@')) {
			    if (strstr(rsym_name, xrsym_name) == rsym_name) {
			        rtl_root_arr.insert_last(rsym);
                             }
                        }
                        else {
                            const char *xr_context = strchr(xrsym_name, '@');
                            int xrlen = xr_context - xrsym_name - 1;
                            xr_context++;
                            const char *r_context = strchr(rsym_name, '@');
                            if (r_context) r_context++;
                            if (r_context && xr_context &&
                                (strncmp(rsym_name, xrsym_name, xrlen) == 0) &&
                                (strcmp(r_context, xr_context) == 0)) {
			        rtl_root_arr.insert_last(rsym);
                            }
                        }
                    }
		}
		else
		    rtl_root_arr.insert_last(rsym);
	    }
	}
    }
    else
    {
        ForEachS(rsym, result)
	    rtl_root_arr.insert_last(rsym);
    }
}
void XrefQuery :: filter_kind ( ddKind kind , symbolArr & result , symbolArr & rtl_root_arr , const symbolPtr xrsym , const int trg , const linkType & link ) { Initialize ( XrefQuery :: filter_kind ) ; symbolPtr rsym ; if ( kind >= 0 ) { ddKind xrsym_kind = xrsym . get_kind ( ) ; char const * xrsym_name = xrsym . get_name ( ) ; ForEachS ( rsym , result ) { if ( rsym . get_kind ( ) == kind ) { if ( ( trg == SHOW_MEMBER_FUNCS || trg == SHOW_MEMBER_DATA ) && ( xrsym_kind == DD_CLASS || xrsym_kind == DD_INTERFACE ) && ( link == is_using ) ) { char const * rsym_name = rsym . get_name ( ) ; if ( xrsym_name && rsym_name ) { if ( ! strchr ( xrsym_name , ' ' ) ) { if ( strstr ( rsym_name , xrsym_name ) == rsym_name ) { rtl_root_arr . insert_last ( rsym ) ; } } else { const char * xr_context = strchr ( xrsym_name , ' ' ) ; int xrlen = xr_context - xrsym_name - 1 ; xr_context ++ ; const char * r_context = strchr ( rsym_name , ' ' ) ; if ( r_context ) r_context ++ ; if ( r_context && xr_context && ( strncmp ( rsym_name , xrsym_name , xrlen ) == 0 ) && ( strcmp ( r_context , xr_context ) == 0 ) ) { rtl_root_arr . insert_last ( rsym ) ; } } } } else rtl_root_arr . insert_last ( rsym ) ; } } } else { ForEachS ( rsym , result ) rtl_root_arr . insert_last ( rsym ) ; } }
filter found links according to the input kind
filter found links according to the input kind
/* Handle symbols that have context attached to the 
                               name of the symbol, for example, anonymous classes
                               in Java. The name and the context should be 
                               matched separately.
                             */