avr/cpp/collection/StrDefs.h File Reference

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define STR_NULL   ""
#define END_LINE   "\x0D\x0A"

Typedefs

typedef char char_t
typedef const char_t cchar_t
typedef char_tstr_t
typedef const char_tcstr_t

Functions

uint16_t StrLength (const char *s)
char * StrJoin (char *dest, const char *src)
int StrCompare (const char *s1, const char *s2)
int StrICompare (const char *s1, const char *s2)
int StrNCompare (const char *s1, const char *s2, size_t maxlen)
int StrNICompare (const char *s1, const char *s2, size_t maxlen)
char * StrCopy (char *dest, const char *src)
char * StrNCopy (char *dest, const char *src, size_t maxlen)
int ToInteger (const char *s)
double ToDouble (const char *s)
double ToDoubleEx (const char *s, char **endptr)
char * ToString (int value, char *string, int radix)
int DoubleToString (char *buffer, double value)
char * FindChar (char *s, int c, size_t n)
char * StrAlloc (size_t size)
char * StrRealloc (char *block, size_t size)
char * StrToUpper (char *s)
char * StrToLower (char *s)
char * StrFind (const char *s1, const char *s2)
char * StrIFind (const char *s1, const char *s2)


Define Documentation

#define END_LINE   "\x0D\x0A"

Definition at line 36 of file StrDefs.h.

#define STR_NULL   ""

Definition at line 35 of file StrDefs.h.


Typedef Documentation

typedef const char_t cchar_t

Definition at line 39 of file StrDefs.h.

typedef char char_t

Definition at line 38 of file StrDefs.h.

typedef const char_t* cstr_t

Definition at line 41 of file StrDefs.h.

typedef char_t* str_t

Definition at line 40 of file StrDefs.h.


Function Documentation

int DoubleToString ( char *  buffer,
double  value 
) [inline]

Definition at line 55 of file StrDefs.h.

00055 { return sprintf(buffer, "%f", value); }

char* FindChar ( char *  s,
int  c,
size_t  n 
) [inline]

Definition at line 56 of file StrDefs.h.

00056 { return (char *)memchr((void *)s, c, n); }

char* StrAlloc ( size_t  size  )  [inline]

Definition at line 57 of file StrDefs.h.

00057 { return (char *)malloc(size * sizeof(char)); }

int StrCompare ( const char *  s1,
const char *  s2 
) [inline]

Definition at line 45 of file StrDefs.h.

00045 { return strcmp(s1, s2); }

char* StrCopy ( char *  dest,
const char *  src 
) [inline]

Definition at line 49 of file StrDefs.h.

00049 { return strcpy(dest, src); }

char* StrFind ( const char *  s1,
const char *  s2 
) [inline]

Definition at line 61 of file StrDefs.h.

00061 { return strstr(s1, s2); }

int StrICompare ( const char *  s1,
const char *  s2 
) [inline]

Definition at line 46 of file StrDefs.h.

00046 { return strcasecmp(s1, s2); }

char* StrIFind ( const char *  s1,
const char *  s2 
) [inline]

Definition at line 62 of file StrDefs.h.

00062 { return strcasestr(s1, s2); }

char* StrJoin ( char *  dest,
const char *  src 
) [inline]

Definition at line 44 of file StrDefs.h.

00044 { return strcat(dest, src); }

uint16_t StrLength ( const char *  s  )  [inline]

Definition at line 43 of file StrDefs.h.

00043 { return (uint16_t)strlen(s); }

int StrNCompare ( const char *  s1,
const char *  s2,
size_t  maxlen 
) [inline]

Definition at line 47 of file StrDefs.h.

00047 { return strncmp(s1, s2, maxlen); }

char* StrNCopy ( char *  dest,
const char *  src,
size_t  maxlen 
) [inline]

Definition at line 50 of file StrDefs.h.

00050 { return strncpy(dest, src, maxlen); }

int StrNICompare ( const char *  s1,
const char *  s2,
size_t  maxlen 
) [inline]

Definition at line 48 of file StrDefs.h.

00048 { return strncasecmp(s1, s2, maxlen); }

char* StrRealloc ( char *  block,
size_t  size 
) [inline]

Definition at line 58 of file StrDefs.h.

00058 { return (char *)realloc((char *)block, size * sizeof(char)); }

char* StrToLower ( char *  s  )  [inline]

Definition at line 60 of file StrDefs.h.

00060 { return strlwr(s); }

char* StrToUpper ( char *  s  )  [inline]

Definition at line 59 of file StrDefs.h.

00059 { return strupr(s); }

double ToDouble ( const char *  s  )  [inline]

Definition at line 52 of file StrDefs.h.

00052 { return atof(s); }

double ToDoubleEx ( const char *  s,
char **  endptr 
) [inline]

Definition at line 53 of file StrDefs.h.

00053 { return strtod(s, endptr); }

int ToInteger ( const char *  s  )  [inline]

Definition at line 51 of file StrDefs.h.

00051 { return atoi(s); }

char* ToString ( int  value,
char *  string,
int  radix 
) [inline]

Definition at line 54 of file StrDefs.h.

00054 { return itoa(value, string, radix); }


Generated on Sat Sep 15 23:41:46 2007 for AVR C++ Lib (common) by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi