Enhancement - Sorting

- Replaced the hand-written combsort with std::sort.
- Added exhaustive set of unit tests to cover the single and double
  column sort orders.
This commit is contained in:
Paul Beckingham
2010-07-21 15:30:37 -07:00
parent e34f278e1d
commit da9985058b
4 changed files with 319 additions and 238 deletions

View File

@@ -35,6 +35,8 @@
class Table
{
friend bool sort_compare (int, int);
public:
enum just {left, center, right};
enum order {ascendingNumeric,
@@ -101,7 +103,6 @@ private:
const std::string formatHeader (const int, const int, const int);
const std::string formatHeaderDashedUnderline (const int, const int, const int);
void formatCell (const int, const int, const int, const int, const int, std::vector <std::string>&, std::string&);
void sort (std::vector <int>&);
private:
std::vector <std::string> mColumns;