]> Dogcows Code - chaz/yoink/blobdiff - src/stlplus/strings/format_types.hpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / strings / format_types.hpp
diff --git a/src/stlplus/strings/format_types.hpp b/src/stlplus/strings/format_types.hpp
new file mode 100644 (file)
index 0000000..5df7711
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef STLPLUS_FORMAT_TYPES\r
+#define STLPLUS_FORMAT_TYPES\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+//   Author:    Andy Rushton\r
+//   Copyright: (c) Southampton University 1999-2004\r
+//              (c) Andy Rushton           2004-2009\r
+//   License:   BSD License, see ../docs/license.html\r
+\r
+//   A Set of enumerations controlling the string formatting of numbers.\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+// Integer radix display representations:\r
+//   There are three ways in which the radix is represented:\r
+//     - none - the number is just printed as a number (e.g. 12345). Can be confusing for non-decimal radix\r
+//     - C style - for binary, octal and hex, the C-style prefices 0b, 0 and 0x are used\r
+//       note that this is an unsigned representation\r
+//     - Hash style - in the form radix#value - the value may be signed, e.g. 10#-9\r
+\r
+enum radix_display_t \r
+{\r
+  radix_none,               // just print the number with no radix indicated\r
+  radix_hash_style,         // none for decimal, hash style for all others\r
+  radix_hash_style_all,     // hash style for all radices including decimal\r
+  radix_c_style,            // C style for hex and octal, none for others\r
+  radix_c_style_or_hash     // C style for hex and octal, none for decimal, hash style for others\r
+};\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+// Floating-point display representations:\r
+// There are three formats for the printout:\r
+//   - fixed - formatted as a fixed-point number, so no mantissa is printed (equivalent to %f in printf)\r
+//   - floating - formatted as a normalised floating-point number (equivalent to %e in printf)\r
+//   - mixed - formatted as fixed-point if appropriate, otherwise the floating format (equivalent to %g in printf)\r
+\r
+enum real_display_t\r
+{\r
+  display_fixed,    // %f\r
+  display_floating, // %e\r
+  display_mixed     // %g\r
+};\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+// Alignment:\r
+//   There are three field alignments:\r
+//     - left aligned - the value is to the left of the field which is padded to the right with spaces\r
+//     - right aligned - the value is to the right of the field which is padded to the left with spaces\r
+//     - centred - the value is in the centre of the field and spaces added to both left and right\r
+\r
+enum alignment_t\r
+{\r
+  align_left,\r
+  align_right,\r
+  align_centre\r
+};\r
+\r
+////////////////////////////////////////////////////////////////////////////////\r
+#endif\r
This page took 0.022244 seconds and 4 git commands to generate.