model_server/project/src/proj.h.cxx
// this function removes any leading and trailing slash ('/') from a
// string and translates any embedded slashes to dots ('.')
// the result is appended to the supplied genstring. This is useful for
// forming the name of an xref file from a project path.
this function removes any leading and trailing slash ('/') from a
string and translates any embedded slashes to dots ('.')
the result is appended to the supplied genstring. This is useful for
forming the name of an xref file from a project path.
this function removes any leading and trailing slash ( ' / ' ) from a string and translates any embedded slashes to dots ( ' . ' ) the result is appended to the supplied genstring . This is useful for forming the name of an xref file from a project path .
static void projname_to_xref_basename(char *proj_name, genString &translated_proj_name)
{
    Initialize(projname_to_xref_filename);
    if (proj_name) {
        char *duplicate = new char[strlen(proj_name)+1];
        if (duplicate) {
            strcpy(duplicate, proj_name); 
            char *p = duplicate;
            if (*p == '/') p++;           
            char *pp = p;                 
            while (p && *p) {
                if (*p == '/') *p = '.';
                p++;
            }
            if (*(p-1) == '.') *(p-1) = '\0';
            translated_proj_name += pp;   
            delete[] duplicate;
        }
    }
    return;
}
static void projname_to_xref_basename ( char * proj_name , genString & translated_proj_name ) { Initialize ( projname_to_xref_filename ) ; if ( proj_name ) { char * duplicate = new char [ strlen ( proj_name ) + 1 ] ; if ( duplicate ) { strcpy ( duplicate , proj_name ) ; char * p = duplicate ; if ( * p == ' ' ) p ++ ; char * pp = p ; while ( p && * p ) { if ( * p == ' ' ) * p = ' ' ; p ++ ; } if ( * ( p - 1 ) == ' ' ) * ( p - 1 ) = ' \0 ' ; translated_proj_name += pp ; delete [ ] duplicate ; } } return ; }
this function removes any leading and trailing slash ('/') from a
string and translates any embedded slashes to dots ('.')
this function removes any leading and trailing slash ( ' / ' ) from a string and translates any embedded slashes to dots ( ' . ' )
// do translation in a copy // skip over initial slash // remember start of interesting part // translate / to . and remove a terminal . // translated part of duplicate