merge revisions 11243-11872 from trunk to gsoc2009-matevz

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12162 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-07-20 21:58:41 +00:00
commit ab1cd03979
387 changed files with 12383 additions and 4412 deletions

View file

@ -543,7 +543,13 @@ String *SwigType_namestr(const SwigType *t) {
Putc(' ', r);
Putc('>', r);
suffix = SwigType_templatesuffix(t);
Append(r, suffix);
if (Len(suffix) > 0) {
String *suffix_namestr = SwigType_namestr(suffix);
Append(r, suffix_namestr);
Delete(suffix_namestr);
} else {
Append(r, suffix);
}
Delete(suffix);
Delete(p);
return r;
@ -562,7 +568,10 @@ String *SwigType_str(SwigType *s, const_String_or_char_ptr id) {
int nelements, i;
if (id) {
result = NewString(id);
/* stringify the id expanding templates, for example when the id is a fully qualified templated class name */
String *id_str = NewString(id); /* unfortunate copy due to current const limitations */
result = SwigType_str(id_str, 0);
Delete(id_str);
} else {
result = NewStringEmpty();
}
@ -1134,6 +1143,25 @@ void SwigType_typename_replace(SwigType *t, String *pat, String *rep) {
Delete(elem);
}
/* -----------------------------------------------------------------------------
* SwigType_remove_global_scope_prefix()
*
* Removes the unary scope operator (::) prefix indicating global scope in all
* components of the type
* ----------------------------------------------------------------------------- */
SwigType *SwigType_remove_global_scope_prefix(const SwigType *t) {
SwigType *result;
const char *type = Char(t);
if (strncmp(type, "::", 2) == 0)
type += 2;
result = NewString(type);
Replaceall(result, ".::", ".");
Replaceall(result, "(::", "(");
Replaceall(result, "enum ::", "enum ");
return result;
}
/* -----------------------------------------------------------------------------
* SwigType_check_decl()
*