The "command" encoder was mostly intended for use in `%rename` - most uses can be achieved using the "regex" encoder, so we recommend using that instead. The "command" encoder suffers from a number of issues - as the documentation for it admitted, "[it] is extremely slow compared to all the other [encoders] as it involves spawning a separate process and using it for many declarations is not recommended" and that it "should generally be avoided because of performance considerations". But it's also not portable. The design assumes that `/bin/sh` supports `<<<` but that's a bash-specific feature so it doesn't work on platforms where `/bin/sh` is not bash - it fails on Debian, Ubuntu and probably some other Linux distros, plus most non-Linux platforms. Microsoft Windows doesn't even have a /bin/sh as standard. Finally, no escaping of the passed string is done, so it has potential security issues (though at least with %rename the input is limited to valid C/C++ symbol names). Fixes #1806
64 lines
1 KiB
OpenEdge ABL
64 lines
1 KiB
OpenEdge ABL
%module rename_camel
|
|
|
|
%rename("%(utitle)s",%$isfunction,%$ismember) "";
|
|
%rename("%(ctitle)s",%$isvariable,%$ismember) "";
|
|
|
|
%inline {
|
|
struct GeometryFactory
|
|
{
|
|
void createPointFromInternalCoord(int);
|
|
void BIG_METHOD(int);
|
|
};
|
|
|
|
class ByteOrderValues {
|
|
|
|
public:
|
|
void readHEX();
|
|
static int ENDIAN_BIG;
|
|
};
|
|
|
|
}
|
|
|
|
|
|
%rename(CamelCase1) camel_case_1;
|
|
%rename("%(camelcase)s") camel_case_2;
|
|
%rename("%(ctitle)s") camel_case_3;
|
|
|
|
|
|
%rename("%(utitle)s") CamelCase_5;
|
|
|
|
%rename("%(regex:/\\(.*i.*\\)/\\U\\1/)s") "";
|
|
|
|
%rename("%(title)s",regexmatch$parentNode$type="enum .*") "";
|
|
|
|
%inline
|
|
{
|
|
int camel_case_1(int);
|
|
int camel_case_2(int);
|
|
int camel_case_3(int);
|
|
int camel_case_4(int);
|
|
int camel_case(int);
|
|
int CamelCase_5(int);
|
|
int also_works_here(int);
|
|
|
|
enum HelloEnum {
|
|
hello, hi_there
|
|
};
|
|
|
|
|
|
enum ChaoEnum {
|
|
bye, see_you
|
|
};
|
|
|
|
int import(int);
|
|
int foo(int);
|
|
|
|
}
|
|
|
|
%rename("%(lowercase)s",sourcefmt="%(regex:/GSL_(.*)/\\1/)s",%$isfunction) "";
|
|
%inline {
|
|
void GSL_Hello() {}
|
|
}
|
|
|
|
|
|
|