00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef UTIL_H
00030 #define UTIL_H
00031
00032 #ifndef __cplusplus
00033 #error This is a C++ include file
00034 #endif
00035
00036
00037
00038
00039 #include "Exception.h"
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00066 class Util
00067 {
00068 private:
00069
00073 static char base64Table[];
00074
00075 protected:
00076
00082 inline
00083 Util ( void ) throw ( Exception )
00084 {
00085 throw Exception( __FILE__, __LINE__);
00086 }
00087
00093 inline
00094 Util ( const Util & e ) throw ( Exception )
00095 {
00096 throw Exception( __FILE__, __LINE__);
00097 }
00098
00104 inline
00105 ~Util ( void ) throw ( Exception )
00106 {
00107 throw Exception( __FILE__, __LINE__);
00108 }
00109
00116 inline Util &
00117 operator= ( const Util & u ) throw ( Exception )
00118 {
00119 throw Exception( __FILE__, __LINE__);
00120 }
00121
00122
00123
00124 public:
00125
00133 static unsigned int
00134 strLen ( const char * str ) throw ( Exception );
00135
00144 static void
00145 strCpy ( char * dest,
00146 const char * src ) throw ( Exception );
00147
00157 static void
00158 strCat ( char * dest,
00159 const char * src ) throw ( Exception );
00160
00168 static char *
00169 strDup ( const char * str ) throw ( Exception );
00170
00181 static bool
00182 strEq ( const char * str1,
00183 const char * str2,
00184 unsigned int len = 0 ) throw ( Exception );
00185
00194 static long int
00195 strToL ( const char * str,
00196 int base = 10 ) throw ( Exception );
00197
00205 static double
00206 strToD ( const char * str ) throw ( Exception );
00207
00217 static char *
00218 fileAddDate ( const char * str ) throw ( Exception );
00219
00229 static char *
00230 base64Encode ( const char * str ) throw ( Exception );
00231
00245 static void
00246 conv ( unsigned int bitsPerSample,
00247 unsigned char * pcmBuffer,
00248 unsigned int lenPcmBuffer,
00249 short int * outBuffer,
00250 bool isBigEndian = true ) throw ( Exception );
00251
00252
00263 static void
00264 conv ( short int * shortBuffer,
00265 unsigned int lenShortBuffer,
00266 float ** floatBuffers,
00267 unsigned int channels ) throw ( Exception );
00268
00280 static void
00281 conv8 ( unsigned char * pcmBuffer,
00282 unsigned int lenPcmBuffer,
00283 short int * leftBuffer,
00284 short int * rightBuffer,
00285 unsigned int channels ) throw ( Exception );
00286
00299 static void
00300 conv16 ( unsigned char * pcmBuffer,
00301 unsigned int lenPcmBuffer,
00302 short int * leftBuffer,
00303 short int * rightBuffer,
00304 unsigned int channels,
00305 bool isBigEndian ) throw ( Exception );
00306
00307 };
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317 #endif
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360