Woolz Image Processing  Version 1.8.3
WlzStringUtils.c File Reference

Miscellaneous string handling functions. More...

Functions

int WlzStringMatchValue (int *datum, const char *targetStr, const char *testStr,...)
 Given a destination pointer, a string, and a null terminated list of string, enum pairs. The strings are matched and the first match is used to fill in the destination with the matched enum's value. More...
 
int WlzValueMatchString (char **datum, int targetVal, const char *testStr,...)
 Given a destination pointer, a value, and a null terminated list of string, enum pairs. The values are matched and the first match is used to fill in the destination with the matched enum's string. More...
 
char * WlzStringWhiteSpSkip (char *str)
 Removes all white space characters (as determined by isspace(3)) from the given string. More...
 
char * WlzStringWhiteSpSkipLeading (char *str)
 Removes all white space characters (as determined by isspace(3)) from the given string. More...
 
char * WlzStringToUpper (char *str)
 Converts the string to all upper case using toupper(3). More...
 
char * WlzStringToLower (char *str)
 Converts the string to all lower case using tolower(3). More...
 
char * WlzStringUnescape (char *str)
 Replaces escape sequences in the given string in place. Hexadecimal and octal escape sequences are not allowed and result in an error. More...
 
char * WlzStringCopyReplace (char *inS, const char *matchS, char rep, int inPlace)
 Optionally copies the given string then replaces all instances of characters in the match string with the replacement character. More...
 

Detailed Description

Miscellaneous string handling functions.

Author
Bill Hill
Date
March 1999
Version
Id
8252f417a277ef1874c8f3e32d7c93cec7fe692a
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

◆ WlzStringUnescape()

char* WlzStringUnescape ( char *  str)

Replaces escape sequences in the given string in place. Hexadecimal and octal escape sequences are not allowed and result in an error.

Returns
The given string or NULL on error.
Parameters
strGiven string.

◆ WlzStringCopyReplace()

char* WlzStringCopyReplace ( char *  inS,
const char *  matchS,
char  rep,
int  inPlace 
)

Optionally copies the given string then replaces all instances of characters in the match string with the replacement character.

Returns
New string (or given string if done in place) or NULL on error.
Parameters
inSThe given string.
matchSString with characters to match in the given string.
repReplacement character.
inPlaceDo the replacement in the given string rather than a copy if non-zero.

References AlcStrDup().

Referenced by WlzEffWritePointsVtkFieldValues(), and WlzEffWritePointsVtkScalarValues().