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

Utilities.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   SpikeStream Library                                                   *
00003  *   Copyright (C) 2007 by David Gamez                                     *
00004  *   david@davidgamez.eu                                                   *
00005  *   Version 0.1                                                           *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 
00023 #ifndef UTILITIES_H
00024 #define UTILITIES_H
00025 
00026 //Other includes
00027 #include <string>
00028 using namespace std;
00029 
00030 
00031 //----------------------------------Utilities-------------------------------
00032 /*! Collection of static convenience methods for converting and other 
00033         tasks. */
00034 //--------------------------------------------------------------------------
00035 
00036 class Utilities {
00037  
00038         public:
00039                 static int absVal(const int& num);
00040                 static double absVal(const double& num);
00041                 static bool cStringEquals(const char *cString1, const char *cString2, int length);
00042                 static double getDouble(const char *cString);
00043                 static double getDouble(string s);
00044                 static int getInt(const char *cString);
00045                 static int getInt(string s);
00046                 static unsigned int getNeuronGrpID(string neurGrpStr);
00047                 static unsigned int getRandomUInt(unsigned int rangeHigh);
00048                 static short getShort(const char *cString);
00049                 static short getShort(string str);
00050                 static unsigned int getUInt(const char *cString);
00051                 static unsigned int getUInt(string s);
00052                 static unsigned short getUShort(const char *cString);
00053                 static unsigned short getUShort(string s);
00054                 static double round(double number, unsigned int numPlaces);
00055                 static void roundTwoDecimalPlaces(double&);
00056                 static void safeCStringCat(char target[], const char source[], int targetSize);
00057                 static void safeCStringCopy(char target[], const char source[], int targetSize);
00058 
00059 };
00060 
00061 
00062 #endif//UTILITIES_H
00063 

Generated on Mon Sep 3 22:18:50 2007 for SpikeStream Library by  doxygen 1.4.4