Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FormatUtil.h
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: nGenEx.lib
6  FILE: FormatUtil.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Text formatting utilities
13 */
14 
15 #ifndef FormatUtil_h
16 #define FormatUtil_h
17 
18 #include "Types.h"
19 #include "Geometry.h"
20 #include "Text.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 void FormatNumber(char* txt, double n);
25 void FormatNumberExp(char* txt, double n);
26 void FormatTime(char* txt, double seconds);
27 void FormatTimeOfDay(char* txt, double seconds);
28 void FormatDayTime(char* txt, double seconds, bool short_format=false);
29 void FormatDay(char* txt, double seconds);
30 void FormatPoint(char* txt, const Point& p);
31 Text FormatTimeString(int utc=0);
32 
33 const char* SafeString(const char* s);
34 const char* SafeQuotes(const char* s);
35 
36 // scan msg and replace all occurrences of tgt with val
37 // return new result, leave msg unmodified
38 Text FormatTextReplace(const char* msg, const char* tgt, const char* val);
39 
40 // scan msg and replace all C-style \x escape sequences
41 // with their single-character values, leave orig unmodified
42 Text FormatTextEscape(const char* msg);
43 
44 // +--------------------------------------------------------------------+
45 
46 #endif FormatUtil_h
47