- Sorting implemented using a non-relocatable task list, a stable
  sort, and type-specific comparisons.
This commit is contained in:
Paul Beckingham 2011-05-05 22:37:54 -04:00
parent 9268e552d8
commit 4584da8895
8 changed files with 176 additions and 174 deletions

View file

@ -819,6 +819,31 @@ void Context::parse (
}
}
////////////////////////////////////////////////////////////////////////////////
void Context::decomposeSortField (
const std::string& field,
std::string& key,
bool& ascending)
{
int length = field.length ();
if (field[length - 1] == '+')
{
ascending = true;
key = field.substr (0, length - 1);
}
else if (field[length - 1] == '-')
{
ascending = false;
key = field.substr (0, length - 1);
}
else
{
ascending = true;
key = field;
}
}
////////////////////////////////////////////////////////////////////////////////
// Note: The reason some of these are commented out is because the ::clear
// method is not really "clear" but "clear_some". Some members do not need to