Add a 'sort' function to an STArray. They can be used in cases where

order is significant or where they're sorted.
This commit is contained in:
JoelKatz
2012-10-16 03:52:46 -07:00
parent 9c31daad08
commit b6dc333b68
2 changed files with 9 additions and 2 deletions

View File

@@ -866,6 +866,11 @@ STArray* STArray::construct(SerializerIterator& sit, SField::ref field)
return new STArray(field, value);
}
void STArray::sort(bool (*compare)(const STObject&, const STObject&))
{
std::sort(value.begin(), value.end(), compare);
}
std::auto_ptr<STObject> STObject::parseJson(const Json::Value& object, SField::ref inName, int depth)
{
if (!object.isObject())