MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / decomposeSortField

Method decomposeSortField

src/Context.cpp:1227–1248  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1225
1226////////////////////////////////////////////////////////////////////////////////
1227void Context::decomposeSortField(const std::string& field, std::string& key, bool& ascending,
1228 bool& breakIndicator) {
1229 int length = field.length();
1230
1231 int decoration = 1;
1232 breakIndicator = false;
1233 if (field[length - decoration] == '/') {
1234 breakIndicator = true;
1235 ++decoration;
1236 }
1237
1238 if (field[length - decoration] == '+') {
1239 ascending = true;
1240 key = field.substr(0, length - decoration);
1241 } else if (field[length - decoration] == '-') {
1242 ascending = false;
1243 key = field.substr(0, length - decoration);
1244 } else {
1245 ascending = true;
1246 key = field;
1247 }
1248}
1249
1250////////////////////////////////////////////////////////////////////////////////
1251void Context::debugTiming(const std::string& details, const Timer& timer) {

Callers 2

sort_compareFunction · 0.80
executeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected