#include <Util.h>
This class can not be instantiated, but contains useful (?) static functions.
Typical usage:
include "Util.h"
char * str = Util::strDup( otherStr);
Definition at line 66 of file Util.h.
Static Public Member Functions | |
static unsigned int | strLen (const char *str) throw ( Exception ) |
Determine a C string's length. | |
static void | strCpy (char *dest, const char *src) throw ( Exception ) |
Copy a C string into another. | |
static void | strCat (char *dest, const char *src) throw ( Exception ) |
Concatenate a string to another's end. | |
static char * | strDup (const char *str) throw ( Exception ) |
Duplicate a string by allocating space with new[]. | |
static bool | strEq (const char *str1, const char *str2, unsigned int len=0) throw ( Exception ) |
Determine wether two string are equal. | |
static long int | strToL (const char *str, int base=10) throw ( Exception ) |
Convert a string to long. | |
static double | strToD (const char *str) throw ( Exception ) |
Convert a string to double. | |
static char * | fileAddDate (const char *str) throw ( Exception ) |
Add current date to a file name, before the file extension (if any). | |
static char * | base64Encode (const char *str) throw ( Exception ) |
Convert a string into base64 encoding. | |
static void | conv (unsigned int bitsPerSample, unsigned char *pcmBuffer, unsigned int lenPcmBuffer, short int *outBuffer, bool isBigEndian=true) throw ( Exception ) |
Convert an unsigned char buffer holding 8 or 16 bit PCM values with channels interleaved to a short int buffer, still with channels interleaved. | |
static void | conv (short int *shortBuffer, unsigned int lenShortBuffer, float **floatBuffers, unsigned int channels) throw ( Exception ) |
Convert a short buffer holding PCM values with channels interleaved to one or more float buffers, one for each channel. | |
static void | conv8 (unsigned char *pcmBuffer, unsigned int lenPcmBuffer, short int *leftBuffer, short int *rightBuffer, unsigned int channels) throw ( Exception ) |
Convert a char buffer holding 8 bit PCM values to a short buffer. | |
static void | conv16 (unsigned char *pcmBuffer, unsigned int lenPcmBuffer, short int *leftBuffer, short int *rightBuffer, unsigned int channels, bool isBigEndian) throw ( Exception ) |
Convert a char buffer holding 16 bit PCM values to a short buffer. | |
Protected Member Functions | |
Util (void) throw ( Exception ) | |
Default constructor. | |
Util (const Util &e) throw ( Exception ) | |
Copy constructor. | |
~Util (void) throw ( Exception ) | |
Destructor. | |
Util & | operator= (const Util &u) throw ( Exception ) |
Assignment operator. |
|
Default constructor. Always throws an Exception.
|
|
Copy constructor. Always throws an Exception.
|
|
Destructor. Always throws an Exception.
|
|
Convert a string into base64 encoding. base64 is described in RFC 2045, section 6.8 The returned string must be freed with delete[].
Definition at line 170 of file Util.cpp. Referenced by IceCast2::sendLogin(). |
|
Convert a short buffer holding PCM values with channels interleaved to one or more float buffers, one for each channel.
|
|
Convert an unsigned char buffer holding 8 or 16 bit PCM values with channels interleaved to a short int buffer, still with channels interleaved.
|
|
Convert a char buffer holding 16 bit PCM values to a short buffer.
|
|
Convert a char buffer holding 8 bit PCM values to a short buffer.
|
|
Add current date to a file name, before the file extension (if any).
|
|
Assignment operator. Always throws an Exception.
|
|
Concatenate a string to another's end.
Definition at line 133 of file Util.cpp. Referenced by IceCast2::sendLogin(). |
|
Copy a C string into another.
Definition at line 118 of file Util.cpp. Referenced by IceCast2::sendLogin(). |
|
Duplicate a string by allocating space with new[]. The returned string must be freed with delete[].
|
|
Determine wether two string are equal.
Definition at line 214 of file Util.cpp. Referenced by AudioSource::createDspSource(), and IceCast2::sendLogin(). |
|
Determine a C string's length.
Definition at line 100 of file Util.cpp. Referenced by IceCast2::sendLogin(). |
|
Convert a string to double.
|
|
Convert a string to long.
Definition at line 230 of file Util.cpp. Referenced by main(). |