New string encoding method, "schemify".
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d66d113312
commit
c7d465ecaa
1 changed files with 16 additions and 1 deletions
|
|
@ -255,6 +255,21 @@ String *Swig_string_first_lower(String *s) {
|
||||||
return ns;
|
return ns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------------------
|
||||||
|
* Swig_string_schemify()
|
||||||
|
*
|
||||||
|
* Replace underscores with dashes, to make identifiers look nice to Schemers.
|
||||||
|
*
|
||||||
|
* under_scores -> under-scores
|
||||||
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
String *Swig_string_schemify(String *s) {
|
||||||
|
String *ns = NewString(s);
|
||||||
|
Replaceall(ns, "_", "-");
|
||||||
|
return ns;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_string_typecode()
|
* Swig_string_typecode()
|
||||||
*
|
*
|
||||||
|
|
@ -898,6 +913,7 @@ Swig_init() {
|
||||||
DohEncoding("mangle", Swig_string_emangle);
|
DohEncoding("mangle", Swig_string_emangle);
|
||||||
DohEncoding("command", Swig_string_command);
|
DohEncoding("command", Swig_string_command);
|
||||||
DohEncoding("rxspencer", Swig_string_rxspencer);
|
DohEncoding("rxspencer", Swig_string_rxspencer);
|
||||||
|
DohEncoding("schemify", Swig_string_schemify);
|
||||||
|
|
||||||
/* aliases for the case encoders */
|
/* aliases for the case encoders */
|
||||||
DohEncoding("uppercase", Swig_string_upper);
|
DohEncoding("uppercase", Swig_string_upper);
|
||||||
|
|
@ -907,7 +923,6 @@ Swig_init() {
|
||||||
DohEncoding("firstuppercase", Swig_string_first_upper);
|
DohEncoding("firstuppercase", Swig_string_first_upper);
|
||||||
DohEncoding("firstlowercase", Swig_string_first_lower);
|
DohEncoding("firstlowercase", Swig_string_first_lower);
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the swig keys */
|
/* Initialize the swig keys */
|
||||||
Swig_keys_init();
|
Swig_keys_init();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue