IUP: String Utilities

IUP - Portable User Interface

String Utilities
[Utilities]


Detailed Description

See iup_str.h


Functions

char * iupStrDup (const char *str)
int iupStrEqual (const char *str1, const char *str2)
int iupStrEqualNoCase (const char *str1, const char *str2)
int iupStrEqualPartial (const char *str1, const char *str2)
int iupStrBoolean (const char *str)
void iupStrLineCount (const char *str, int *max_len, int *num_lin)
const char * iupStrNextLine (const char *str, int *len)
int iupStrCountChar (const char *str, int c)
char * iupStrCopyUntil (char **str, int c)
char * iupStrGetMemory (int size)
void iupStrLower (char *dstr, const char *sstr)
int iupStrGetRGB (const char *str, unsigned char *r, unsigned char *g, unsigned char *b)
int iupStrToInt (const char *str, int *i)
int iupStrToIntInt (const char *str, int *i1, int *i2, char sep)
int iupStrToFloat (const char *str, float *f)
int iupStrToFloatFloat (const char *str, float *f1, float *f2, char sep)
int iupStrToStrStr (const char *str, char *str1, char *str2, char sep)
char * iupStrFileGetExt (const char *file_name)
char * iupStrFileGetTitle (const char *file_name)
char * iupStrFileGetPath (const char *file_name)
char * iupStrFileMakeFileName (const char *path, const char *title)

Function Documentation

char* iupStrDup const char *  str  ) 
 

Returns a copy of the given string. If str is NULL it will return NULL.

int iupStrEqual const char *  str1,
const char *  str2
 

Returns a non zero value if the two strings are equal. str1 or str2 can be NULL.

int iupStrEqualNoCase const char *  str1,
const char *  str2
 

Returns a non zero value if the two strings are equal but ignores case. str1 or str2 can be NULL.

int iupStrEqualPartial const char *  str1,
const char *  str2
 

Returns a non zero value if the two strings are equal up to a number of characters defined by the strlen of the second string. str1 or str2 can be NULL.

int iupStrBoolean const char *  str  ) 
 

Returns 1 if the string is "1", "YES", "ON" or "TRUE".
Returns 0 if the string is "0", "NO", "OFF" or "FALSE", or the string is NULL or empty.

void iupStrLineCount const char *  str,
int *  max_len,
int *  num_lin
 

Returns the number of lines and the size of the largest line in a string. Detects also CR/LF pairs.

const char* iupStrNextLine const char *  str,
int *  len
 

Returns the a pointer to the next line and the size of the current line. Detects also CR/LF pairs. If str is NULL it will return NULL.

int iupStrCountChar const char *  str,
int  c
 

Returns the number of repetitions of the character occours in the string.

char* iupStrCopyUntil char **  str,
int  c
 

Returns a new string containing a copy of the string up to the character. The string is then incremented to after the position of the character.

char* iupStrGetMemory int  size  ) 
 

Returns a buffer with the specified size+1.
The buffer is resused after 10 calls. It must NOT be freed. Use size=-1 to free all the internal buffers.

void iupStrLower char *  dstr,
const char *  sstr
 

Converts a string into lower case.

int iupStrGetRGB const char *  str,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b
 

Extract a RGB triple from the string.

int iupStrToInt const char *  str,
int *  i
 

Converts the string to an int. The string must contains only the integer value. Returns a a non zero value if sucessfull.

int iupStrToIntInt const char *  str,
int *  i1,
int *  i2,
char  sep
 

Converts the string to two int. The string must contains two integer values in sequence, separated by the given character (usually 'x' or ':'). Returns the number of converted values. Values not extracted are not changed.

int iupStrToFloat const char *  str,
float *  f
 

Converts the string to an float. The string must contains only the real value. Returns a a non zero value if sucessfull.

int iupStrToFloatFloat const char *  str,
float *  f1,
float *  f2,
char  sep
 

Converts the string to two float. The string must contains two real values in sequence, separated by the given character (usually 'x' or ':'). Returns the number of converted values. Values not extracted are not changed.

int iupStrToStrStr const char *  str,
char *  str1,
char *  str2,
char  sep
 

Extract two strings from the string. separated by the given character (usually 'x' or ':'). Returns the number of converted values. Values not extracted are not changed.

char* iupStrFileGetExt const char *  file_name  ) 
 

Returns the file extension of a file name.

char* iupStrFileGetTitle const char *  file_name  ) 
 

Returns the file title of a file name.

char* iupStrFileGetPath const char *  file_name  ) 
 

Returns the file path of a file name.

char* iupStrFileMakeFileName const char *  path,
const char *  title
 

Concat path and title addind '/' between if path does not have it.