399
const char *CObjectInfo::QualName () {
400
if (! _QualName && _Name.empty() == false ) {
401
// for template instances the qualified name is the name of the template
399
const char *CObjectInfo::QualName (bool abs, bool tdef) {
400
if ((! _QualName && _Name.empty() == false) || abs != _abs || tdef != _tdef) {
401
// // for template instances the qualified name is the name of the template
402
402
CObjectInfo *obj = this;
403
if (TemplateInstance ())
404
obj = TemplateInstance ()->Template ();
403
// if (TemplateInstance ())
404
// obj = TemplateInstance ()->Template ();
406
406
// get the scope object
407
CObjectInfo *info = obj->QualifiedScope ();
408
if (!info) info = obj->AssignedScope ();
409
if (!info) info = obj->Scope ();
410
Array<const char*> scopes;
411
while (info && ! info->isAnonymous () &&
413
(info->NamespaceInfo () && ! info->FileInfo ()))) {
414
scopes.append (info->Name ());
415
info = info->Scope ();
407
CScopeInfo *info = obj->QualifiedScope ();
408
if (!info) info = obj->AssignedScope ();
409
if (!info) info = obj->Scope ();
411
// if this an anonymous (generated) template scope, skip it
412
while (info && info->isNamespace () && info->isAnonymous () &&
413
!info->GlobalScope ()) {
414
info = info->Scope ();
417
417
std::ostringstream qname;
418
for (long i = scopes.length () - 1; i >= 0; i--)
419
qname << scopes.lookup (i) << "::";
420
qname << _Name.c_str () << std::ends;
418
if (info->TypeInfo () && info->TypeInfo ()->isRecord ()) {
419
// if the scope has an associated type we can use CTypeInfo::TypeText ()
420
info->TypeInfo ()->TypeText (qname, 0, abs, tdef);
424
// if the scope is not a type we run through all the namespace
425
Array<const char*> scopes;
426
while (info && ! info->isAnonymous () &&
428
(info->NamespaceInfo () && ! info->FileInfo ()))) {
429
scopes.append (info->Name ());
430
info = info->Scope ();
434
for (long i = scopes.length () - 1; i >= 0; i--)
435
qname << scopes.lookup (i) << "::";
437
qname << _Name.c_str ();
421
438
_QualName = StrCol::dup (qname.str ().c_str ());
440
// remember these parameters, because on a different request the name
441
// has to be regenerated
423
445
return _QualName;