add firstlowercase encoder
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8436 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
75867b03a9
commit
52a50c6dc5
1 changed files with 25 additions and 3 deletions
|
|
@ -210,7 +210,7 @@ String *Swig_string_ucase(String *s) {
|
|||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_string_first_ucase()
|
||||
* Swig_string_first_upper()
|
||||
*
|
||||
* Make the first character in the string uppercase, leave all the
|
||||
* rest the same. This is used by the Ruby module to provide backwards
|
||||
|
|
@ -220,7 +220,7 @@ String *Swig_string_ucase(String *s) {
|
|||
* firstUpper -> FirstUpper
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
String *Swig_string_first_ucase(String *s) {
|
||||
String *Swig_string_first_upper(String *s) {
|
||||
String *ns = NewStringEmpty();
|
||||
char *cs = Char(s);
|
||||
if (cs && cs[0] != 0) {
|
||||
|
|
@ -230,6 +230,27 @@ String *Swig_string_first_ucase(String *s) {
|
|||
return ns;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_string_first_lower()
|
||||
*
|
||||
* Make the first character in the string lowercase, leave all the
|
||||
* rest the same. This is used by the Ruby module to provide backwards
|
||||
* compatibility with the old way of naming classes and constants. For
|
||||
* more info see the Ruby documentation.
|
||||
*
|
||||
* firstLower -> FirstLower
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
String *Swig_string_first_lower(String *s) {
|
||||
String *ns = NewStringEmpty();
|
||||
char *cs = Char(s);
|
||||
if (cs && cs[0] != 0) {
|
||||
Putc(tolower(cs[0]),ns);
|
||||
Append(ns, cs + 1);
|
||||
}
|
||||
return ns;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_string_typecode()
|
||||
*
|
||||
|
|
@ -757,7 +778,8 @@ Swig_init() {
|
|||
DohEncoding("lowercase", Swig_string_lower);
|
||||
DohEncoding("camelcase", Swig_string_ccase);
|
||||
DohEncoding("undercase", Swig_string_ucase);
|
||||
DohEncoding("firstuppercase", Swig_string_first_ucase);
|
||||
DohEncoding("firstuppercase", Swig_string_first_upper);
|
||||
DohEncoding("firstlowercase", Swig_string_first_lower);
|
||||
|
||||
/* Initialize the swig keys */
|
||||
Swig_keys_init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue