Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsutil.C File Reference

#include <dsutil.h>

Functions

unsigned long dsAtoul (char *src)
unsigned long dsAtoul (istream &is)
unsigned long dsAtoul (istream &is, int n)
void size_strcpy (char *dest, const char *src, int size)
void size_strcpy (char *dest, const char *src, int size, char *file, int line)
char * ds_strndup (const char *s, int len)
char * ds_strdup (const char *s)
char * ds_strnchr (char *s, char c, int len)
char * ds_zalloc (size_t size)
char * trim (char *src)
char * unsplit (char delem,...)
int split (char delem, char *str,...)
int split (char delem, char *str, int nf,...)

Function Documentation

char* ds_strdup const char *    s
 

return dynamic copy of string s no strlen calls inside

char* ds_strnchr char *    s,
char    c,
int    len
 

search character c in substring of s of length len usable for mmap

char* ds_strndup const char *    s,
int    len
 

return dynamic copy of substring of string s of length len. if len is greater than length of s return s no strlen calls inside, so it is safe to use this function with mmap()

char* ds_zalloc size_t    size
 

Allocate buffer and fill it by 0

unsigned long dsAtoul std::istream &    src,
int    n
 

This function convert first n character os stream src to unsigned long if read character is not numeric throws exception

Returns:
conversion result
Exceptions:
AutoStrException if conversion couldn't be done

unsigned long dsAtoul istream &    is
 

unsigned long dsAtoul char *    src
 

This function convert decimal ascii src to unsigned long if first passed character is not numeric throws exception

Returns:
conversion result
Exceptions:
AutoStrException if conversion couldn't be done

void size_strcpy char *    dest,
const char *    src,
int    size,
char *    file,
int    line
 

void size_strcpy char *    dest,
const char *    src,
int    size
 

copy string form src to dest. if length of src greater than size AutoStrException thrown

int split char    delem,
char *    str,
int    nf,
...   
 

Same as above, but number of fields to extract can be specified

int split char    delem,
char *    str,
...   
 

split string into dinamicaly allocated strings by delem.
All arguments have to be char**, last is 0

char* trim char *    src
 

remove leading and trailing spaces in-place

char* unsplit char    delem,
...   
 


Generated on Mon May 16 18:26:58 2005 for libdms4 by doxygen1.3-rc2