Make ICU no longer a required dependency

This commit is contained in:
Thomas Krijnen
2011-09-27 19:30:53 +00:00
parent 9edbe7e6c3
commit a9143655c3
3 changed files with 29 additions and 3 deletions
+10
View File
@@ -30,7 +30,11 @@
#include <string>
#include <sstream>
#ifdef HAVE_ICU
#include "unicode/ucnv.h"
#else
typedef unsigned int UChar32;
#endif
#include "../ifcparse/IfcFile.h"
@@ -39,14 +43,20 @@ namespace IfcParse {
class IfcCharacterDecoder {
private:
IfcParse::File* file;
#ifdef HAVE_ICU
static UConverter* destination;
static UConverter* converter;
static int previous_codepage;
static UErrorCode status;
#endif
void addChar(std::stringstream& s,const UChar32& ch);
public:
#ifdef HAVE_ICU
enum ConversionMode {UTF8,LATIN,JSON,PYTHON};
static ConversionMode mode;
#else
static char substitution_character;
#endif
IfcCharacterDecoder(IfcParse::File* file);
~IfcCharacterDecoder();
void dryRun();