MiscStuff.h

Go to the documentation of this file.
00001 
00002 //Luke Lenhart, 1999-2007
00003 //See /docs/License.txt for details on how this code may be used.
00004 
00005 #pragma once
00006 
00007 #include <string>
00008 #include <vector>
00009 #include "File.h"
00010 #include "Types.h"
00011 
00013 namespace MISC
00014 {
00015     // -- assorted misc functions --
00016 
00018     std::string ReadFile(const MPMA::Filename &fname);
00020     bool LoadStringList(std::vector<std::string> &outList, const MPMA::Filename &file);
00022     std::string MakeLower(const std::string &str);
00024     std::string StripFirstLine(const std::string &str);
00026     std::string StripPadding(const std::string &str);
00028     uint CountBits(uint data);
00030     int GetHighestBit(uint data);
00032     void ExplodeString(const std::string &inData, std::vector<std::string> &outData, const std::string &inDeliminators=" \t\n");
00034     uint ParseHexString(const std::string &s);
00035 }
00036 
00037 // -- other misc stuff
00038 
00039 //leftover habits from QBasic...
00040 inline double rndd() { return ((double)rand()/(double)RAND_MAX); }
00041 inline float rndf() { return ((float)rand()/(float)RAND_MAX); }

Generated on Wed Feb 13 20:57:04 2008 for MPMA Framework by  doxygen 1.5.4