FONTAINE  1.0
Message.h
Go to the documentation of this file.
1 //
2 // The Fontaine Font Analysis Project
3 //
4 // Copyright (c) 2009 by Edward H. Trager
5 // All Rights Reserved
6 //
7 // Released under the GNU GPL version 2.0 or later.
8 //
9 
11 //
12 // A version of this file was originally written as part of
13 // the MADELINE 2 program
14 // written by Edward H. Trager and Ritu Khanna
15 // Copyright (c) 2005 by the Regents of the University of Michigan.
16 // and released under the GNU GPL v. 2.0 or later.
17 //
19 //
20 // 2005.03.14.ET -- Originally written as Warning class
21 // 2006.12.18.ET -- Reimplemented as Message base class
22 
23 //
24 // Message.h
25 //
26 
27 
28 #ifndef MESSAGE_INCLUDED
29 #define MESSAGE_INCLUDED
30 
31 #include <iostream>
32 #include <libintl.h>
33 #include <locale.h>
34 #include <stdarg.h>
35 #include "BufferSizes.h"
36 #include <string>
37 #include <stdio.h>
38 
39 // Loader class:
40 class MessageInitializer;
41 
42 class Message{
43 
44  friend class MessageInitializer;
45 
46 private:
47 
48  static const char *_defaultSalutation;
49 
50  // initialize:
51  static void _initialize( void );
52 
53 protected:
54 
55  const char *_salutation;
56  const char *_methodName;
58  bool _truncated;
59 
60 public:
61 
62  // Constructors:
63  Message(){};
64  Message(const char *const methodName, const char *format,...);
65 
66  // print:
67  void print(void);
68 
69  // get:
70  std::string get(void) const;
71 };
72 
73 //
74 // MessageInitializer loader class:
75 //
77 
81  }
82 
83 };
84 
85 //
86 // Independent utility method for localization:
87 //
88 std::string L(const char *format,...);
89 
90 #endif
91 
Definition: Message.h:42
char _message[GENERAL_STRING_BUFFER_SIZE]
Definition: Message.h:57
const char * _salutation
Definition: Message.h:55
static const char * _defaultSalutation
Definition: Message.h:48
Definition: BufferSizes.h:32
bool _truncated
Definition: Message.h:58
std::string get(void) const
Definition: Message.cpp:99
MessageInitializer()
Definition: Message.h:79
Definition: Message.h:76
const char * _methodName
Definition: Message.h:56
Message()
Definition: Message.h:63
void print(void)
Definition: Message.cpp:65
static MessageInitializer messageInitializer
Definition: Message.h:78
static void _initialize(void)
Definition: Message.cpp:87
std::string L(const char *format,...)
Definition: Message.cpp:116