Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Util.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 
00003    Copyright (c) 2000 Tyrell Corporation. All rights reserved.
00004 
00005    Tyrell DarkIce
00006 
00007    File     : Util.h
00008    Version  : $Revision: 1.11 $
00009    Author   : $Author: darkeye $
00010    Location : $Source: /cvsroot/darkice/darkice/src/Util.h,v $
00011    
00012    Copyright notice:
00013 
00014     This program is free software; you can redistribute it and/or
00015     modify it under the terms of the GNU General Public License  
00016     as published by the Free Software Foundation; either version 2
00017     of the License, or (at your option) any later version.
00018    
00019     This program is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of 
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
00022     GNU General Public License for more details.
00023    
00024     You should have received a copy of the GNU General Public License
00025     along with this program; if not, write to the Free Software
00026     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 /* ============================================================ include files */
00038 
00039 #include "Exception.h"
00040 
00041 
00042 /* ================================================================ constants */
00043 
00044 
00045 /* =================================================================== macros */
00046 
00047 
00048 /* =============================================================== data types */
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 /* ================================================= external data structures */
00311 
00312 
00313 /* ====================================================== function prototypes */
00314 
00315 
00316 
00317 #endif  /* UTIL_H */
00318 
00319 
00320 /*------------------------------------------------------------------------------
00321  
00322   $Source: /cvsroot/darkice/darkice/src/Util.h,v $
00323 
00324   $Log: Util.h,v $
00325   Revision 1.11  2005/04/14 11:53:17  darkeye
00326   fixed API documentation issues
00327 
00328   Revision 1.10  2004/02/15 12:06:30  darkeye
00329   added ALSA support, thanks to Christian Forster
00330 
00331   Revision 1.9  2003/02/09 12:57:36  darkeye
00332   cosmetic changes to the fileAddDate option
00333 
00334   Revision 1.8  2002/11/20 16:52:08  wandereq
00335   added fileAddDate function
00336 
00337   Revision 1.7  2002/08/20 18:39:14  darkeye
00338   added HTTP Basic authentication for icecast2 logins
00339 
00340   Revision 1.6  2002/07/21 08:47:06  darkeye
00341   some exception cleanup (throw clauses in function declarations)
00342 
00343   Revision 1.5  2002/03/28 16:45:46  darkeye
00344   added functions strToD(), conv8(), conv16() and conv()
00345 
00346   Revision 1.4  2000/11/12 13:31:40  darkeye
00347   added kdoc-style documentation comments
00348 
00349   Revision 1.3  2000/11/09 22:04:33  darkeye
00350   added functions strLen strCpy and strCat
00351 
00352   Revision 1.2  2000/11/09 06:44:21  darkeye
00353   added strEq and strToL functions
00354 
00355   Revision 1.1.1.1  2000/11/05 10:05:55  darkeye
00356   initial version
00357 
00358   
00359 ------------------------------------------------------------------------------*/
00360 

Generated on Sat Oct 22 13:17:05 2005 for DarkIce by  doxygen 1.4.4