• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *******************************************************************************
5 *
6 *   Copyright (C) 2003, International Business Machines
7 *   Corporation and others.  All Rights Reserved.
8 *
9 *******************************************************************************
10 *
11 * File uprinter.h
12 *
13 * Modification History:
14 *
15 *   Date        Name        Description
16 *   03/18/2003  weiv        Creation.
17 *******************************************************************************
18 */
19 
20 #ifndef COLPROBE_UPRINTER_H
21 #define COLPROBE_UPRINTER_H
22 
23 #include "line.h"
24 
25 #include "unicode/ustdio.h"
26 #include "unicode/unistr.h"
27 #include "unicode/ustring.h"
28 
29 
30 class UPrinter {
31   UFILE *out;
32   UChar buffer[256];
33   UBool _on;
34   char _locale[256];
35 public:
36   UPrinter(FILE *file, const char *locale, const char *encoding, UBool transliterateNonPrintable=TRUE);
37   UPrinter(const char *name, const char *locale, const char *encoding, UTransliterator *trans, UBool transliterateNonPrintable);
38   ~UPrinter();
39   void log(const UnicodeString &string, UBool nl = FALSE);
40   void log(const UChar *string, UBool nl = FALSE);
41   //void log(const char *string, UBool nl = FALSE);
42   void log(const Line *line, UBool nl = FALSE);
43   void log(const char *fmt, ...);
44   void off(void);
45   void on(void);
isOn(void)46   UBool isOn(void) {
47     return _on;
48   };
49 };
50 
51 
52 
53 #endif // #ifndef COLPROBE_UPRINTER_H
54