test(and fix) the utitle encoder
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8364 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
adc049d591
commit
7f05256bb7
2 changed files with 5 additions and 2 deletions
|
|
@ -10,10 +10,13 @@
|
||||||
%rename("%(title)s",match$parentNode$type="enum HelloEnum") "";
|
%rename("%(title)s",match$parentNode$type="enum HelloEnum") "";
|
||||||
%rename("%(ctitle)s",match$parentNode$type="enum ChaoEnum") "";
|
%rename("%(ctitle)s",match$parentNode$type="enum ChaoEnum") "";
|
||||||
|
|
||||||
|
%rename("%(utitle)s") CamelCase_5;
|
||||||
|
|
||||||
%define awk_cmd "%(command:awk '/^i/{print toupper($1)}' <<<)s" %enddef
|
%define awk_cmd "%(command:awk '/^i/{print toupper($1)}' <<<)s" %enddef
|
||||||
|
|
||||||
%rename(awk_cmd) "";
|
%rename(awk_cmd) "";
|
||||||
|
|
||||||
|
|
||||||
%inline
|
%inline
|
||||||
{
|
{
|
||||||
int camel_case_1(int);
|
int camel_case_1(int);
|
||||||
|
|
@ -21,6 +24,7 @@
|
||||||
int camel_case_3(int);
|
int camel_case_3(int);
|
||||||
int camel_case_4(int);
|
int camel_case_4(int);
|
||||||
int camel_case(int);
|
int camel_case(int);
|
||||||
|
int CamelCase_5(int);
|
||||||
int also_works_here(int);
|
int also_works_here(int);
|
||||||
|
|
||||||
enum HelloEnum {
|
enum HelloEnum {
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,8 @@ String *Swig_string_utitle(String *s) {
|
||||||
Seek(s,0,SEEK_SET);
|
Seek(s,0,SEEK_SET);
|
||||||
while ((c = Getc(s)) != EOF) {
|
while ((c = Getc(s)) != EOF) {
|
||||||
if (isupper(c)) {
|
if (isupper(c)) {
|
||||||
if (!first) Putc('_',ns);
|
if (first) Putc('_',ns);
|
||||||
first = 1;
|
first = 1;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
Putc(tolower(c),ns);
|
Putc(tolower(c),ns);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue