/////////////////////////////////////////////////////////////////////////////// // // Tools.hxx // // This is a collection of useful routines // // // BSVC "A Microprocessor Simulation Framework" // Copyright (c) 1993 // By: Bradford W. Mott // November 6,1993 // /////////////////////////////////////////////////////////////////////////////// // $Id: Tools.hxx,v 1.1 1996/08/02 14:53:54 bwmott Exp $ /////////////////////////////////////////////////////////////////////////////// #ifndef TOOLS_HXX #define TOOLS_HXX #include #include #ifdef USE_STD using namespace std; #endif /////////////////////////////////////////////////////////////////////////////// // Convert the hex string to an unsigned integer /////////////////////////////////////////////////////////////////////////////// unsigned int StringToInt(const string& hex); /////////////////////////////////////////////////////////////////////////////// // Convert the value to a hex string padded with zeros /////////////////////////////////////////////////////////////////////////////// string IntToString(unsigned int value, unsigned int width); /////////////////////////////////////////////////////////////////////////////// // Convert the value to a decimal string padded with spaces /////////////////////////////////////////////////////////////////////////////// string IntToDecimal(unsigned long value, unsigned int width); #endif