00001 # ifndef StrManip_h 00002 # define StrManip_h StrManip_h 00003 00004 // Created 2006/06/11 by wade 00005 00006 # include "Root.h" // parent 00007 00008 namespace Conjecture { 00009 00010 /****************************************************************** 00011 * \class StrManip 00012 * 00013 * \brief Various string manipulation routines 00014 * 00015 * This class will almost certainly be restructured and 00016 * incorporated into a cleaner design - just a placeholder for 00017 * useful string-related methods for now. 00018 * 00019 *******************************************************************/ 00020 class StrManip : public Root { 00021 public: 00022 // Constructors/Destructors 00023 StrManip(); 00024 00025 // Accessors 00026 00027 // Input/Output 00028 00029 // Interface 00030 00031 /************************************************************ 00032 * Perform optimal string matching between two strings. 00033 * 00034 * \param str1 out parameter - string will be modified to 00035 * provide better alignment 00036 * 00037 * \param str2 out parameter - string will be modified to 00038 * provide better alignment 00039 * 00040 * This method takes two strings and determines where to 00041 * insert "spaces" within each so as to maximize the amount of 00042 * character-to-character matching between them. 00043 * 00044 */ 00045 static void MatchStrings(const std::string& str1, const std::string& str2, std::string& outstr1, std::string& outstr2, char insert = '_'); 00046 00057 static std::string MergeStrings(const std::string& str1, const std::string& str2, const std::string& indent = " "); 00058 00059 static void Test(int argc = 0, const char* argv[] = NULL); 00060 00061 protected: 00062 // Methods 00063 00064 // Accessors 00065 00066 private: 00067 // Methods 00068 static void PrintMatrix(int** D, unsigned m, unsigned n); 00069 00070 // Accessors 00071 00072 // State 00073 }; 00074 } 00075 00076 # endif // StrManip_h 00077