• 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) 1999-2012, International Business Machines
7 *   Corporation and others.  All Rights Reserved.
8 *
9 *******************************************************************************
10 *   file name:  genprops.h
11 *   encoding:   US-ASCII
12 *   tab size:   8 (not used)
13 *   indentation:4
14 *
15 *   created on: 1999dec13
16 *   created by: Markus W. Scherer
17 */
18 
19 #ifndef __GENPROPS_H__
20 #define __GENPROPS_H__
21 
22 #include <stdio.h>
23 #include "unicode/utypes.h"
24 #include "unicode/uniset.h"
25 #include "ppucd.h"
26 #include "unewdata.h"
27 
28 #define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
29 
30 class PropsBuilder {
31 public:
32     PropsBuilder();
33     virtual ~PropsBuilder();
34     virtual void setUnicodeVersion(const UVersionInfo version);
35     virtual void setAlgNamesRange(UChar32 start, UChar32 end,
36                                   const char *type, const char *prefix, UErrorCode &errorCode);
37     virtual void setProps(const icu::UniProps &props, const icu::UnicodeSet &newValues, UErrorCode &errorCode);
38     virtual void build(UErrorCode &errorCode);
39     virtual void writeCSourceFile(const char *path, UErrorCode &errorCode);
40     virtual void writeJavaSourceFile(const char *path, UErrorCode &errorCode);
41     virtual void writeBinaryData(const char *path, UBool withCopyright, UErrorCode &errorCode);
42 };
43 
44 class PNamesBuilder : public PropsBuilder {
45 public:
46     virtual const icu::PropertyNames *getPropertyNames() = 0;
47 };
48 
49 PNamesBuilder *createPNamesBuilder(UErrorCode &errorCode);
50 PropsBuilder *createCorePropsBuilder(UErrorCode &errorCode);
51 PropsBuilder *createBiDiPropsBuilder(UErrorCode &errorCode);
52 PropsBuilder *createCasePropsBuilder(UErrorCode &errorCode);
53 PropsBuilder *createLayoutPropsBuilder(UErrorCode &errorCode);
54 PropsBuilder *createNamesPropsBuilder(UErrorCode &errorCode);
55 
56 /* global flags */
57 extern UBool beVerbose;
58 extern UBool beQuiet;
59 
60 #endif
61