GUI/node_modules/slice2js/ice/cpp/src/slice2js/JsUtil.cpp
string
Slice::JsGenerator::fixId(const string& name)
{
    if(name.empty())
    {
        return name;
    }
    if(name[0] != ':')
    {
        return lookupKwd(name);
    }

    const StringList ids = splitScopedName(name);
    const StringList newIds = fixIds(ids);

    stringstream result;
    for(StringList::const_iterator j = newIds.begin(); j != newIds.end(); ++j)
    {
        if(j != newIds.begin())
        {
            result << '.';
        }
        result << *j;
    }
    return result.str();
}
//
// If the passed name is a scoped name, return the identical scoped name,
// but with all components that are JS keywords replaced by
// their "_"-prefixed version; otherwise, if the passed name is
// not scoped, but a JS keyword, return the "_"-prefixed name.
//
If the passed name is a scoped name, return the identical scoped name,
but with all components that are JS keywords replaced by
their "_"-prefixed version; otherwise, if the passed name is
not scoped, but a JS keyword, return the "_"-prefixed name.
If the passed name is a scoped name return the identical scoped name but with all components that are JS keywords replaced by their " _ " - prefixed version ; otherwise if the passed name is not scoped but a JS keyword return the " _ " - prefixed name .
string
Slice::JsGenerator::fixId(const string& name)
{
    if(name.empty())
    {
        return name;
    }
    if(name[0] != ':')
    {
        return lookupKwd(name);
    }
    const StringList ids = splitScopedName(name);
    const StringList newIds = fixIds(ids);
    stringstream result;
    for(StringList::const_iterator j = newIds.begin(); j != newIds.end(); ++j)
    {
        if(j != newIds.begin())
        {
            result << '.';
        }
        result << *j;
    }
    return result.str();
}
string Slice :: JsGenerator :: fixId ( const string & name ) { if ( name . empty ( ) ) { return name ; } if ( name [ 0 ] != ' ' ) { return lookupKwd ( name ) ; } const StringList ids = splitScopedName ( name ) ; const StringList newIds = fixIds ( ids ) ; stringstream result ; for ( StringList :: const_iterator j = newIds . begin ( ) ; j != newIds . end ( ) ; ++ j ) { if ( j != newIds . begin ( ) ) { result << ' ' ; } result << * j ; } return result . str ( ) ; }
If the passed name is a scoped name, return the identical scoped name,
but with all components that are JS keywords replaced by
their "_"-prefixed version; otherwise, if the passed name is
not scoped, but a JS keyword, return the "_"-prefixed name.
If the passed name is a scoped name return the identical scoped name but with all components that are JS keywords replaced by their " _ " - prefixed version ; otherwise if the passed name is not scoped but a JS keyword return the " _ " - prefixed name .