Mike Dodd | 8cfa702 | 2010-11-17 11:12:26 -0800 | [diff] [blame] | 1 | /** |
| 2 | * @file symbol_sort.h |
| 3 | * Sorting symbols |
| 4 | * |
| 5 | * @remark Copyright 2002, 2003 OProfile authors |
| 6 | * @remark Read the file COPYING |
| 7 | * |
| 8 | * @author Philippe Elie |
| 9 | * @author John Levon |
| 10 | */ |
| 11 | |
| 12 | #ifndef SYMBOL_SORT_H |
| 13 | #define SYMBOL_SORT_H |
| 14 | |
| 15 | #include "symbol.h" |
| 16 | |
| 17 | #include <vector> |
| 18 | #include <string> |
| 19 | |
| 20 | struct sort_options { |
| 21 | enum sort_order { |
| 22 | // order give sort order if caller doesn't specify one |
| 23 | first, |
| 24 | sample = first, |
| 25 | image, |
| 26 | app_name, |
| 27 | symbol, |
| 28 | debug, |
| 29 | vma, |
| 30 | last |
| 31 | }; |
| 32 | |
| 33 | sort_options() {} |
| 34 | |
| 35 | void add_sort_option(std::string const & name); |
| 36 | void add_sort_option(sort_order order); |
| 37 | |
| 38 | /** |
| 39 | * Sort the given container by the given criteria. |
| 40 | */ |
| 41 | void sort(symbol_collection & syms, bool reverse_sort, |
| 42 | bool long_filenames) const; |
| 43 | |
| 44 | /** |
| 45 | * Sort the given container by the given criteria. |
| 46 | */ |
| 47 | void sort(diff_collection & syms, bool reverse_sort, |
| 48 | bool long_filenames) const; |
| 49 | |
| 50 | std::vector<sort_order> options; |
| 51 | }; |
| 52 | |
| 53 | #endif // SYMBOL_SORT_H |