| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * | 3 * |
| 4 * Copyright (C) 1999-2008, International Business Machines | 4 * Copyright (C) 1999-2014, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ******************************************************************************* | 7 ******************************************************************************* |
| 8 * file name: letsutil.cpp | 8 * file name: letsutil.cpp |
| 9 * | 9 * |
| 10 * created on: 04/25/2006 | 10 * created on: 04/25/2006 |
| 11 * created by: Eric R. Mader | 11 * created by: Eric R. Mader |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 #include "unicode/utypes.h" | 14 #include "unicode/utypes.h" |
| 15 #include "unicode/unistr.h" | 15 #include "unicode/unistr.h" |
| 16 #include "unicode/ubidi.h" | 16 #include "unicode/ubidi.h" |
| 17 | 17 |
| 18 #include "layout/LETypes.h" | 18 #include "layout/LETypes.h" |
| 19 #include "layout/LEScripts.h" | 19 #include "layout/LEScripts.h" |
| 20 #include "layout/LayoutEngine.h" | 20 #include "layout/LayoutEngine.h" |
| 21 #include "layout/LELanguages.h" | 21 #include "layout/LELanguages.h" |
| 22 | 22 |
| 23 #ifndef USING_ICULEHB |
| 23 #include "OpenTypeLayoutEngine.h" | 24 #include "OpenTypeLayoutEngine.h" |
| 25 #endif |
| 24 | 26 |
| 25 #include "letest.h" | 27 #include "letest.h" |
| 26 #include "letsutil.h" | 28 #include "letsutil.h" |
| 27 | 29 |
| 28 U_NAMESPACE_USE | 30 U_NAMESPACE_USE |
| 29 | 31 |
| 30 char *getCString(const UnicodeString *uString) | 32 char *getCString(const UnicodeString *uString) |
| 31 { | 33 { |
| 32 if (uString == NULL) { | 34 if (uString == NULL) { |
| 33 return NULL; | 35 return NULL; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 97 } |
| 96 | 98 |
| 97 le_int32 getLanguageCode(const char *lang) | 99 le_int32 getLanguageCode(const char *lang) |
| 98 { | 100 { |
| 99 if (strlen(lang) != 3) { | 101 if (strlen(lang) != 3) { |
| 100 return -1; | 102 return -1; |
| 101 } | 103 } |
| 102 | 104 |
| 103 LETag langTag = (LETag) ((lang[0] << 24) + (lang[1] << 16) + (lang[2] << 8)
+ 0x20); | 105 LETag langTag = (LETag) ((lang[0] << 24) + (lang[1] << 16) + (lang[2] << 8)
+ 0x20); |
| 104 | 106 |
| 107 #ifndef USING_ICULEHB |
| 105 for (le_int32 i = 0; i < languageCodeCount; i += 1) { | 108 for (le_int32 i = 0; i < languageCodeCount; i += 1) { |
| 106 if (langTag == OpenTypeLayoutEngine::languageTags[i]) { | 109 if (langTag == OpenTypeLayoutEngine::languageTags[i]) { |
| 107 return i; | 110 return i; |
| 108 } | 111 } |
| 109 } | 112 } |
| 113 #endif |
| 110 | 114 |
| 111 return -1; | 115 return -1; |
| 112 } | 116 } |
| 113 | 117 |
| OLD | NEW |