ITK Function Reference

(V10000.1.0.60_20160308.00)
Functions
Teamcenter String

Functions

FCLASSES_API char * stripBlanks (char *str)
 
FCLASSES_API void STRNG_clean_up_string (char *inputString)
 
FCLASSES_API logical STRNG_compare_wildcard_i (char escape, char any, char one, const char *pattern, const char *match)
 
FCLASSES_API logical STRNG_ends_with (const char *theString, const char *theEndString)
 
FCLASSES_API char * STRNG_find_first_char (const char *inputString, const char match)
 
FCLASSES_API char * STRNG_find_last_char (const char *inputString, const char match)
 
FCLASSES_API int STRNG_is_char (const char *val, char *c)
 
FCLASSES_API int STRNG_is_date (const char *val, date_t *d)
 
FCLASSES_API int STRNG_is_double (const char *val, double *n)
 
FCLASSES_API int STRNG_is_integer (const char *val, int *n)
 
FCLASSES_API int STRNG_is_logical (const char *val, logical *n)
 
FCLASSES_API void STRNG_limit_characters (char *inputString, const char *characterSet, char replacement)
 
FCLASSES_API char * STRNG_mb_strncat (char *szOutputString, const char *szInputString, const int iMaxLength)
 
FCLASSES_API char * STRNG_mb_strncpy (char *szOutputString, const char *szInputString, const int iMaxLength)
 
FCLASSES_API logical STRNG_mb_yesno (const char *szInputString)
 
FCLASSES_API void STRNG_MegaBytesToText (long int megaBytes, char text[50])
 
FCLASSES_API void STRNG_MegaBytesToText2 (long int megaBytes, char **text)
 
FCLASSES_API int STRNG_quote_xml (const char *input, char **output)
 
FCLASSES_API int STRNG_replace_str (const char *input, const char *strToBereplaced, const char *strToBeUsedInstead, char **output)
 
FCLASSES_API void STRNG_to_lower (char *inputString)
 
FCLASSES_API void STRNG_to_lower2 (const char *str, char **ustr)
 
FCLASSES_API void STRNG_to_upper (char *inputString)
 
FCLASSES_API void STRNG_to_upper2 (const char *str, char **ustr)
 
FCLASSES_API signed long long tc_atoll (const char *str)
 
FCLASSES_API void tc_str_contains_wildcard (const char *n, logical *contained)
 
FCLASSES_API void tc_str_contains_wildcard_at (const char *n, logical *contained, int *position)
 
FCLASSES_API int tc_strcasecmp (const char *s1, const char *s2)
 
FCLASSES_API char * tc_strcat (char *s1, const char *s2)
 
FCLASSES_API int tc_strcmp (const char *s1, const char *s2)
 
FCLASSES_API char * tc_strcpy (char *s1, const char *s2)
 
FCLASSES_API void tc_strdup (const char *str, char **dstr)
 
FCLASSES_API size_t tc_strlen (const char *s)
 
FCLASSES_API void tc_strlwr (const char *str, char **lstr)
 
FCLASSES_API int tc_strncasecmp (const char *s1, const char *s2, size_t len)
 
FCLASSES_API char * tc_strncpy (char *s1, const char *s2, size_t size)
 
FCLASSES_API char * tc_strstr (const char *s1, const char *s2)
 
FCLASSES_API char * tc_strtok (char *cptr, const char *seps)
 
FCLASSES_API char * tc_strtok_and_delimiter (char *cptr, const char *seps, char **matchedSep)
 
FCLASSES_API void tc_strupr (const char *str, char **ustr)
 

Detailed Description

Function Documentation

FCLASSES_API char* stripBlanks ( char *  str)

This returns a pointer to the first non-blank character in the given string after setting a \0 just after the last non-blank character. i.e. it returns a string with no leading or trailing spaces, having mangled the supplied string. Note that if you later free the string you must free the initial string (that you handed in), not the returned one.

stripTrailingBlanks(char* str) no longer exists. To duplicate functionality, just call stripBlanks on a string and IGNORE THE RETURNED POINTER!

FCLASSES_API void STRNG_clean_up_string ( char *  inputString)

Smash all ASCII non-alphanummeric characters to _ but leave multibyte characters alone

FCLASSES_API logical STRNG_compare_wildcard_i ( char  escape,
char  any,
char  one,
const char *  pattern,
const char *  match 
)

Checks if a pattern is found in a string, offering customer defined matching characters.


The special characters in the string from the pattern parameter are:

  • escape: this character is ignored and the following one is taken literally
  • any: matches any character (zero or more characters)
  • one: matches any character (one only)
Note
The wild characters are considered case sensitive, but not other in the pattern and match strings.

The following examples return true

