summaryrefslogtreecommitdiffhomepage
path: root/nGenEx/FormatUtil.h
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 14:53:40 +0000
commite33e19d0587146859d48a134ec9fd94e7b7ba5cd (patch)
tree69d048c8801858d2756ab3a487090a7a1b74bf14 /nGenEx/FormatUtil.h
downloadstarshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.zip
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.gz
starshatter-e33e19d0587146859d48a134ec9fd94e7b7ba5cd.tar.bz2
Initial upload
Diffstat (limited to 'nGenEx/FormatUtil.h')
-rw-r--r--nGenEx/FormatUtil.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/nGenEx/FormatUtil.h b/nGenEx/FormatUtil.h
new file mode 100644
index 0000000..5119543
--- /dev/null
+++ b/nGenEx/FormatUtil.h
@@ -0,0 +1,47 @@
+/* Project nGenEx
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
+
+ SUBSYSTEM: nGenEx.lib
+ FILE: FormatUtil.h
+ AUTHOR: John DiCamillo
+
+
+ OVERVIEW
+ ========
+ Text formatting utilities
+*/
+
+#ifndef FormatUtil_h
+#define FormatUtil_h
+
+#include "Types.h"
+#include "Geometry.h"
+#include "Text.h"
+
+// +--------------------------------------------------------------------+
+
+void FormatNumber(char* txt, double n);
+void FormatNumberExp(char* txt, double n);
+void FormatTime(char* txt, double seconds);
+void FormatTimeOfDay(char* txt, double seconds);
+void FormatDayTime(char* txt, double seconds, bool short_format=false);
+void FormatDay(char* txt, double seconds);
+void FormatPoint(char* txt, const Point& p);
+Text FormatTimeString(int utc=0);
+
+const char* SafeString(const char* s);
+const char* SafeQuotes(const char* s);
+
+// scan msg and replace all occurrences of tgt with val
+// return new result, leave msg unmodified
+Text FormatTextReplace(const char* msg, const char* tgt, const char* val);
+
+// scan msg and replace all C-style \x escape sequences
+// with their single-character values, leave orig unmodified
+Text FormatTextEscape(const char* msg);
+
+// +--------------------------------------------------------------------+
+
+#endif FormatUtil_h
+