fix and make publicly available the upper case and lower case conversion functions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8394fb8dff
commit
8c8a47c03d
2 changed files with 13 additions and 6 deletions
|
|
@ -94,7 +94,7 @@ String *Swig_string_escape(String *s) {
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_string_upper()
|
* Swig_string_upper()
|
||||||
*
|
*
|
||||||
* Takes a string object and convets it to all caps.
|
* Takes a string object and returns a copy that is uppercase
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *Swig_string_upper(String *s) {
|
String *Swig_string_upper(String *s) {
|
||||||
|
|
@ -102,6 +102,7 @@ String *Swig_string_upper(String *s) {
|
||||||
int c;
|
int c;
|
||||||
ns = NewString("");
|
ns = NewString("");
|
||||||
|
|
||||||
|
Seek(s,0,SEEK_SET);
|
||||||
while ((c = Getc(s)) != EOF) {
|
while ((c = Getc(s)) != EOF) {
|
||||||
Putc(toupper(c),ns);
|
Putc(toupper(c),ns);
|
||||||
}
|
}
|
||||||
|
|
@ -111,7 +112,7 @@ String *Swig_string_upper(String *s) {
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_string_lower()
|
* Swig_string_lower()
|
||||||
*
|
*
|
||||||
* Takes a string object and convets it to all lower.
|
* Takes a string object and returns a copy that is lowercase
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *Swig_string_lower(String *s) {
|
String *Swig_string_lower(String *s) {
|
||||||
|
|
@ -119,6 +120,7 @@ String *Swig_string_lower(String *s) {
|
||||||
int c;
|
int c;
|
||||||
ns = NewString("");
|
ns = NewString("");
|
||||||
|
|
||||||
|
Seek(s,0,SEEK_SET);
|
||||||
while ((c = Getc(s)) != EOF) {
|
while ((c = Getc(s)) != EOF) {
|
||||||
Putc(tolower(c),ns);
|
Putc(tolower(c),ns);
|
||||||
}
|
}
|
||||||
|
|
@ -129,7 +131,8 @@ String *Swig_string_lower(String *s) {
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* Swig_string_title()
|
* Swig_string_title()
|
||||||
*
|
*
|
||||||
* Takes a string object and convets it to all lower.
|
* Takes a string object and returns a copy that is lowercase with first letter
|
||||||
|
* capitalized
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
String *Swig_string_title(String *s) {
|
String *Swig_string_title(String *s) {
|
||||||
|
|
@ -138,6 +141,7 @@ String *Swig_string_title(String *s) {
|
||||||
int c;
|
int c;
|
||||||
ns = NewString("");
|
ns = NewString("");
|
||||||
|
|
||||||
|
Seek(s,0,SEEK_SET);
|
||||||
while ((c = Getc(s)) != EOF) {
|
while ((c = Getc(s)) != EOF) {
|
||||||
Putc(first ? toupper(c) : tolower(c),ns);
|
Putc(first ? toupper(c) : tolower(c),ns);
|
||||||
first = 0;
|
first = 0;
|
||||||
|
|
|
||||||
|
|
@ -437,6 +437,9 @@ extern String *Swig_scopename_last(String *s);
|
||||||
extern String *Swig_scopename_first(String *s);
|
extern String *Swig_scopename_first(String *s);
|
||||||
extern String *Swig_scopename_suffix(String *s);
|
extern String *Swig_scopename_suffix(String *s);
|
||||||
extern int Swig_scopename_check(String *s);
|
extern int Swig_scopename_check(String *s);
|
||||||
|
extern String *Swig_string_lower(String *s);
|
||||||
|
extern String *Swig_string_upper(String *s);
|
||||||
|
extern String *Swig_string_title(String *s);
|
||||||
|
|
||||||
extern void Swig_init();
|
extern void Swig_init();
|
||||||
extern void Swig_warn(const char *filename, int line, const char *msg);
|
extern void Swig_warn(const char *filename, int line, const char *msg);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue