FONTAINE  1.0
OrthographyResults.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 
10 
11 //
12 // OrthographyAnalysis
13 //
14 #ifndef ORTHOGRAPHY_RESULTS
15 #define ORTHOGRAPHY_RESULTS
16 
17 #include <string>
18 #include <set>
19 #include <vector>
20 
21 #include "OrthographyData.h"
22 
23 #include "Utf8String.h"
24 #include <string.h>
25 
27 
28 public:
29 
31  //
32  // Minimum allowable coverage to be considered
33  // as having "partial support":
34  //
35  const static int minCoverage=80;
36 
37  //
38  // Comparison Functor:
39  //
40  struct compare{
41  bool operator()(const OrthographyResults *o1,const OrthographyResults *o2) const{
42 
43  return strcmp(o1->_pData->commonName,o2->_pData->commonName) < 0;
44 
45  }
46  };
47 
48 private:
49 
51 
55 
56  std::vector<UTF32> _missingValues;
57 
58  // Report missing state flag:
60 
61 public:
62 
63  //
64  // Constructors:
65  //
66  OrthographyResults(const OrthographyData *pData,UINT32 hits,UINT32 tries,std::vector<UTF32> &missing);
68 
69  //
70  // Destructor
71  //
73 
74  UINT32 getHits(void) const;
75  UINT32 getTries(void) const;
76  int getPercentCoverage(void) const;
77  SUPPORTLEVEL getSupportLevel(void) const;
78  const char * getSupportLevelAsCString(void) const;
79  const char* getCommonName(void) const;
80  const char* getNativeName(void) const;
81  const char* getSampleCharacters(void) const;
82  const char* getSampleSentence(int nth) const;
83  std::string getMissingValuesAsString(void) const;
84 
85  std::string getReport(bool reportMissing) const;
86 
87  void setReportOnMissing(bool x);
88 
89 private:
90 
91  const char* UTF32ValueToUTF8( UTF32 UTF32Value ) const;
92 
93 };
94 
95 #endif