Lines 32-38
Link Here
|
32 |
using namespace beecrypt::crypto; |
32 |
using namespace beecrypt::crypto; |
33 |
|
33 |
|
34 |
namespace { |
34 |
namespace { |
35 |
RegexPattern* _amppat = 0; |
35 |
icu::RegexPattern* _amppat = 0; |
36 |
} |
36 |
} |
37 |
|
37 |
|
38 |
const int Cipher::ENCRYPT_MODE = 1; |
38 |
const int Cipher::ENCRYPT_MODE = 1; |
Lines 55-61
Link Here
|
55 |
|
55 |
|
56 |
Cipher* Cipher::getInstance(const String& transformation) throw (NoSuchAlgorithmException, NoSuchPaddingException) |
56 |
Cipher* Cipher::getInstance(const String& transformation) throw (NoSuchAlgorithmException, NoSuchPaddingException) |
57 |
{ |
57 |
{ |
58 |
UnicodeString match(transformation.toUnicodeString()); |
58 |
icu::UnicodeString match(transformation.toUnicodeString()); |
59 |
|
59 |
|
60 |
UErrorCode status = U_ZERO_ERROR; |
60 |
UErrorCode status = U_ZERO_ERROR; |
61 |
|
61 |
|
Lines 63-76
Link Here
|
63 |
{ |
63 |
{ |
64 |
UParseError error; |
64 |
UParseError error; |
65 |
|
65 |
|
66 |
_amppat = RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
66 |
_amppat = icu::RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
67 |
// shouldn't happen |
67 |
// shouldn't happen |
68 |
if (U_FAILURE(status)) |
68 |
if (U_FAILURE(status)) |
69 |
throw RuntimeException("ICU regex compilation problem"); |
69 |
throw RuntimeException("ICU regex compilation problem"); |
70 |
} |
70 |
} |
71 |
|
71 |
|
72 |
status = U_ZERO_ERROR; |
72 |
status = U_ZERO_ERROR; |
73 |
RegexMatcher *m = _amppat->matcher(match, status); |
73 |
icu::RegexMatcher *m = _amppat->matcher(match, status); |
74 |
|
74 |
|
75 |
status = U_ZERO_ERROR; |
75 |
status = U_ZERO_ERROR; |
76 |
if (m->matches(status)) |
76 |
if (m->matches(status)) |
Lines 225-237
Link Here
|
225 |
{ |
225 |
{ |
226 |
UParseError error; |
226 |
UParseError error; |
227 |
|
227 |
|
228 |
_amppat = RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
228 |
_amppat = icu::RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
229 |
// shouldn't happen |
229 |
// shouldn't happen |
230 |
if (U_FAILURE(status)) |
230 |
if (U_FAILURE(status)) |
231 |
throw RuntimeException("ICU regex compilation problem"); |
231 |
throw RuntimeException("ICU regex compilation problem"); |
232 |
} |
232 |
} |
233 |
|
233 |
|
234 |
RegexMatcher *m = _amppat->matcher(transformation.toUnicodeString(), status); |
234 |
icu::RegexMatcher *m = _amppat->matcher(transformation.toUnicodeString(), status); |
235 |
|
235 |
|
236 |
if (m->matches(status)) |
236 |
if (m->matches(status)) |
237 |
{ |
237 |
{ |
Lines 382-394
Link Here
|
382 |
{ |
382 |
{ |
383 |
UParseError error; |
383 |
UParseError error; |
384 |
|
384 |
|
385 |
_amppat = RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
385 |
_amppat = icu::RegexPattern::compile("(\\w+)(?:/(\\w*))?(?:/(\\w+))?", error, status); |
386 |
// shouldn't happen |
386 |
// shouldn't happen |
387 |
if (U_FAILURE(status)) |
387 |
if (U_FAILURE(status)) |
388 |
throw RuntimeException("ICU regex compilation problem"); |
388 |
throw RuntimeException("ICU regex compilation problem"); |
389 |
} |
389 |
} |
390 |
|
390 |
|
391 |
RegexMatcher *m = _amppat->matcher(transformation.toUnicodeString(), status); |
391 |
icu::RegexMatcher *m = _amppat->matcher(transformation.toUnicodeString(), status); |
392 |
|
392 |
|
393 |
if (m->matches(status)) |
393 |
if (m->matches(status)) |
394 |
{ |
394 |
{ |