![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
The following several functions allow intelligent sorting city report fields by column. More...
Public Attributes | |
| union { | |
| float numeric_value | |
| char * string_value | |
| } | val |
| bool | is_numeric |
The following several functions allow intelligent sorting city report fields by column.
This doesn't necessarily do the right thing, but it's better than sorting alphabetically.
The GUI gives us two values to compare (as strings). We try to split them into an array of numeric and string fields, then we compare lexicographically. Two numeric fields are compared in the obvious way, two character fields are compared alphabetically. Arbitrarily, a numeric field is sorted before a character field (for "justification" note that numbers are before letters in the ASCII table).
Definition at line 958 of file view_cities_data.cpp.
| bool datum::is_numeric |
Definition at line 963 of file view_cities_data.cpp.
Referenced by datum_compare(), free_datum(), init_datum_number(), and init_datum_string().
| float datum::numeric_value |
Definition at line 960 of file view_cities_data.cpp.
Referenced by datum_compare(), and init_datum_number().
| char* datum::string_value |
Definition at line 961 of file view_cities_data.cpp.
Referenced by datum_compare(), free_datum(), and init_datum_string().
| union { ... } datum::val |
Referenced by datum_compare(), free_datum(), init_datum_number(), and init_datum_string().