STRNG_compare_wildcard_i ('@', '*', '.', "abc", "abc")
STRNG_compare_wildcard_i ('@', '*', '.', "*abc...", "abcANY")
STRNG_compare_wildcard_i ('@', '*', '.', "*abc...", "anything abcANY")
STRNG_compare_wildcard_i ('@', '*', '.', "@*abc...", "*abcANY")
Returns
Parameters
escape(I) Escape character to be used in the pattern ('\' for example)
any(I) Wild match character to be used in the pattern ('*' for instance)
one(I) Unique match character to be used in the pattern ('?' for instance).
It matches exactly one character.
pattern(I) Input pattern string
match(I) Input match string
FCLASSES_API logical STRNG_ends_with ( const char *  theString,
const char *  theEndString 
)

Checks if 'theString' ends with 'theEndString'

FCLASSES_API char* STRNG_find_first_char ( const char *  inputString,
const char  match 
)

Return a pointer (or NULL) to the first/last match of the given ASCII character, even in the face of multibyte characters. The given character must be a single-byte character

FCLASSES_API char* STRNG_find_last_char ( const char *  inputString,
const char  match 
)
FCLASSES_API int STRNG_is_char ( const char *  val,
char *  c 
)

Determines if a string is a unique character.

Returns
Parameters
val(I) Input string
c(O) char value
FCLASSES_API int STRNG_is_date ( const char *  val,
date_t d 
)

Determines if a string is a date.

Returns
Deprecated:
This API is deprecated starting Tc10.1.3, and will be removed from Tc12.0. Please use DATE_convert_formatted_string_to_date API instead, in the following fashion:
//Using the same parameter as for STRNG_is_date
DATE_convert_formatted_string_to_date(val, 0, true, false, d);

The call can also be made to be stringent by replacing false by true in the statement above.

Parameters
val(I) Input string
d(O) date structure value
FCLASSES_API int STRNG_is_double ( const char *  val,
double *  n 
)

Determines if a string is a Double.

Returns
Parameters
val(I) Input string
n(O) double value
FCLASSES_API int STRNG_is_integer ( const char *  val,
int *  n 
)

Determines if a string is an integer.

Returns
Parameters
val(I) Input string
n(O) integer value
FCLASSES_API int STRNG_is_logical ( const char *  val,
logical n 
)

Determines if a string is a logical.

Returns
Parameters
val(I) Input string
n(O) logical value
FCLASSES_API void STRNG_limit_characters ( char *  inputString,
const char *  characterSet,
char  replacement 
)

Replaces all characters not in characterSet by replacement (unless they are multibyte)

FCLASSES_API char* STRNG_mb_strncat ( char *  szOutputString,
const char *  szInputString,
const int  iMaxLength 
)
FCLASSES_API char* STRNG_mb_strncpy ( char *  szOutputString,
const char *  szInputString,
const int  iMaxLength 
)
FCLASSES_API logical STRNG_mb_yesno ( const char *  szInputString)
FCLASSES_API void STRNG_MegaBytesToText ( long int  megaBytes,
char  text[50] 
)
Deprecated:
This function is deprecated and will be removed from Tc12. In Tc10 onwards, please use STRNG_MegaBytesToText2

Returns a text version of given int in a form like 4.2M, 3K or 10G as appropriate

FCLASSES_API void STRNG_MegaBytesToText2 ( long int  megaBytes,
char **  text 
)

Returns a text version of given int in a form like 4.2M, 3K or 10G as appropriate

Parameters
text(I) (OF)
FCLASSES_API int STRNG_quote_xml ( const char *  input,
char **  output 
)

Quote XML using appropriate entities

Parameters
input(I)
output(OF)
FCLASSES_API int STRNG_replace_str ( const char *  input,
const char *  strToBereplaced,
const char *  strToBeUsedInstead,
char **  output 
)

Replaces the occurrence of string "strToBereplaced" with string "strToBeUsedInstead" in input string and fills the output string with the resultant string.

FCLASSES_API void STRNG_to_lower ( char *  inputString)

Converts A-Z to lower case in given string, coping even if it is a multibyte string. Please note this function does not work correctly for Hebrew text. For case like Hebrew text, you can use tc_strupr or tc_strlwr, or STRNG_to_lower2/STRNG_to_upper2. These functions call TEXT_* functions which take account of the localization settings on the machine. These functions correctly perform the upper/lower case for all character sets.

FCLASSES_API void STRNG_to_lower2 ( const char *  str,
char **  ustr 
)

This function calls TEXT_* functions which take account of the localization settings on the machine. This function correctly performs the upper/lower case for all character sets.

FCLASSES_API void STRNG_to_upper ( char *  inputString)

Converts A-Z to upper case in given string, coping even if it is a multibyte string. Please note this function does not work correctly for Hebrew text. For case like Hebrew text, you can use tc_strupr or tc_strlwr, or STRNG_to_lower2/STRNG_to_upper2. These functions call TEXT_* functions which take account of the localization settings on the machine. These functions correctly perform the upper/lower case for all character sets.

FCLASSES_API void STRNG_to_upper2 ( const char *  str,
char **  ustr 
)

This function calls TEXT_* functions which take account of the localization settings on the machine. This function correctly performs the upper/lower case for all character sets.

FCLASSES_API signed long long tc_atoll ( const char *  str)
FCLASSES_API void tc_str_contains_wildcard ( const char *  n,
logical contained 
)
FCLASSES_API void tc_str_contains_wildcard_at ( const char *  n,
logical contained,
int *  position 
)
FCLASSES_API int tc_strcasecmp ( const char *  s1,
const char *  s2 
)
FCLASSES_API char* tc_strcat ( char *  s1,
const char *  s2 
)
FCLASSES_API int tc_strcmp ( const char *  s1,
const char *  s2 
)
FCLASSES_API char* tc_strcpy ( char *  s1,
const char *  s2 
)
FCLASSES_API void tc_strdup ( const char *  str,
char **  dstr 
)
FCLASSES_API size_t tc_strlen ( const char *  s)
FCLASSES_API void tc_strlwr ( const char *  str,
char **  lstr 
)

Converts a string of characters to lower case.

Parameters
str(I) Input string
lstr(OF) Output string
FCLASSES_API int tc_strncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)
FCLASSES_API char* tc_strncpy ( char *  s1,
const char *  s2,
size_t  size 
)
FCLASSES_API char* tc_strstr ( const char *  s1,
const char *  s2 
)
FCLASSES_API char* tc_strtok ( char *  cptr,
const char *  seps 
)
FCLASSES_API char* tc_strtok_and_delimiter ( char *  cptr,
const char *  seps,
char **  matchedSep 
)
FCLASSES_API void tc_strupr ( const char *  str,
char **  ustr 
)