@magic-xpa/utils 4.800.0-dev480.22 → 4.800.0-dev480.220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/bundles/magic-xpa-utils.umd.js +72 -1222
  2. package/bundles/magic-xpa-utils.umd.js.map +1 -1
  3. package/bundles/magic-xpa-utils.umd.min.js +1 -1
  4. package/bundles/magic-xpa-utils.umd.min.js.map +1 -1
  5. package/esm2015/index.js +1 -1
  6. package/esm2015/magic-xpa-utils.js +1 -4
  7. package/esm2015/src/Base64.js +1 -46
  8. package/esm2015/src/ChoiceUtils.js +1 -13
  9. package/esm2015/src/Constants.js +2 -14
  10. package/esm2015/src/DateTimeUtils.js +1 -2
  11. package/esm2015/src/DateUtil.js +1 -13
  12. package/esm2015/src/InternalInterface.js +4 -8
  13. package/esm2015/src/JSON_Utils.js +1 -1
  14. package/esm2015/src/Logger.js +2 -81
  15. package/esm2015/src/MagicConstants.js +1 -1
  16. package/esm2015/src/Misc.js +1 -60
  17. package/esm2015/src/MsgInterface.js +1 -1
  18. package/esm2015/src/PICInterface.js +20 -31
  19. package/esm2015/src/PlatformUtils.js +2 -2
  20. package/esm2015/src/Queue.js +1 -9
  21. package/esm2015/src/Randomizer.js +1 -1
  22. package/esm2015/src/RequestInfo.js +1 -4
  23. package/esm2015/src/Rtf.js +15 -199
  24. package/esm2015/src/StorageAttribute.js +1 -33
  25. package/esm2015/src/StrUtil.js +0 -0
  26. package/esm2015/src/SyncExecutionHelper.js +1 -16
  27. package/esm2015/src/UtilDateJpn.js +9 -89
  28. package/esm2015/src/UtilImeJpn.js +3 -32
  29. package/esm2015/src/UtilStrByteMode.js +15 -288
  30. package/esm2015/src/XMLConstants.js +1 -12
  31. package/esm2015/src/Xml/XmlParser.js +3 -100
  32. package/esm2015/src/enums.js +1 -1
  33. package/fesm2015/magic-xpa-utils.js +72 -1224
  34. package/fesm2015/magic-xpa-utils.js.map +1 -1
  35. package/magic-xpa-utils.d.ts +0 -3
  36. package/package.json +2 -2
  37. package/src/InternalInterface.d.ts +1 -1
  38. package/src/StrUtil.d.ts +0 -1
@@ -4,81 +4,30 @@
4
4
  (global = global || self, factory((global['magic-xpa'] = global['magic-xpa'] || {}, global['magic-xpa'].utils = {}), global.mscorelib, global.util, global.xml2js));
5
5
  }(this, (function (exports, mscorelib, util, xml2js) { 'use strict';
6
6
 
7
- /// <summary>JPN: DBCS support
8
7
  var UtilStrByteMode = /** @class */ (function () {
9
8
  function UtilStrByteMode() {
10
9
  }
11
- /// <summary> Checks the environment whether it is running on DBCS environment
12
- /// Returns true if the language code for the current default Locale is
13
- /// DBCS language (in non-Unicode encoding).
14
- ///
15
- /// </summary>
16
- /// <returns> true if DBCS, or false if SBCS
17
- /// </returns>
18
10
  UtilStrByteMode.isLocaleDefLangDBCS = function () {
19
11
  return UtilStrByteMode._bLocaleDefLangJPN || UtilStrByteMode._bLocaleDefLangCHN || UtilStrByteMode._bLocaleDefLangKOR;
20
12
  };
21
- /// <summary> Checks whether the language code for the current default Locale
22
- /// is JAPANESE.
23
- ///
24
- /// </summary>
25
- /// <returns> true if JAPANESE, or false if not
26
- /// </returns>
27
13
  UtilStrByteMode.isLocaleDefLangJPN = function () {
28
14
  return UtilStrByteMode._bLocaleDefLangJPN;
29
15
  };
30
- /// <summary> Checks whether the language code for the current default Locale
31
- /// is KOREAN.
32
- ///
33
- /// </summary>
34
- /// <returns> true if KOREAN, or false if not
35
- /// </returns>
36
16
  UtilStrByteMode.isLocaleDefLangKOR = function () {
37
17
  return UtilStrByteMode._bLocaleDefLangKOR;
38
18
  };
39
19
  UtilStrByteMode.isKoreanCharacter = function (c) {
40
- return (44032 <= /*'가'*/ c && c <= 55203 /*'힣'*/) || (4352 <= /*'ᄀ'*/ c && c <= 4607 /*'ᇿ'*/) || (12592 <= /*'㄰'*/ c && c <= 12687 /*'㆏'*/) || (43360 <= /*'ꥠ'*/ c && c <= 43391 /*'꥿'*/) || (55216 <= /*'ힰ'*/ c && c <= 55295 /*'퟿'*/);
41
- };
42
- /// <summary> Length of String
43
- /// Returns the number of bytes (in default encoding).
44
- ///
45
- /// </summary>
46
- /// <param name="strVal:">string (in Unicode)
47
- /// </param>
48
- /// <returns> the number of bytes (in default encoding)
49
- ///
50
- /// Example: lenB("abXYc")
51
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
52
- /// 7.
53
- /// </returns>
20
+ return (44032 <= c && c <= 55203) || (4352 <= c && c <= 4607) || (12592 <= c && c <= 12687) || (43360 <= c && c <= 43391) || (55216 <= c && c <= 55295);
21
+ };
54
22
  UtilStrByteMode.lenB = function (strVal) {
55
- // convert to byte[] by default-encoding
56
23
  return UtilStrByteMode.Encoding.GetByteCount(strVal);
57
24
  };
58
- /// <summary> Substring of String
59
- /// Extracts a specified number of characters (a substring) from a string.
60
- /// If a DBCS character is divided in two, it will be replace to a space.
61
- ///
62
- /// </summary>
63
- /// <param name="strVal:">string (in Unicode)
64
- /// </param>
65
- /// <param name="ofs:">starting position (byte) of the substring
66
- /// </param>
67
- /// <param name="len:">number of bytes to be extracted (i.e. bytes of substring)
68
- /// </param>
69
- /// <returns> substring
70
- ///
71
- /// Example: midB("abXYc", 2, 4)
72
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
73
- /// "bX ".
74
- /// </returns>
75
25
  UtilStrByteMode.midB = function (strVal, ofs, len) {
76
- var intValidMaxIndex = -1; // param #1 of substring
77
- var intValidMinIndex = -1; // param #2 of substring
78
- var bHeadSpace = false; // flag: need to add space
79
- var bEndSpace = false; // flag: need to add space
26
+ var intValidMaxIndex = -1;
27
+ var intValidMinIndex = -1;
28
+ var bHeadSpace = false;
29
+ var bEndSpace = false;
80
30
  var strRet;
81
- // check and modify ofs & len
82
31
  if (len <= 0)
83
32
  return "";
84
33
  if (ofs <= 0) {
@@ -92,7 +41,6 @@
92
41
  var LenMax = intByteLength - ofs;
93
42
  if (LenMax < len)
94
43
  len = LenMax;
95
- // set MinIndex and MaxIndex for substring
96
44
  intByteLength = 0;
97
45
  for (var intIndex = 0; intIndex < strVal.length; intIndex = intIndex + 1) {
98
46
  var s = strVal.substr(intIndex, 1);
@@ -120,9 +68,7 @@
120
68
  }
121
69
  }
122
70
  }
123
- // prepare for substring
124
71
  var strbufAddingBuf = new mscorelib.StringBuilder(len);
125
- // execute Mid
126
72
  if (bHeadSpace) {
127
73
  strbufAddingBuf.Append(' ');
128
74
  }
@@ -136,39 +82,9 @@
136
82
  strbufAddingBuf = null;
137
83
  return strRet;
138
84
  };
139
- /// <summary> Get Characters from Left of String
140
- /// Returns a specified number of bytes from the left side of a string.
141
- /// If a DBCS character is divided in two, it will be replace to a space.
142
- ///
143
- /// </summary>
144
- /// <param name="strVal:">string (in Unicode)
145
- /// </param>
146
- /// <param name="len:">number of bytes to be retured
147
- /// </param>
148
- /// <returns> output string
149
- ///
150
- /// Example: leftB("abXYc", 4)
151
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
152
- /// "abX".
153
- /// </returns>
154
85
  UtilStrByteMode.leftB = function (strVal, len) {
155
86
  return UtilStrByteMode.midB(strVal, 0, len);
156
87
  };
157
- /// <summary> Get Characters from Right of String
158
- /// Returns a specified number of bytes from the right side of a string.
159
- /// If a DBCS character is divided in two, it will be replace to a space.
160
- ///
161
- /// </summary>
162
- /// <param name="strVal:">string (in Unicode)
163
- /// </param>
164
- /// <param name="len:">number of bytes to be retured
165
- /// </param>
166
- /// <returns> output string
167
- ///
168
- /// Example: rightB("abXYc", 4)
169
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
170
- /// " Yc".
171
- /// </returns>
172
88
  UtilStrByteMode.rightB = function (strVal, len) {
173
89
  var byteFldsValLen = UtilStrByteMode.lenB(strVal);
174
90
  if (len < 0) {
@@ -180,27 +96,6 @@
180
96
  }
181
97
  return UtilStrByteMode.midB(strVal, ofs, len);
182
98
  };
183
- /// <summary> Insert String
184
- /// Inserts one string into another.
185
- /// If a DBCS character is divided in two, it will be replace to a space.
186
- ///
187
- /// </summary>
188
- /// <param name="strTarget:">A string that represents the target string.
189
- /// </param>
190
- /// <param name="strSource:">A string that represents the source string.
191
- /// </param>
192
- /// <param name="ofs:">A number that represents the starting position (byte) in
193
- /// the target.
194
- /// </param>
195
- /// <param name="len:">A number that represents the number of bytes from the
196
- /// source that will be inserted into the target.
197
- /// </param>
198
- /// <returns> output string
199
- ///
200
- /// Example: insB("abXYc", "de", 4, 1)
201
- /// Where 'a', 'b', 'c', 'd' and 'e' are SBCS, and 'X' and 'Y' are DBCS,
202
- /// it returns "ab d Yc".
203
- /// </returns>
204
99
  UtilStrByteMode.insB = function (strTarget, strSource, ofs, len) {
205
100
  if (ofs < 0) {
206
101
  ofs = 0;
@@ -227,24 +122,6 @@
227
122
  strbufRetVal.Append(UtilStrByteMode.rightB(strTarget, intTargetLenB - ofs));
228
123
  return strbufRetVal.ToString();
229
124
  };
230
- /// <summary> Delete Characters
231
- /// Delete characters from a string.
232
- /// If a DBCS character is divided in two, it will be replace to a space.
233
- ///
234
- /// </summary>
235
- /// <param name="strVal:">string (in Unicode)
236
- /// </param>
237
- /// <param name="ofs:">The position (byte) of the first character to be deleted.
238
- /// </param>
239
- /// <param name="len:">The number of characters to be deleted, beginning with
240
- /// position start and proceeding rightward.
241
- /// </param>
242
- /// <returns> output string
243
- ///
244
- /// Example: delB("abXYc", 2, 4)
245
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
246
- /// "a c".
247
- /// </returns>
248
125
  UtilStrByteMode.delB = function (strVal, ofs, len) {
249
126
  if (ofs < 0) {
250
127
  ofs = 0;
@@ -276,55 +153,16 @@
276
153
  }
277
154
  return strRet;
278
155
  };
279
- /// <summary> In-String Search
280
- /// Returns a number that represents the first position (byte) of a
281
- /// substring within a string.
282
- ///
283
- /// </summary>
284
- /// <param name="strTarget:">string (in Unicode)
285
- /// </param>
286
- /// <param name="strSearch:">string which will be the search argument in string
287
- /// </param>
288
- /// <returns> number, 0 if not found
289
- ///
290
- /// Example: instrB("abXYc", "Y")
291
- /// Where 'a', 'b' and 'c' are SBCS, and 'X' and 'Y' are DBCS, it returns
292
- /// 5.
293
- /// </returns>
294
156
  UtilStrByteMode.instrB = function (strTarget, strSearch) {
295
157
  if (strSearch.length === 0) {
296
- // nothing to look for
297
158
  return 0;
298
159
  }
299
160
  var ofs = strTarget.indexOf(strSearch);
300
161
  if (ofs < 0) {
301
- // not found
302
162
  return 0;
303
163
  }
304
164
  return UtilStrByteMode.lenB(strTarget.substr(0, ofs)) + 1;
305
165
  };
306
- /// <summary> Replace Substring Within a String (Byte Mode)
307
- /// Replaces a substring within a string with another substring.
308
- /// If a DBCS character is divided in two, it will be replace to a space.
309
- ///
310
- /// </summary>
311
- /// <param name="strTarget:">target string where the replacement will take place.
312
- /// </param>
313
- /// <param name="strOrigin:">string that provides the substring to be copied to
314
- /// target.
315
- /// </param>
316
- /// <param name="ofs:">the first position (byte) in the target string that will
317
- /// receive the substring from origin.
318
- /// </param>
319
- /// <param name="len:">the number of bytes that will be moved from origin to
320
- /// target, starting from the leftmost character of origin.
321
- /// </param>
322
- /// <returns> string containing modified target string
323
- ///
324
- /// Example: repB("abXYc", "de", 4, 2)
325
- /// Where 'a', 'b', 'c', 'd' and 'e' are SBCS, and 'X' and 'Y' are DBCS,
326
- /// it returns "ab de c".
327
- /// </returns>
328
166
  UtilStrByteMode.repB = function (strTarget, strOrigin, ofs, len) {
329
167
  var strbufAddingBuf = new mscorelib.StringBuilder();
330
168
  if (ofs < 0) {
@@ -347,33 +185,12 @@
347
185
  if (intRightLen > 0) {
348
186
  strbufAddingBuf.Append(UtilStrByteMode.rightB(strTarget, intRightLen));
349
187
  }
350
- // add blanks to the end
351
188
  intAddSpaceLen = len - UtilStrByteMode.lenB(strOrigin);
352
189
  for (; intAddSpaceLen > 0; intAddSpaceLen--) {
353
190
  strbufAddingBuf.Append(' ');
354
191
  }
355
192
  return strbufAddingBuf.ToString();
356
193
  };
357
- /// <summary> Replace Substring Within a String (Character Mode)
358
- /// Replaces a substring within a string with another substring.
359
- ///
360
- /// </summary>
361
- /// <param name="strTarget:">target string where the replacement will take place.
362
- /// </param>
363
- /// <param name="strOrigin:">string that provides the substring to be copied to
364
- /// target.
365
- /// </param>
366
- /// <param name="ofs:">the first position (character) in the target string that
367
- /// will receive the substring from origin.
368
- /// </param>
369
- /// <param name="len:">the number of characters that will be moved from origin
370
- /// to target, starting from the leftmost character of origin.
371
- /// </param>
372
- /// <returns> string containing modified target string
373
- ///
374
- /// Example: repB("abXYc", "de", 4, 2)
375
- /// Whether each character is SBCS or DBCS, it returns "abXde".
376
- /// </returns>
377
194
  UtilStrByteMode.repC = function (strTarget, strOrigin, ofs, len) {
378
195
  var strbufAddingBuf = new mscorelib.StringBuilder();
379
196
  if (ofs < 0) {
@@ -388,7 +205,6 @@
388
205
  len = 0;
389
206
  }
390
207
  strbufAddingBuf.Append(strTarget.substr(0, ofs));
391
- // add blanks between strTarget and strOrigin
392
208
  var intAddSpaceLen = ofs - strTarget.length;
393
209
  for (; intAddSpaceLen > 0; intAddSpaceLen--)
394
210
  strbufAddingBuf.Append(' ');
@@ -402,18 +218,9 @@
402
218
  }
403
219
  return strbufAddingBuf.ToString();
404
220
  };
405
- /// <summary> Checks whether a character is 1 byte (halfwidth) or not (fullwidth)
406
- /// Returns true if the character is represented by 1 byte in non-Unicode
407
- /// encoding.
408
- /// </summary>
409
- /// <param name="letter:">a character to be checked.
410
- /// </param>
411
- /// <returns> true if the character is halfwidth (SBCS), or false if it is
412
- /// fullwidth (DBCS).
413
- /// </returns>
414
221
  UtilStrByteMode.isHalfWidth = function (str) {
415
222
  var letter = str.charCodeAt(0);
416
- if (32 <= /*' '*/ letter && letter <= 126 /*'~'*/) {
223
+ if (32 <= letter && letter <= 126) {
417
224
  return true;
418
225
  }
419
226
  else {
@@ -423,33 +230,18 @@
423
230
  }
424
231
  return false;
425
232
  };
426
- /// <summary> Checks whether a character is halfwidth digit letter
427
- /// Do not use "Character.isDigit" which cannot distinguish between
428
- /// halfwidth digit letter(SBCS) and fullwidth difit letter(DBCS).
429
- /// </summary>
430
- /// <param name="letter:">a character to be checked.
431
- /// </param>
432
- /// <returns> true if the character is halfwidth digit letter, or
433
- /// false if it is DBCS or not digit letter.
434
- /// </returns>
435
233
  UtilStrByteMode.isDigit = function (letter) {
436
- return 48 <= /*'0'*/ letter.charCodeAt(0) && letter.charCodeAt(0) <= 57 /*'9'*/;
437
- };
438
- /// <summary>Checks whether a character is one of those supported for # Alpha Mask</summary>
439
- /// <param name="letter:">a character to be checked.
440
- /// </param>
441
- /// <returns> true if the character is halfwidth digit letter, or
442
- /// false if it is DBCS or not digit letter.
443
- /// </returns>
234
+ return 48 <= letter.charCodeAt(0) && letter.charCodeAt(0) <= 57;
235
+ };
444
236
  UtilStrByteMode.asNumeric = function (letter) {
445
237
  var result;
446
238
  switch (letter.charCodeAt(0)) {
447
- case 42: /*'*'*/
448
- case 43: /*'+'*/
449
- case 44: /*','*/
450
- case 45: /*'-'*/
451
- case 46: /*'.'*/
452
- case 47: /*'/'*/
239
+ case 42:
240
+ case 43:
241
+ case 44:
242
+ case 45:
243
+ case 46:
244
+ case 47:
453
245
  result = true;
454
246
  break;
455
247
  default:
@@ -458,47 +250,12 @@
458
250
  }
459
251
  return result;
460
252
  };
461
- /// <summary> Converts a position for the 1st string (Source) to a position for
462
- /// the 2nd string (Dest).
463
- /// If a double byte character exists in the strings, the position for the
464
- /// Source could be different from the position for the Dest.
465
- /// (DBCS Support)
466
- ///
467
- /// </summary>
468
- /// <param name="strSource:">Source string
469
- /// </param>
470
- /// <param name="strDest:">Dest string
471
- /// </param>
472
- /// <param name="pos:">position in the Source string
473
- /// </param>
474
- /// <param name="isAdvance:">advance or retreat the ret pos if a DBCS char is split
475
- /// </param>
476
- /// <returns> position in the Dest string
477
- ///
478
- /// Example: convPos("abcYZ", "YZabc", 4)
479
- /// It returns 4, if the all characters in the strings are SBCS.
480
- ///
481
- /// If 'a', 'b' and 'c' are SBCS, and 'Y' and 'Z' are DBCS, it
482
- /// returns 3.
483
- /// pos
484
- /// Unicode index 0 1 2 3 [4]
485
- /// +-------------+
486
- /// Source string |a|b|c| Y | Z |
487
- /// +-------------+
488
- /// ANSI index 0 1 2 3 4[5]6
489
- /// +-------------+
490
- /// Dest string | Y | Z |a|b|c|
491
- /// +-------------+
492
- /// Unicode index 0 1 2[3]4
493
- /// ret
494
- /// </returns>
495
253
  UtilStrByteMode.convPos = function (strSource, strDest, pos, isAdvance) {
496
254
  var retPos;
497
255
  if (pos < 0)
498
256
  return 0;
499
257
  if (pos > strSource.length)
500
258
  pos = strSource.length;
501
- // add blanks to the Dest string if it is shorter than the Src string
502
259
  var diffLen = UtilStrByteMode.lenB(strSource) - UtilStrByteMode.lenB(strDest);
503
260
  if (diffLen > 0) {
504
261
  var stringBuilder = new mscorelib.StringBuilder(strDest);
@@ -509,23 +266,11 @@
509
266
  var byteSource = UtilStrByteMode.Encoding.GetBytes(strSource.substr(0, pos));
510
267
  var strLeftB = UtilStrByteMode.leftB(strDest, byteSource.length);
511
268
  retPos = strLeftB.length;
512
- if (!isAdvance && retPos > 0 && strLeftB.charCodeAt(retPos - 1) === 32 /*' '*/ && strDest.charCodeAt(retPos - 1) !== 32 /*' '*/) {
269
+ if (!isAdvance && retPos > 0 && strLeftB.charCodeAt(retPos - 1) === 32 && strDest.charCodeAt(retPos - 1) !== 32) {
513
270
  retPos = retPos - 1;
514
271
  }
515
272
  return retPos;
516
273
  };
517
- /// <summary> return the number of characters of picture which corresponds to
518
- /// given string.
519
- /// </summary>
520
- /// <param name="str:">given string
521
- /// </param>
522
- /// <param name="picture:">picture
523
- /// </param>
524
- /// <returns> minimal length of picture
525
- /// Example: getMinLenPicture("ZZ20/11/", "JJJJYY/MM/DD") [ZZ is DBCS]
526
- /// It returns 10.
527
- /// </returns>
528
- /// (DBCS Support)
529
274
  UtilStrByteMode.getMinLenPicture = function (str, picture) {
530
275
  var len = 0;
531
276
  if (UtilStrByteMode.lenB(picture) - UtilStrByteMode.lenB(str) > 0) {
@@ -535,18 +280,6 @@
535
280
  len = picture.length;
536
281
  return len;
537
282
  };
538
- /// <summary>
539
- /// </summary> Compares two specified strings in the DBCS sort order and returns an integer
540
- /// that indicates their relative position.
541
- /// <param name="str1:">The first string to compare.
542
- /// </param>
543
- /// <param name="str2:">The second string to compare.
544
- /// </param>
545
- /// <returns>an integer that indicates the lexical relationship between the two strings.
546
- /// -1: str1 is less than str2.
547
- /// 0: str1 equals str2.
548
- /// 1: str1 is greater than str2.
549
- /// </returns>
550
283
  UtilStrByteMode.strcmp = function (str1, str2) {
551
284
  var array1 = UtilStrByteMode.Encoding.GetBytes(str1);
552
285
  var array2 = UtilStrByteMode.Encoding.GetBytes(str2);
@@ -568,22 +301,15 @@
568
301
  return UtilStrByteMode;
569
302
  }());
570
303
  UtilStrByteMode.Encoding = mscorelib.Encoding.UTF8;
571
- // TODO : need to check what to do with CultureInfo
572
304
  UtilStrByteMode.strNavigatorLang = window.navigator.language;
573
305
  UtilStrByteMode._bLocaleDefLangJPN = UtilStrByteMode.strNavigatorLang.startsWith('ja');
574
306
  UtilStrByteMode._bLocaleDefLangCHN = UtilStrByteMode.strNavigatorLang.startsWith('zh');
575
307
  UtilStrByteMode._bLocaleDefLangKOR = UtilStrByteMode.strNavigatorLang.startsWith('ko');
576
308
 
577
- //@dynamic
578
309
  var Rtf_SYMBOL = /** @class */ (function () {
579
- /* index into property table if kwd == kwdProp */
580
- /* index into destination table if kwd == kwdDest */
581
- /* character to print if kwd == kwdChar */
582
310
  function Rtf_SYMBOL(keyWord, kwd, idxInRgprop) {
583
311
  this.szKeyword = null;
584
- /* RTF keyword */
585
312
  this.kwd = null;
586
- /* base action to take */
587
313
  this.idxInRgprop = null;
588
314
  this.szKeyword = keyWord;
589
315
  this.kwd = kwd;
@@ -591,12 +317,9 @@
591
317
  }
592
318
  return Rtf_SYMBOL;
593
319
  }());
594
- // @dynamic
595
320
  var Rtf_PROP = /** @class */ (function () {
596
- /* structure containing value */
597
321
  function Rtf_PROP(actn, prop) {
598
322
  this.actn = null;
599
- /* size of value */
600
323
  this.prop = null;
601
324
  this.actn = actn;
602
325
  this.prop = prop;
@@ -694,15 +417,6 @@
694
417
  Rtf_ErrorRtf[Rtf_ErrorRtf["END_OF_FILE"] = 7] = "END_OF_FILE";
695
418
  Rtf_ErrorRtf[Rtf_ErrorRtf["BUFFER_TOO_SMALL"] = 8] = "BUFFER_TOO_SMALL";
696
419
  })(exports.Rtf_ErrorRtf || (exports.Rtf_ErrorRtf = {}));
697
- // TODO :
698
- // Rtf_RtfChar should actually be enum.
699
- // But computed string values are not allowed to be defined in enum.
700
- // So, we cannot have String.fromCharCode(XXX).
701
- // We have 2 options:
702
- // 1. Convert this enum into a class with all static readonly items.
703
- // 2. Keep it as enum with numeric values (char codes).
704
- // Going with #1 now, since @2 makes the code ugly.
705
- // Will evalaute later if required.
706
420
  var Rtf_RtfChar = /** @class */ (function () {
707
421
  function Rtf_RtfChar() {
708
422
  }
@@ -727,8 +441,6 @@
727
441
  Rtf_RIS[Rtf_RIS["UNICODE"] = 3] = "UNICODE";
728
442
  })(exports.Rtf_RIS || (exports.Rtf_RIS = {}));
729
443
  var Rtf = /** @class */ (function () {
730
- /// <summary> Constructor
731
- /// </summary>
732
444
  function Rtf() {
733
445
  this._group = 0;
734
446
  this._cbBin = 0;
@@ -757,13 +469,6 @@
757
469
  this.setCodePageTable();
758
470
  }
759
471
  }
760
- /// <summary> Checks if the blob has a Rtf data or not
761
- ///
762
- /// </summary>
763
- /// <param name="str">
764
- /// </param>
765
- /// <returns>
766
- /// </returns>
767
472
  Rtf.isRtf = function (str) {
768
473
  var isRtf = false;
769
474
  if (str !== null && str.startsWith(this.RTF_PREFIX)) {
@@ -771,17 +476,6 @@
771
476
  }
772
477
  return isRtf;
773
478
  };
774
- /// <summary> Converts Rtf Text to Plain Text
775
- /// Step 1: Isolate RTF keywords and send them to ParseKeyword; Push and pop state at the start and end of
776
- /// RTF groups Send text to ParseChar for further processing.
777
- ///
778
- /// </summary>
779
- /// <param name="rtfTxt">
780
- /// </param>
781
- /// <param name="outputTxt">
782
- /// </param>
783
- /// <returns>
784
- /// </returns>
785
479
  Rtf.prototype.toTxt = function (rtfTxt, outputTxt) {
786
480
  var cNibble = 2;
787
481
  var b = 0;
@@ -807,7 +501,6 @@
807
501
  this._index++;
808
502
  if (this._group < 0)
809
503
  return exports.Rtf_ErrorRtf.STACK_UNDERFLOW;
810
- /* if we're parsing binary data, handle it directly */
811
504
  if (this._internalState === exports.Rtf_RIS.BIN) {
812
505
  if ((ec = this.ParseChar(blobChar, outputTxt)) !== exports.Rtf_ErrorRtf.OK)
813
506
  return ec;
@@ -830,22 +523,16 @@
830
523
  return ec;
831
524
  break;
832
525
  case Rtf_RtfChar.LF:
833
- case Rtf_RtfChar.CR: /* cr and lf are noise characters... */
526
+ case Rtf_RtfChar.CR:
834
527
  if (this._processCrlfSpecial) {
835
- /* Once we reach the 0x0a while ProcessCRLFSpecial_, reset the ProcessCRLFSpecial_ */
836
528
  if (blobChar === Rtf_RtfChar.LF) {
837
529
  this._processCrlfSpecial = false;
838
530
  }
839
531
  }
840
532
  else {
841
- /*---------------------------------------------------------------*/
842
- /* skip new lines coming only from the RTF header 1/1/98 - #2390 */
843
- /*---------------------------------------------------------------*/
844
- /* Skip the LF (0x0a) if we are not in the ProcessCRLFSpecial_ */
845
533
  if (blobChar === Rtf_RtfChar.LF || (blobChar === Rtf_RtfChar.CR && skipNewline && !this._outputOnce))
846
534
  break;
847
535
  }
848
- /* falls through */
849
536
  default:
850
537
  if (blobChar !== Rtf_RtfChar.CR)
851
538
  skipNewline = false;
@@ -859,7 +546,6 @@
859
546
  this._internalState = exports.Rtf_RIS.NORM;
860
547
  }
861
548
  else {
862
- /* parsing hex data */
863
549
  if (this._internalState !== exports.Rtf_RIS.HEX)
864
550
  return exports.Rtf_ErrorRtf.ASSERTION;
865
551
  b = b << 4;
@@ -881,22 +567,18 @@
881
567
  if (cNibble === 0) {
882
568
  if (UtilStrByteMode.isLocaleDefLangDBCS()) {
883
569
  charset = this.getCharset(this._fontNum);
884
- // leading byte of a double-byte character
885
570
  if (!skipParseChar && Rtf.is1stByte(b, charset)) {
886
571
  dbcsBytes[0] = b;
887
572
  dbcsBytes[1] = 0;
888
573
  skipParseChar = true;
889
574
  }
890
575
  else {
891
- // trailing byte of a double-byte character
892
576
  if (skipParseChar && Rtf.is2ndByte(b, charset))
893
577
  dbcsBytes[1] = b;
894
- // single-byte character
895
578
  else {
896
579
  dbcsBytes[0] = b;
897
580
  dbcsBytes[1] = 0;
898
581
  }
899
- // convert DBCS to Unicode
900
582
  codePage = this.getCodePage(charset);
901
583
  var workStr = mscorelib.Encoding.GetEncoding(codePage).GetString(dbcsBytes, 0, 2);
902
584
  b = workStr.charCodeAt(0);
@@ -912,36 +594,19 @@
912
594
  this._internalState = exports.Rtf_RIS.NORM;
913
595
  }
914
596
  }
915
- /* end else (ris != risNorm) */
916
597
  break;
917
598
  }
918
- /* switch */
919
599
  }
920
- /* else (ris != risBin) */
921
600
  }
922
- /* while */
923
601
  if (this._group < 0)
924
602
  return exports.Rtf_ErrorRtf.STACK_UNDERFLOW;
925
603
  if (this._group > 0)
926
604
  return exports.Rtf_ErrorRtf.UNMATCHED_BRACE;
927
- /*-------------------------------------------------------------------*/
928
- /* Eliminate suffix of carrige return + line feed */
929
- /* (Check last characters - just in case format is not the expected) */
930
- /*-------------------------------------------------------------------*/
931
605
  currPos = outputTxt.Length;
932
606
  if (currPos >= 3 && (outputTxt.get_Item(currPos - 3) === Rtf_RtfChar.CR && outputTxt.get_Item(currPos - 2) === Rtf_RtfChar.LF && outputTxt.get_Item(currPos - 1) === Rtf_RtfChar.CR || outputTxt.get_Item(currPos - 3) === Rtf_RtfChar.LF && outputTxt.get_Item(currPos - 2) === Rtf_RtfChar.CR && outputTxt.get_Item(currPos - 1) === Rtf_RtfChar.CR))
933
607
  outputTxt.Remove(currPos - 3, 3);
934
608
  return exports.Rtf_ErrorRtf.OK;
935
609
  };
936
- /// <summary> Route the character to the appropriate destination stream.
937
- ///
938
- /// </summary>
939
- /// <param name="ch">
940
- /// </param>
941
- /// <param name="outputTxt">
942
- /// </param>
943
- /// <returns>
944
- /// </returns>
945
610
  Rtf.prototype.ParseChar = function (ch, outputTxt) {
946
611
  var ret = exports.Rtf_ErrorRtf.OK;
947
612
  if (this._internalState === exports.Rtf_RIS.BIN && --this._cbBin <= 0) {
@@ -949,28 +614,14 @@
949
614
  }
950
615
  if (this._destState === exports.Rtf_RDS.SKIP) {
951
616
  }
952
- /* Toss this character. */
953
617
  else if (this._destState === exports.Rtf_RDS.NORM) {
954
- /* Output a character. Properties are valid at this point. */
955
618
  ret = this.PrintChar(ch, outputTxt);
956
619
  }
957
620
  else {
958
- /* handle other destinations.... */
959
621
  }
960
622
  return ret;
961
623
  };
962
- /// <summary> Send a character to the output file.
963
- ///
964
- /// </summary>
965
- /// <param name="ch">
966
- /// </param>
967
- /// <param name="outputTxt">
968
- /// </param>
969
- /// <returns>
970
- /// </returns>
971
624
  Rtf.prototype.PrintChar = function (ch, outputTxt) {
972
- /* Allow carrige return + line feed in text, but remove bullet sign */
973
- /*------------------------------------------------------------------*/
974
625
  if ((ch >= ' ' || ch === Rtf_RtfChar.CR || ch === Rtf_RtfChar.LF) && ch !== String.fromCharCode(183)) {
975
626
  outputTxt.Append(ch);
976
627
  }
@@ -979,11 +630,6 @@
979
630
  }
980
631
  return exports.Rtf_ErrorRtf.OK;
981
632
  };
982
- /// <summary> Save relevant info on a linked list of SAVE structures.
983
- ///
984
- /// </summary>
985
- /// <returns>
986
- /// </returns>
987
633
  Rtf.prototype.PushState = function () {
988
634
  var stackSave = new Rtf_StackSave();
989
635
  if (stackSave === null) {
@@ -996,11 +642,6 @@
996
642
  this._group++;
997
643
  return exports.Rtf_ErrorRtf.OK;
998
644
  };
999
- /// <summary> Always restore relevant info from the top of the SAVE list.
1000
- ///
1001
- /// </summary>
1002
- /// <returns>
1003
- /// </returns>
1004
645
  Rtf.prototype.PopState = function () {
1005
646
  var savedPop = this._stack.pop();
1006
647
  if (savedPop === null) {
@@ -1011,15 +652,6 @@
1011
652
  this._group--;
1012
653
  return exports.Rtf_ErrorRtf.OK;
1013
654
  };
1014
- /// <summary> Step 2: get a control word (and its associated value) and call TranslateKeyword to dispatch the control.
1015
- ///
1016
- /// </summary>
1017
- /// <param name="rtfTxt">
1018
- /// </param>
1019
- /// <param name="outputTxt">
1020
- /// </param>
1021
- /// <returns>
1022
- /// </returns>
1023
655
  Rtf.prototype.ParseKeyword = function (rtfTxt, outputTxt) {
1024
656
  var ch;
1025
657
  var fNeg = false;
@@ -1028,7 +660,6 @@
1028
660
  if ((ch = rtfTxt[this._index++]) === String.fromCharCode(0)) {
1029
661
  return exports.Rtf_ErrorRtf.END_OF_FILE;
1030
662
  }
1031
- /* a control symbol; no delimiter. */
1032
663
  if (!mscorelib.NChar.IsLetter(ch)) {
1033
664
  szKeyword = szKeyword + ch;
1034
665
  return this.TranslateKeyword(szKeyword, outputTxt);
@@ -1050,13 +681,6 @@
1050
681
  if (ch !== ' ')
1051
682
  this._index--;
1052
683
  if (szKeyword === Rtf.CHAR_PAR) {
1053
- /* if we get a RTF sequence of \par[0xd][0xa], ie a \par kwd followed */
1054
- /* immidiately by the CR and LF, then ignore the \par kwd. otherwise */
1055
- /* we will translate the \par - which translates to a LF (0xa) and also */
1056
- /* the following 0x0d is translated to 0x0a, thus resulting in TWO LF's */
1057
- /* being inserted instead of just one LF. So by skipping [\par] and */
1058
- /* translating only the [0xd 0xa] will result in only one LF appearing */
1059
- /* - which is the desired behaviour */
1060
684
  if (rtfTxt[this._index] === Rtf_RtfChar.CR && rtfTxt[this._index + 1] === Rtf_RtfChar.LF)
1061
685
  this._processCrlfSpecial = true;
1062
686
  }
@@ -1067,37 +691,22 @@
1067
691
  return this.TranslateKeyword(szKeyword, outputTxt);
1068
692
  }
1069
693
  };
1070
- /// <summary> Step 3. Search rgsymRtf for szKeyword and evaluate it appropriately.
1071
- ///
1072
- /// </summary>
1073
- /// <param name="szKeyword">
1074
- /// </param>
1075
- /// <param name="outputTxt">
1076
- /// </param>
1077
- /// <returns>
1078
- /// </returns>
1079
694
  Rtf.prototype.TranslateKeyword = function (szKeyword, outputTxt) {
1080
695
  var result = exports.Rtf_ErrorRtf.OK;
1081
696
  var isym;
1082
- /* search for szKeyword in rgsymRtf */
1083
697
  for (isym = 0; isym < Rtf.rgsymRtf.length; isym++) {
1084
698
  if (szKeyword === Rtf.rgsymRtf[isym].szKeyword) {
1085
699
  break;
1086
700
  }
1087
701
  }
1088
- /* control word not found */
1089
702
  if (isym === Rtf.rgsymRtf.length) {
1090
703
  if (this._skipDestIfUnk) {
1091
- /* if this is a new destination */
1092
704
  this._destState = exports.Rtf_RDS.SKIP;
1093
- /* skip the destination */
1094
705
  }
1095
- /* else just discard it */
1096
706
  this._skipDestIfUnk = false;
1097
707
  }
1098
708
  else {
1099
709
  result = exports.Rtf_ErrorRtf.BAD_TABLE;
1100
- /* found it! use kwd and idxInRgprop to determine what to do with it. */
1101
710
  this._skipDestIfUnk = false;
1102
711
  if (Rtf.rgsymRtf[isym].kwd === exports.Rtf_KWD.PROP) {
1103
712
  result = this.validateProp(Rtf.rgsymRtf[isym].idxInRgprop);
@@ -1114,21 +723,11 @@
1114
723
  }
1115
724
  return result;
1116
725
  };
1117
- /// <summary> Validate the property identified by _iprop_ to the value _val_.
1118
- /// previously called Applypropchange
1119
- /// </summary>
1120
- /// <param name="iprop">
1121
- /// </param>
1122
- /// <returns>
1123
- /// </returns>
1124
726
  Rtf.prototype.validateProp = function (iprop) {
1125
727
  var ret = exports.Rtf_ErrorRtf.OK;
1126
728
  if (this._destState === exports.Rtf_RDS.SKIP) {
1127
- /* If we're skipping text, */
1128
729
  return ret;
1129
- /* don't do anything. */
1130
730
  }
1131
- /* validate prop */
1132
731
  if (Rtf.rgprop[iprop].prop !== exports.Rtf_PROPTYPE.DOP && Rtf.rgprop[iprop].prop !== exports.Rtf_PROPTYPE.SEP &&
1133
732
  Rtf.rgprop[iprop].prop !== exports.Rtf_PROPTYPE.PAP && Rtf.rgprop[iprop].prop !== exports.Rtf_PROPTYPE.CHP &&
1134
733
  Rtf.rgprop[iprop].actn !== exports.Rtf_ACTN.SPEC) {
@@ -1139,35 +738,18 @@
1139
738
  }
1140
739
  return ret;
1141
740
  };
1142
- /// <summary> Change to the destination state.
1143
- /// previously called ChangeDest
1144
- /// </summary>
1145
- /// <returns>
1146
- /// </returns>
1147
741
  Rtf.prototype.changeDestState = function () {
1148
742
  if (this._destState === exports.Rtf_RDS.SKIP) {
1149
- /* if we're skipping text, */
1150
743
  return exports.Rtf_ErrorRtf.OK;
1151
- /* don't do anything */
1152
744
  }
1153
745
  this._destState = exports.Rtf_RDS.SKIP;
1154
- /* when in doubt, skip it... */
1155
746
  return exports.Rtf_ErrorRtf.OK;
1156
747
  };
1157
- /// <summary> Evaluate an RTF control that needs special processing.
1158
- ///
1159
- /// </summary>
1160
- /// <param name="ipfn">
1161
- /// </param>
1162
- /// <returns>
1163
- /// </returns>
1164
748
  Rtf.prototype.ParseSpecialKeyword = function (ipfn) {
1165
749
  var ret = exports.Rtf_ErrorRtf.OK;
1166
750
  if (!UtilStrByteMode.isLocaleDefLangDBCS()) {
1167
751
  if (this._destState === exports.Rtf_RDS.SKIP && ipfn !== exports.Rtf_IPFN.BIN) {
1168
- /* if we're skipping, and it's not */
1169
752
  return ret;
1170
- /* the \bin keyword, ignore it. */
1171
753
  }
1172
754
  if (ipfn === exports.Rtf_IPFN.FONT || ipfn === exports.Rtf_IPFN.CHARSET || ipfn === exports.Rtf_IPFN.UNICODE) {
1173
755
  return ret;
@@ -1221,15 +803,6 @@
1221
803
  }
1222
804
  return ret;
1223
805
  };
1224
- /// <summary> Checks if the byte is within the trailing byte range.
1225
- ///
1226
- /// </summary>
1227
- /// <param name="dbcsBytes">
1228
- /// </param>
1229
- /// <param name="charset">
1230
- /// </param>
1231
- /// <returns>
1232
- /// </returns>
1233
806
  Rtf.is2ndByte = function (dbcsBytes, charset) {
1234
807
  var ret = false;
1235
808
  if (dbcsBytes > 255)
@@ -1248,35 +821,21 @@
1248
821
  }
1249
822
  return ret;
1250
823
  };
1251
- /// <summary> Create a hashtable of codepage associated with charset.
1252
- ///
1253
- /// </summary>
1254
- /// <param>
1255
- /// <returns>
1256
- /// </returns>
1257
824
  Rtf.prototype.setCodePageTable = function () {
1258
- // add elements with key (charset) and value (codepage) into the table.
1259
- this._codePageTable.set_Item(0, 1252); // ANSI_CHARSET
1260
- this._codePageTable.set_Item(128, 932); // SHIFTJIS_CHARSET
1261
- this._codePageTable.set_Item(129, 949); // HANGUL_CHARSET
1262
- this._codePageTable.set_Item(134, 936); // GB2312_CHARSET
1263
- this._codePageTable.set_Item(136, 950); // CHINESEBIG5_CHARSET
1264
- this._codePageTable.set_Item(161, 1253); // GREEK_CHARSET
1265
- this._codePageTable.set_Item(162, 1254); // TURKISH_CHARSET
1266
- this._codePageTable.set_Item(177, 1255); // HEBREW_CHARSET
1267
- this._codePageTable.set_Item(178, 1256); // ARABIC _CHARSET
1268
- this._codePageTable.set_Item(186, 1257); // BALTIC_CHARSET
1269
- this._codePageTable.set_Item(204, 1251); // RUSSIAN_CHARSET
1270
- this._codePageTable.set_Item(222, 874); // THAI_CHARSET
1271
- this._codePageTable.set_Item(238, 1250); // EASTEUROPE_CHARSET
1272
- };
1273
- /// <summary> Get codepage corresponding to the specified charset.
1274
- ///
1275
- /// </summary>
1276
- /// <param name="charset">
1277
- /// </param>
1278
- /// <returns>
1279
- /// </returns>
825
+ this._codePageTable.set_Item(0, 1252);
826
+ this._codePageTable.set_Item(128, 932);
827
+ this._codePageTable.set_Item(129, 949);
828
+ this._codePageTable.set_Item(134, 936);
829
+ this._codePageTable.set_Item(136, 950);
830
+ this._codePageTable.set_Item(161, 1253);
831
+ this._codePageTable.set_Item(162, 1254);
832
+ this._codePageTable.set_Item(177, 1255);
833
+ this._codePageTable.set_Item(178, 1256);
834
+ this._codePageTable.set_Item(186, 1257);
835
+ this._codePageTable.set_Item(204, 1251);
836
+ this._codePageTable.set_Item(222, 874);
837
+ this._codePageTable.set_Item(238, 1250);
838
+ };
1280
839
  Rtf.prototype.getCodePage = function (charset) {
1281
840
  var codePage = 0;
1282
841
  if (this._codePageTable.ContainsKey(charset)) {
@@ -1284,13 +843,6 @@
1284
843
  }
1285
844
  return codePage;
1286
845
  };
1287
- /// <summary> Get charset corresponding to the specified font index.
1288
- ///
1289
- /// </summary>
1290
- /// <param name="font">
1291
- /// </param>
1292
- /// <returns>
1293
- /// </returns>
1294
846
  Rtf.prototype.getCharset = function (font) {
1295
847
  var charset = 0;
1296
848
  if (this._charsetTable.ContainsKey(font)) {
@@ -1302,7 +854,6 @@
1302
854
  }());
1303
855
  Rtf.RTF_PREFIX = "{\\rtf";
1304
856
  Rtf.CHAR_PAR = "par";
1305
- /* Property descriptions */
1306
857
  Rtf.rgprop = [
1307
858
  new Rtf_PROP(exports.Rtf_ACTN.BYTE, exports.Rtf_PROPTYPE.CHP), new Rtf_PROP(exports.Rtf_ACTN.BYTE, exports.Rtf_PROPTYPE.CHP),
1308
859
  new Rtf_PROP(exports.Rtf_ACTN.BYTE, exports.Rtf_PROPTYPE.CHP), new Rtf_PROP(exports.Rtf_ACTN.BYTE, exports.Rtf_PROPTYPE.CHP),
@@ -1320,7 +871,6 @@
1320
871
  new Rtf_PROP(exports.Rtf_ACTN.BYTE, exports.Rtf_PROPTYPE.PAP), new Rtf_PROP(exports.Rtf_ACTN.SPEC, exports.Rtf_PROPTYPE.PAP),
1321
872
  new Rtf_PROP(exports.Rtf_ACTN.SPEC, exports.Rtf_PROPTYPE.CHP), new Rtf_PROP(exports.Rtf_ACTN.SPEC, exports.Rtf_PROPTYPE.SEP)
1322
873
  ];
1323
- /* Keyword descriptions */
1324
874
  Rtf.rgsymRtf = [
1325
875
  new Rtf_SYMBOL("b", exports.Rtf_KWD.PROP, exports.Rtf_IPROP.BOLD), new Rtf_SYMBOL("ul", exports.Rtf_KWD.PROP, exports.Rtf_IPROP.UNDERLINE),
1326
876
  new Rtf_SYMBOL("i", exports.Rtf_KWD.PROP, exports.Rtf_IPROP.ITALIC), new Rtf_SYMBOL("li", exports.Rtf_KWD.PROP, exports.Rtf_IPROP.LEFT_IND),
@@ -1380,7 +930,6 @@
1380
930
  var StrUtil = /** @class */ (function () {
1381
931
  function StrUtil() {
1382
932
  }
1383
- /// <summary> trim the end of the string</summary>
1384
933
  StrUtil.mem_trim = function (str, len) {
1385
934
  var result;
1386
935
  if (len > 0) {
@@ -1415,15 +964,6 @@
1415
964
  }
1416
965
  StrUtil.memcpy_1(dest, destCount, src, scrCountOrSrcCount, count);
1417
966
  };
1418
- /// <summary>
1419
- /// copy part of string into another string, like memcpy of C, but 4 string only
1420
- /// </summary>
1421
- /// <param name = "dest">string</param>
1422
- /// <param name = "destCount">of counter start from in destignation string</param>
1423
- /// <param name = "src">string</param>
1424
- /// <param name = "scrCount">of counter start from in source string</param>
1425
- /// <param name = "count"></param>
1426
- /// <returns> new value of destignation string</returns>
1427
967
  StrUtil.memcpy_0 = function (dest, destCount, src, scrCount, count) {
1428
968
  var stringBuilder = new mscorelib.StringBuilder(dest.substr(0, destCount));
1429
969
  if (scrCount + count < src.length) {
@@ -1450,14 +990,6 @@
1450
990
  }
1451
991
  StrUtil.memset_1(dest, destCount, inVal, counter);
1452
992
  };
1453
- /// <summary>
1454
- /// insert to string chars n times
1455
- /// </summary>
1456
- /// <param name = "dest">string</param>
1457
- /// <param name = "destCount">of counter start from in destignation string to start insertion of char from</param>
1458
- /// <param name = "inVal">2 insert</param>
1459
- /// <param name = "counter">- number of times to insert the char</param>
1460
- /// <returns> new value of destignation string</returns>
1461
993
  StrUtil.memset_0 = function (dest, destCount, inVal, counter) {
1462
994
  var first = new mscorelib.StringBuilder(dest.substr(0, destCount));
1463
995
  while (counter > 0) {
@@ -1486,29 +1018,14 @@
1486
1018
  }
1487
1019
  return result;
1488
1020
  };
1489
- /*******************************/
1490
- /// <summary>
1491
- /// Reverses string values.
1492
- /// </summary>
1493
- /// <param name="text">The StringBuilder object containing the string to be reversed.</param>
1494
- /// <returns>The reversed string contained in a StringBuilder object.</returns>
1495
1021
  StrUtil.ReverseString = function (text) {
1496
- // TODO: use string.Reverse()
1497
1022
  var array = mscorelib.NString.ToCharArray(text.ToString());
1498
1023
  array.reverse();
1499
1024
  return new mscorelib.StringBuilder(mscorelib.NString.FromChars(array));
1500
1025
  };
1501
- /// <summary> remove spaces from the right side of string</summary>
1502
- /// <param name="str">the string to trim
1503
- /// </param>
1504
1026
  StrUtil.rtrim = function (str) {
1505
1027
  return StrUtil.rtrimWithNull(str, false);
1506
1028
  };
1507
- /// <summary> remove spaces and/or Null chars from the right side of string</summary>
1508
- /// <param name="str">the string to trim
1509
- /// </param>
1510
- /// <param name="trimNullChars">Whether to remove NULL characters or not
1511
- /// </param>
1512
1029
  StrUtil.rtrimWithNull = function (str, trimNullChars) {
1513
1030
  var result;
1514
1031
  if (typeof str === "undefined" || str === null || str.length === 0) {
@@ -1517,7 +1034,7 @@
1517
1034
  else {
1518
1035
  var idx = str.length - 1;
1519
1036
  if (trimNullChars) {
1520
- while (idx >= 0 && (str[idx] === ' ' || str[idx] === String.fromCharCode(0) /*''*/)) {
1037
+ while (idx >= 0 && (str[idx] === ' ' || str[idx] === String.fromCharCode(0))) {
1521
1038
  idx = idx - 1;
1522
1039
  }
1523
1040
  }
@@ -1536,9 +1053,6 @@
1536
1053
  }
1537
1054
  return result;
1538
1055
  };
1539
- /// <summary> remove spaces from the left side of string</summary>
1540
- /// <param name="str">the string to trim
1541
- /// </param>
1542
1056
  StrUtil.ltrim = function (str) {
1543
1057
  var length = str.length;
1544
1058
  var i = 0;
@@ -1547,7 +1061,7 @@
1547
1061
  result = str;
1548
1062
  }
1549
1063
  else {
1550
- while (i < length && str[i] === ' ' /*' '*/) {
1064
+ while (i < length && str[i] === ' ') {
1551
1065
  i = i + 1;
1552
1066
  }
1553
1067
  if (i > 0) {
@@ -1557,16 +1071,6 @@
1557
1071
  }
1558
1072
  return result;
1559
1073
  };
1560
- /// <summary>This function for Deleting String from end & start of input
1561
- /// String
1562
- /// </summary>
1563
- /// <param name="str">String , which can include strToDelete spaces on input
1564
- /// </param>
1565
- /// <param name="strToDelete">need delete this String from start/end of str.
1566
- /// </param>
1567
- /// <returns> String without strToDelete on end & start,
1568
- /// or 'null' if Sting hasn't not characters inside
1569
- /// </returns>
1570
1074
  StrUtil.DeleteStringsFromEnds = function (str, strToDelete) {
1571
1075
  if (str.startsWith(strToDelete)) {
1572
1076
  str = str.substr(strToDelete.length);
@@ -1583,11 +1087,6 @@
1583
1087
  }
1584
1088
  return result;
1585
1089
  };
1586
- /// <summary> pad a string with trailing spaces up to the given length</summary>
1587
- /// <param name="str">the string to pad
1588
- /// </param>
1589
- /// <param name="len">the expected length after padding
1590
- /// </param>
1591
1090
  StrUtil.padStr = function (str, len) {
1592
1091
  var padLen = len - str.length;
1593
1092
  if (padLen > 0) {
@@ -1601,67 +1100,9 @@
1601
1100
  }
1602
1101
  return str;
1603
1102
  };
1604
- /// <summary> this method will serve as a string tokenizer instead of using the c# split method
1605
- /// since there are diffrences btween java tokenizer and c# split
1606
- /// the implimentation given by the conversion tool is not Sufficient
1607
- /// </summary>
1608
- /// <param name="source">- the source string to be converted
1609
- /// </param>
1610
- /// <param name="delim">- the string of delimiters used to split the string (each character in the String is a delimiter
1611
- /// </param>
1612
- /// <returns> array of token according which is the same as string tokenizer in java
1613
- /// </returns>
1614
1103
  StrUtil.tokenize = function (source, delim) {
1615
- // It is mentioned in the comment that we should not use String.Split()
1616
- // because its behavior is different than Java's tokenizer.
1617
- // So, we were suppose to use our own implementation (the commented code below).
1618
- // But all these years, we were calling XmlParser.getToken() which was actually
1619
- // using String.Split(). And we didn't face any problem.
1620
- // So, it seems that we do not have problem in using String.Split().
1621
- // But now, we can improve the performance here...
1622
- // XmlParser.getTokens() was getting a String[] using String.Split().
1623
- // It was then creating a List<String> from this String[] and was returning it to
1624
- // tokenize().
1625
- // tokenize() was again converting this List<String> back to String[].
1626
- // So why not call String.Split() directly?
1627
1104
  return source.split(delim);
1628
- /*
1629
- String [] tokens = null;
1630
-
1631
- char [] delimArry = delim.toCharArray();
1632
-
1633
- //since java discards delimiters from the start and end of the string and c# does not
1634
- //we need to remove them manually
1635
- // source = source.TrimEnd(delimArry);
1636
- // source = source.TrimStart(delimArry);
1637
- source = source.trim();
1638
-
1639
- //now that we have remove starting and ending delimiters we can split
1640
- tokens = source.Split(delimArry);
1641
-
1642
- /*
1643
- * only one problem: if we have two Subsequent delimiters for example :
1644
- * the delimiter is ';' and the string is: "first;;second;third"
1645
- * then in java String tokenizer will give us only 3 tokens :first,second and third
1646
- * while is c# split wethod will return 4 tokens: first,empty string,second and third
1647
- * we need to deal with that
1648
- */
1649
- /*
1650
- List res = new List();
1651
- for (int i = 0 ; i < tokens.length; i++)
1652
- {
1653
- if (tokens[i] != "" )
1654
- res.addItem(tokens[i]);
1655
- }
1656
-
1657
- return (String [])(res.getAllItems (String.class));*/
1658
- };
1659
- /// <summary>
1660
- /// translate from string to hexa dump char by char
1661
- /// </summary>
1662
- /// <param name = "string">to translate it to the byte stream</param>
1663
- /// <param name = "minLength">the minimal length of hexa digits for each char</param>
1664
- /// <returns> the byte stream in form of string</returns>
1105
+ };
1665
1106
  StrUtil.stringToHexaDump = function (str, minLength) {
1666
1107
  var stringBuilder = new mscorelib.StringBuilder(str.length * minLength);
1667
1108
  for (var indx = 0; indx < str.length; indx = indx + 1) {
@@ -1680,11 +1121,6 @@
1680
1121
  }
1681
1122
  return StrUtil.searchAndReplace_1(str, from, to);
1682
1123
  };
1683
- /// <summary> replace every appearance of 'from' in 'str' with 'to'</summary>
1684
- /// <param name="str">the working base source string </param>
1685
- /// <param name="from">the string to replace </param>
1686
- /// <param name="to">the string use instead 'from' </param>
1687
- /// <returns> modified String </returns>
1688
1124
  StrUtil.searchAndReplace_0 = function (str, from, to) {
1689
1125
  var lastSubStr = 0;
1690
1126
  var startSubStr;
@@ -1705,11 +1141,6 @@
1705
1141
  }
1706
1142
  return result;
1707
1143
  };
1708
- /// <summary> replace every appearance of strings of 'from' in 'str' with the according string in 'to'</summary>
1709
- /// <param name="str">the working base source string </param>
1710
- /// <param name="from">the string to replace </param>
1711
- /// <param name="to">the string use instead 'from' </param>
1712
- /// <returns> modified String </returns>
1713
1144
  StrUtil.searchAndReplace_1 = function (str, from, to) {
1714
1145
  var lastSubStr = 0;
1715
1146
  var sarIndex = 0;
@@ -1734,14 +1165,6 @@
1734
1165
  result = tmpBuf.ToString();
1735
1166
  return result;
1736
1167
  };
1737
- /// <summary> this functions is for use by the searchAndReplace() function -
1738
- /// searches the offset of the strings from the array in the given string
1739
- /// and returns the minimum offset found and sets the index of the found string
1740
- /// to SARindex
1741
- /// </summary>
1742
- /// <param name="str">the string to search in </param>
1743
- /// <param name="strings">an array of strings to search for </param>
1744
- /// <param name="offset">where to start the search </param>
1745
1168
  StrUtil.indexOf = function (str, strings, offset, SARindex) {
1746
1169
  var minOffset = -1;
1747
1170
  for (var i = 0; i < strings.length; i = i + 1) {
@@ -1769,15 +1192,6 @@
1769
1192
  }
1770
1193
  return result;
1771
1194
  };
1772
- /// <summary> replace tokens in user string by vector values </summary>
1773
- /// <param name="userString">- user buffer like "User %d, %d string"
1774
- /// </param>
1775
- /// <param name="token">- token used in user string - i.e. "%d"
1776
- /// </param>
1777
- /// <param name="occurrence">- number of token where replace will take part (1 for first occurrence)
1778
- /// </param>
1779
- /// <param name="value">- value to be inserted insted of token
1780
- /// </param>
1781
1195
  StrUtil.replaceStringTokens = function (userString, token, occurrence, val) {
1782
1196
  var tokenLen = token.length;
1783
1197
  var currPosition = 0;
@@ -1800,12 +1214,6 @@
1800
1214
  }
1801
1215
  StrUtil.makePrintableTokens_1(source, type);
1802
1216
  };
1803
- /// <summary>
1804
- /// converts special characters in a token to a printable format
1805
- /// </summary>
1806
- /// <param name = "source">a token </param>
1807
- /// <param name = "type">type of conversion: STR_2_HTML, SEQ_2_HTML, HTML_2_SEQ, HTML_2_STR, SEQ_2_STR </param>
1808
- /// <returns> token with converted special characters </returns>
1809
1217
  StrUtil.makePrintableTokens_0 = function (source, type) {
1810
1218
  var escStr = [
1811
1219
  "\\", "-", ","
@@ -1839,11 +1247,6 @@
1839
1247
  }
1840
1248
  return result;
1841
1249
  };
1842
- /// <summary>
1843
- /// converts special characters in a tokens collection to a printable format
1844
- /// </summary>
1845
- /// <param name = "source">vector of strings before tokenaizer </param>
1846
- /// <param name = "type">type of conversion: STR_2_HTML, SEQ_2_HTML, HTML_2_SEQ, HTML_2_STR </param>
1847
1250
  StrUtil.makePrintableTokens_1 = function (source, type) {
1848
1251
  if (source !== null) {
1849
1252
  var length = source.length;
@@ -1853,12 +1256,6 @@
1853
1256
  }
1854
1257
  }
1855
1258
  };
1856
- /// <summary>
1857
- /// change non-printable characters like "new line" and "line feed" to their
1858
- /// printable representation
1859
- /// </summary>
1860
- /// <param name = "source">is the string with non-printable characters </param>
1861
- /// <returns> the new string where all the non-printable characters are converted </returns>
1862
1259
  StrUtil.makePrintable = function (source) {
1863
1260
  var from = [
1864
1261
  "\n", "\r", "'", "\\", "\"", "\0"
@@ -1868,12 +1265,6 @@
1868
1265
  ];
1869
1266
  return StrUtil.searchAndReplace(source, from, to);
1870
1267
  };
1871
- /// <summary>
1872
- /// change non-printable characters like "new line" and "line feed" to their
1873
- /// printable representation (simplified version for range error message)
1874
- /// </summary>
1875
- /// <param name = "source">is the string with non-printable characters </param>
1876
- /// <returns> the new string where all the non-printable characters are converted </returns>
1877
1268
  StrUtil.makePrintable2 = function (source) {
1878
1269
  var from = [
1879
1270
  "\n", "\r", "\0"
@@ -1883,21 +1274,10 @@
1883
1274
  ];
1884
1275
  return StrUtil.searchAndReplace(source, from, to);
1885
1276
  };
1886
- /// <summary>
1887
- ///
1888
- /// </summary>
1889
- /// <param name="s"></param>
1890
- /// <param name="len"></param>
1891
- /// <returns></returns>
1892
1277
  StrUtil.ZstringMake = function (s, len) {
1893
1278
  len = StrUtil.mem_trim(s, len);
1894
1279
  return s.substr(0, len);
1895
1280
  };
1896
- /// <summary>(public)
1897
- /// returns plain text from rtf text
1898
- /// </summary>
1899
- /// <param name="rtfText">refer to the summary</param>
1900
- /// <returns>refer to the summary</returns>
1901
1281
  StrUtil.GetPlainTextfromRtf = function (rtfText) {
1902
1282
  if (Rtf.isRtf(rtfText)) {
1903
1283
  var rtf = new Rtf();
@@ -1907,12 +1287,6 @@
1907
1287
  }
1908
1288
  return rtfText;
1909
1289
  };
1910
- /// <summary>
1911
- /// Returns true if the string arrays str1 & str2 are equal
1912
- /// </summary>
1913
- /// <param name="str1"></param>
1914
- /// <param name="str2"></param>
1915
- /// <returns></returns>
1916
1290
  StrUtil.StringsArraysEqual = function (str1, str2) {
1917
1291
  var result;
1918
1292
  if (str1 === null && str2 === null) {
@@ -1939,12 +1313,6 @@
1939
1313
  }
1940
1314
  return result;
1941
1315
  };
1942
- /// <summary>
1943
- /// The code is copied from tsk_open_bnd_wild and SearchAndReplaceWildChars
1944
- /// The refactoring is not performed for backwards compatibility
1945
- /// The code replaces special charachters :* ? with recieved filler
1946
- /// </summary>
1947
- /// <returns></returns>
1948
1316
  StrUtil.SearchAndReplaceWildChars = function (buf, len, filler) {
1949
1317
  buf = mscorelib.NString.PadRight(buf, len);
1950
1318
  var escChar = false;
@@ -1955,7 +1323,6 @@
1955
1323
  case ('\\'):
1956
1324
  {
1957
1325
  var isNextCharWild = true;
1958
- //If next char is not wild , then copy '\', if this is first char.
1959
1326
  if ((i + 1 < len) && (buf[i + 1] != '*' && buf[i + 1] != '\\'))
1960
1327
  isNextCharWild = false;
1961
1328
  if (escChar || !isNextCharWild)
@@ -1985,22 +1352,12 @@
1985
1352
  var text = tmpBuf.ToString();
1986
1353
  return mscorelib.NString.TrimEnd(mscorelib.NString.TrimEnd(text, ['\0']));
1987
1354
  };
1988
- /// <summary>
1989
- /// Remove the task path delimiter from the error string.
1990
- /// </summary>
1991
- /// <param name = "source">string with delimiter </param>
1992
- /// <returns> string for console error </returns>
1993
1355
  StrUtil.getConsoleErorString = function (source) {
1994
1356
  var consoleErorString = "";
1995
1357
  if (!util.isNullOrUndefined(source))
1996
1358
  consoleErorString = this.searchAndReplace(source, TASK_PATH_DELIMITER, "");
1997
1359
  return consoleErorString;
1998
1360
  };
1999
- /// <summary>
2000
- /// Remove the task path from the error string.
2001
- /// </summary>
2002
- /// <param name = "source">string with delimiter </param>
2003
- /// <returns> string for console error </returns>
2004
1361
  StrUtil.getMsgBoxErorString = function (source) {
2005
1362
  var tokens;
2006
1363
  var msgBoxErorString = new mscorelib.StringBuilder("");
@@ -2017,27 +1374,13 @@
2017
1374
  }());
2018
1375
  StrUtil._paddingSpaces = null;
2019
1376
 
2020
- // In order to convert some functionality to Visual C#, the Java Language Conversion Assistant
2021
- /// <summary>
2022
- /// Contains conversion support elements such as classes, interfaces and static methods.
2023
- /// </summary>
2024
1377
  var Misc = /** @class */ (function () {
2025
1378
  function Misc() {
2026
1379
  }
2027
- /// <summary>
2028
- /// Writes the exception stack trace to the received stream
2029
- /// </summary>
2030
- /// <param name="throwable">Exception to obtain information from</param>
2031
- /// <param name="stream">Output sream used to write to</param>
2032
1380
  Misc.WriteStackTrace = function (throwable) {
2033
1381
  console.log(throwable.Message);
2034
1382
  console.log(throwable.StackTrace);
2035
1383
  };
2036
- /// <summary>
2037
- /// Receives a byte array and returns it transformed in an byte array
2038
- /// </summary>
2039
- /// <param name="byteArray">Byte array to process</param>
2040
- /// <returns>The transformed array</returns>
2041
1384
  Misc.ToSByteArray = function (byteArray) {
2042
1385
  var sbyteArray = null;
2043
1386
  if (byteArray !== null) {
@@ -2048,11 +1391,6 @@
2048
1391
  }
2049
1392
  return sbyteArray;
2050
1393
  };
2051
- /// <summary>
2052
- /// Receives sbyte array and returns it transformed in a byte array
2053
- /// </summary>
2054
- /// <param name="sbyteArray">sbyte array to process</param>
2055
- /// <returns>The transformed array</returns>
2056
1394
  Misc.ToByteArray = function (sbyteArray) {
2057
1395
  var byteArray = null;
2058
1396
  if (sbyteArray !== null) {
@@ -2063,11 +1401,6 @@
2063
1401
  }
2064
1402
  return byteArray;
2065
1403
  };
2066
- /// <summary> Compares number of bytes in two byte arrays</summary>
2067
- /// <param name="source"></param>
2068
- /// <param name="destination"></param>
2069
- /// <param name="numberOfBytes"></param>
2070
- /// <returns> boolen true if equal</returns>
2071
1404
  Misc.CompareByteArray = function (source, destination, numberOfBytes) {
2072
1405
  if (source.length >= numberOfBytes && destination.length >= numberOfBytes) {
2073
1406
  for (var len = 0; len < numberOfBytes; len++) {
@@ -2079,13 +1412,6 @@
2079
1412
  return false;
2080
1413
  return true;
2081
1414
  };
2082
- /// <summary>
2083
- /// Performs an unsigned bitwise right shift with the specified number
2084
- /// </summary>
2085
- /// <param name="number">Number to operate on</param>
2086
- /// <param name="bits">Ammount of bits to shift</param>
2087
- /// <returns>The resulting number from the shift operation</returns>
2088
- // TODO: instead of calling URShift(number, bits), we can use((uint)number) >> bits.
2089
1415
  Misc.URShift = function (number, bits) {
2090
1416
  var result;
2091
1417
  if (number >= 0) {
@@ -2096,20 +1422,9 @@
2096
1422
  }
2097
1423
  return result;
2098
1424
  };
2099
- /// <summary>
2100
- /// get system's time in milliseconds
2101
- /// </summary>
2102
- /// <returns></returns>
2103
1425
  Misc.getSystemMilliseconds = function () {
2104
- // TODO - check if we need this adjustment
2105
1426
  return Math.floor((mscorelib.DateTime.Now.Ticks - 621355968000000000) / 10000);
2106
1427
  };
2107
- /// <summary>
2108
- /// Compares 2 int arrays
2109
- /// </summary>
2110
- /// <param name="arrayOne"></param>
2111
- /// <param name="arrayTwo"></param>
2112
- /// <returns>true if arrays are equal else false</returns>
2113
1428
  Misc.CompareIntArrays = function (arrayOne, arrayTwo) {
2114
1429
  var areEqual = false;
2115
1430
  if (arrayOne === arrayTwo) {
@@ -2129,11 +1444,6 @@
2129
1444
  }
2130
1445
  return areEqual;
2131
1446
  };
2132
- /// <summary>
2133
- /// Returns the comma separated string for the values passed in int array.
2134
- /// </summary>
2135
- /// <param name="values">Integer array</param>
2136
- /// <returns>comma separated string</returns>
2137
1447
  Misc.GetCommaSeperatedString = function (intArray) {
2138
1448
  var temp = new mscorelib.StringBuilder();
2139
1449
  for (var val = 0; val < intArray.length; val = val + 1) {
@@ -2145,11 +1455,6 @@
2145
1455
  }
2146
1456
  return temp.ToString();
2147
1457
  };
2148
- /// <summary>
2149
- /// Returns int array out of comma separated string
2150
- /// </summary>
2151
- /// <param name="value">comma separated string</param>
2152
- /// <returns>Integer array</returns>
2153
1458
  Misc.GetIntArray = function (commaSeparatedValue) {
2154
1459
  var intArray = new Array(0);
2155
1460
  if (!mscorelib.NString.IsNullOrEmpty(commaSeparatedValue)) {
@@ -2180,24 +1485,9 @@
2180
1485
  else
2181
1486
  return Base64.encode_2(strOrData);
2182
1487
  };
2183
- /// <summary> This method encodes the given string using the base64-encoding
2184
- /// specified in RFC-2045 (Section 6.8). It's used for example in the
2185
- /// "Basic" authorization scheme.
2186
- /// </summary>
2187
- /// <param name="str">the string </param>
2188
- /// <param name="encoding"> Environment.Encoding </param>
2189
- /// <returns> the base64-encoded str </returns>
2190
1488
  Base64.encode_0 = function (str, encoding) {
2191
1489
  return Base64.encode(str, false, encoding);
2192
1490
  };
2193
- /// <summary> Encodes string using the base64-encoding.
2194
- /// If isUseEnvCharset is true, use the specific charset when converting
2195
- /// string to byte array. (DBCS support)
2196
- /// </summary>
2197
- /// <param name="str">the string </param>
2198
- /// <param name="isUseEnvCharset"> </param>
2199
- /// <param name="encoding"> Environment.Encoding </param>
2200
- /// <returns> the base64-encoded str </returns>
2201
1491
  Base64.encode_1 = function (str, isUseEnvCharset, encoding) {
2202
1492
  var result;
2203
1493
  if (str === null) {
@@ -2221,18 +1511,12 @@
2221
1511
  }
2222
1512
  return result;
2223
1513
  };
2224
- /// <summary> This method encodes the given byte[] using the base64-encoding
2225
- /// specified in RFC-2045 (Section 6.8).
2226
- /// </summary>
2227
- /// <param name="data">the data </param>
2228
- /// <returns> the base64-encoded data </returns>
2229
1514
  Base64.encode_2 = function (data) {
2230
1515
  if (data === null)
2231
1516
  return null;
2232
1517
  var dest = new Uint8Array(Math.floor((data.length + 2) / 3) * 4);
2233
1518
  var sidx = 0;
2234
1519
  var didx = 0;
2235
- // 3-byte to 4-byte conversion + 0-63 to ASCII printable conversion
2236
1520
  while (sidx < data.length - 2) {
2237
1521
  dest[didx++] = Base64._base64EncMap[Misc.URShift(data[sidx], 2) & 63];
2238
1522
  dest[didx++] = Base64._base64EncMap[(Misc.URShift(data[sidx + 1], 4) & 15) | (data[sidx] << 4 & 63)];
@@ -2250,7 +1534,6 @@
2250
1534
  dest[didx++] = Base64._base64EncMap[data[sidx] << 4 & 63];
2251
1535
  }
2252
1536
  }
2253
- // add padding
2254
1537
  while (didx < dest.length) {
2255
1538
  dest[didx] = 61;
2256
1539
  didx = didx + 1;
@@ -2265,20 +1548,9 @@
2265
1548
  else
2266
1549
  return Base64.decode_2(strOrData);
2267
1550
  };
2268
- /// <summary> This method decodes the given string using the base64-encoding
2269
- /// specified in RFC-2045 (Section 6.8).
2270
- /// </summary>
2271
- /// <param name="str">the base64-encoded string. </param>
2272
- /// <returns> the decoded str.</returns>
2273
1551
  Base64.decode_0 = function (str) {
2274
1552
  return Base64.decode(str, null);
2275
1553
  };
2276
- /// <summary> This method decodes the given string using the base64-encoding
2277
- /// specified in RFC-2045 (Section 6.8).
2278
- /// </summary>
2279
- /// <param name="str">the base64-encoded string. </param>
2280
- /// <param name="encoding">Environment.Encoding or null.</param>
2281
- /// <returns> the decoded str.</returns>
2282
1554
  Base64.decode_1 = function (str, encoding) {
2283
1555
  var result;
2284
1556
  if (str === null) {
@@ -2302,11 +1574,6 @@
2302
1574
  }
2303
1575
  return result;
2304
1576
  };
2305
- /// <summary> This method decodes the given byte[] using the base64-encoding
2306
- /// specified in RFC-2045 (Section 6.8).
2307
- /// </summary>
2308
- /// <param name="data">the base64-encoded data.</param>
2309
- /// <returns> the decoded <var>data</va
2310
1577
  Base64.decode_2 = function (data) {
2311
1578
  if (data === null)
2312
1579
  return null;
@@ -2315,11 +1582,9 @@
2315
1582
  tail = tail - 1;
2316
1583
  }
2317
1584
  var dest = new Uint8Array(tail - Math.floor(data.length / 4));
2318
- // ASCII printable to 0-63 conversion
2319
1585
  for (var idx = 0; idx < data.length; idx = idx + 1) {
2320
1586
  data[idx] = Base64._base64DecMap[data[idx]];
2321
1587
  }
2322
- // 4-byte to 3-byte conversion
2323
1588
  var sidx = 0;
2324
1589
  var didx;
2325
1590
  for (didx = 0; didx < dest.length - 2; didx = didx + 3) {
@@ -2334,7 +1599,6 @@
2334
1599
  dest[didx] = (((data[sidx + 1] << 4) & 255) | (Misc.URShift(data[sidx + 2], 2) & 15));
2335
1600
  return dest;
2336
1601
  };
2337
- /// <summary> decoded and return an hex representation of the data</summary>
2338
1602
  Base64.decodeToHex = function (str) {
2339
1603
  if (str === null)
2340
1604
  return null;
@@ -2342,13 +1606,9 @@
2342
1606
  return str;
2343
1607
  return StrUtil.stringToHexaDump(Base64.decode(str), 2);
2344
1608
  };
2345
- /// <summary> decodes a string to byte array</summary>
2346
1609
  Base64.decodeToByte = function (str) {
2347
1610
  if (str === null)
2348
1611
  return null;
2349
- // QCR 740918 if we have and empty expression it is sent from the server as empty string
2350
- // and changed locally to a string with one blank either way they are not valid base64 encoded
2351
- // string and should not be decoded.
2352
1612
  if (str === "" || str === " ")
2353
1613
  return new Uint8Array(0);
2354
1614
  try {
@@ -2382,18 +1642,6 @@
2382
1642
  var ChoiceUtils = /** @class */ (function () {
2383
1643
  function ChoiceUtils() {
2384
1644
  }
2385
- /// <summary>
2386
- /// init the display Value from string
2387
- /// </summary>
2388
- /// <param name = "choiceDispStr">the all substring separated with comma.
2389
- /// The behavior:
2390
- /// a. when have "\" before char a-z need to ignore the \ put the a-z char
2391
- /// b. when "\," -> ","
2392
- /// c. when "\-" -> "-"
2393
- /// d. when "\\" -> "\"
2394
- /// e. when "\\\\" -> "\\"
2395
- /// the display can be all string. and we don't need to check validation according to the dataType(as we do in Link
2396
- /// </param>
2397
1645
  ChoiceUtils.GetDisplayListFromString = function (choiceDispStr, removeAccelerators, shouldMakePrintable, shouldTrimOptions) {
2398
1646
  var fromHelp = new Array("\\\\", "\\-", "\\,");
2399
1647
  var toHelp = new Array("XX", "XX", "XX");
@@ -2471,20 +1719,16 @@
2471
1719
  return ChoiceUtils;
2472
1720
  }());
2473
1721
 
2474
- //This class contains all the constants which are used in MgxpaRIA.exe as well as in MgGui.dll.
2475
1722
  var Constants = /** @class */ (function () {
2476
1723
  function Constants() {
2477
1724
  }
2478
1725
  return Constants;
2479
1726
  }());
2480
- /// <summary> Null Arithmetic values</summary>
2481
1727
  Constants.NULL_ARITH_NULLIFY = 'N';
2482
1728
  Constants.NULL_ARITH_USE_DEF = 'U';
2483
- /// <summary> select program : select mode property</summary>
2484
1729
  Constants.SELPRG_MODE_BEFORE = 'B';
2485
1730
  Constants.SELPRG_MODE_AFTER = 'A';
2486
1731
  Constants.SELPRG_MODE_PROMPT = 'P';
2487
- /// <summary> move in View</summary>
2488
1732
  Constants.MOVE_UNIT_TABLE = 'T';
2489
1733
  Constants.MOVE_UNIT_PAGE = 'P';
2490
1734
  Constants.MOVE_UNIT_ROW = 'R';
@@ -2498,7 +1742,6 @@
2498
1742
  Constants.MOVE_DIRECTION_FIRST_SON = 'F';
2499
1743
  Constants.MOVE_DIRECTION_NEXT_SIBLING = 'X';
2500
1744
  Constants.MOVE_DIRECTION_PREV_SIBLING = 'V';
2501
- /// <summary> refresh types for a task form</summary>
2502
1745
  Constants.TASK_REFRESH_FORM = 'F';
2503
1746
  Constants.TASK_REFRESH_TABLE = 'T';
2504
1747
  Constants.TASK_REFRESH_TREE_AND_FORM = 'R';
@@ -2509,15 +1752,12 @@
2509
1752
  Constants.TASK_MODE_CREATE = 'C';
2510
1753
  Constants.TASK_MODE_DELETE = 'D';
2511
1754
  Constants.TASK_MODE_NONE = ' ';
2512
- /// <summary> task level</summary>
2513
1755
  Constants.TASK_LEVEL_NONE = ' ';
2514
1756
  Constants.TASK_LEVEL_TASK = 'T';
2515
1757
  Constants.TASK_LEVEL_RECORD = 'R';
2516
1758
  Constants.TASK_LEVEL_CONTROL = 'C';
2517
- /// <summary> special records constants</summary>
2518
1759
  Constants.MG_DATAVIEW_FIRST_RECORD = mscorelib.Int32.MinValue;
2519
1760
  Constants.MG_DATAVIEW_LAST_RECORD = mscorelib.Int32.MaxValue;
2520
- /// <summary> action states for keyboard mapping</summary>
2521
1761
  Constants.ACT_STT_TBL_SCREEN_MODE = 0x0001;
2522
1762
  Constants.ACT_STT_TBL_LEFT_TO_RIGHT = 0x0002;
2523
1763
  Constants.ACT_STT_TBL_SCREEN_TOP = 0x0004;
@@ -2532,17 +1772,13 @@
2532
1772
  Constants.ACT_STT_EDT_EDITING = 0x0800;
2533
1773
  Constants.ACT_STT_TREE_PARK = 0x1000;
2534
1774
  Constants.ACT_STT_TREE_EDITING = 0x2000;
2535
- Constants.ForwardSlashWebUsage = "web"; // refer to a forward slash as a relative web url.
1775
+ Constants.ForwardSlashWebUsage = "web";
2536
1776
  Constants.HTTP_PROTOCOL = "http://";
2537
1777
  Constants.HTTPS_PROTOCOL = "https://";
2538
1778
  Constants.FILE_PROTOCOL = "file://";
2539
- /// <summary>threads constants</summary>
2540
1779
  Constants.MG_GUI_THREAD = "MG_GUI_THREAD";
2541
1780
  Constants.MG_WORK_THREAD = "MG_WORK_THREAD";
2542
1781
  Constants.MG_TIMER_THREAD = "MG_TIMER_THREAD";
2543
- /// <summary>
2544
- /// property name for the runtime designer
2545
- /// </summary>
2546
1782
  Constants.ConfigurationFilePropertyName = "Configuration file";
2547
1783
  Constants.WinPropText = "Text";
2548
1784
  Constants.WinPropLayer = "Layer";
@@ -2577,12 +1813,9 @@
2577
1813
  XMLConstants.MG_TAG_TASK = "task";
2578
1814
  XMLConstants.MG_TAG_TASK_END = "/task";
2579
1815
  XMLConstants.MG_TAG_RECOMPUTE = "recompute";
2580
- //TODO: this class contains the constants which are used for XML parsing.
2581
- //Check if we can move it to Util.dll
2582
1816
  XMLConstants.MG_ATTR_VB_VIEW_ROWIDX = "db_view_rowidx";
2583
1817
  XMLConstants.MG_ATTR_CONTROL_ISN = "controlIsn";
2584
1818
  XMLConstants.MG_HOR_ALIGMENT_IS_INHERITED = "horizontalAlignmentIsFromSystemDefault";
2585
- // MainHeaders
2586
1819
  XMLConstants.MAX_PATH = 260;
2587
1820
  XMLConstants.FILE_NAME_SIZE = XMLConstants.MAX_PATH + 1;
2588
1821
  XMLConstants.CDATA_START = "<![CDATA[";
@@ -2668,13 +1901,11 @@
2668
1901
  XMLConstants.MG_ATTR_IS_GUI_THREAD_EXECUTION = "isGuiThreadExecution";
2669
1902
  XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY = "taskDefinitionId";
2670
1903
  XMLConstants.MG_TAG_OBJECT_REFERENCE = "objectRef";
2671
- //Help types
2672
1904
  XMLConstants.MG_ATTR_HLP_TYP_TOOLTIP = "T";
2673
1905
  XMLConstants.MG_ATTR_HLP_TYP_PROMPT = "P";
2674
1906
  XMLConstants.MG_ATTR_HLP_TYP_URL = "U";
2675
1907
  XMLConstants.MG_ATTR_HLP_TYP_INTERNAL = "I";
2676
1908
  XMLConstants.MG_ATTR_HLP_TYP_WINDOWS = "W";
2677
- //Internal help attributes.
2678
1909
  XMLConstants.MG_ATTR_INTERNAL_HELP_TYPE = "type";
2679
1910
  XMLConstants.MG_ATTR_INTERNAL_HELP_NAME = "name";
2680
1911
  XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEX = "framex";
@@ -2689,26 +1920,20 @@
2689
1920
  XMLConstants.MG_ATTR_INTERNAL_TITLE_BAR = "titlebar";
2690
1921
  XMLConstants.MG_ATTR_INTERNAL_HELP_SYSTEM_MENU = "sysmenu";
2691
1922
  XMLConstants.MG_ATTR_INTERNAL_HELP_FONT_TABLE_INDEX = "fonttableindex";
2692
- //Windows help attributes.
2693
1923
  XMLConstants.MG_ATTR_WINDOWS_HELP_FILE = "file";
2694
1924
  XMLConstants.MG_ATTR_WINDOWS_HELP_COMMAND = "command";
2695
1925
  XMLConstants.MG_ATTR_WINDOWS_HELP_KEY = "key";
2696
- //Print data attributes.
2697
1926
  XMLConstants.MG_TAG_PRINT_DATA = "Print_data";
2698
1927
  XMLConstants.MG_TAG_PRINT_DATA_END = "/Print_data";
2699
1928
  XMLConstants.MG_TAG_RECORD = "Record";
2700
1929
  XMLConstants.MG_TAG_RECORD_END = "/Record";
2701
- //Custom Validators attributes.
2702
1930
  XMLConstants.MG_TAG_CUSTOM_VALIDATORS = "CustomValidators";
2703
1931
  XMLConstants.MG_TAG_CUSTOM_VALIDATORS_END = "/CustomValidators";
2704
1932
  XMLConstants.MG_TAG_CUSTOM_VALIDATOR = "CustomValidator";
2705
- // date/time formats for DateTimeUtils
2706
- //TODO: isolate to a different file?
2707
1933
  XMLConstants.ERROR_LOG_TIME_FORMAT = "HH:mm:ss.S";
2708
1934
  XMLConstants.ERROR_LOG_DATE_FORMAT = "DD/MM/YYYY";
2709
1935
  XMLConstants.HTTP_ERROR_TIME_FORMAT = "HH:mm:ss";
2710
1936
  XMLConstants.CACHED_DATE_TIME_FORMAT = "DD/MM/YYYY HH:mm:ss";
2711
- //webs constants
2712
1937
  XMLConstants.MG_TAG_WS_READ_REQUEST = "Read";
2713
1938
  XMLConstants.MG_TAG_WS_CREATE_REQUEST = "Create";
2714
1939
  XMLConstants.MG_TAG_WS_CREATE_REQUEST_END = "/Create";
@@ -2741,7 +1966,6 @@
2741
1966
  var DateTimeUtils = /** @class */ (function () {
2742
1967
  function DateTimeUtils() {
2743
1968
  }
2744
- /// <summary> returns the number in a 2 digit string
2745
1969
  DateTimeUtils.int2str = function (n) {
2746
1970
  return (n > 9) ? n.toString() : ("0" + n);
2747
1971
  };
@@ -2794,17 +2018,11 @@
2794
2018
  return DateTimeUtils;
2795
2019
  }());
2796
2020
 
2797
- /// <summary>
2798
- /// An interface to define the constantes used by the Picture mechanism.
2799
- /// </summary>
2800
2021
  var PICInterface = /** @class */ (function () {
2801
2022
  function PICInterface() {
2802
2023
  }
2803
2024
  return PICInterface;
2804
2025
  }());
2805
- //--------------------------------------------------------------------------
2806
- // TEMP!
2807
- //--------------------------------------------------------------------------
2808
2026
  PICInterface.PIC_X = 1;
2809
2027
  PICInterface.PIC_U = 2;
2810
2028
  PICInterface.PIC_L = 3;
@@ -2822,32 +2040,30 @@
2822
2040
  PICInterface.PIC_MMT = 15;
2823
2041
  PICInterface.PIC_SS = 16;
2824
2042
  PICInterface.PIC_PM = 17;
2825
- PICInterface.PIC_HYYYYY = 18; // Hebrew year
2826
- PICInterface.PIC_HL = 19; // Hebrew thousand year
2827
- PICInterface.PIC_HDD = 20; // Hebrew day of month
2828
- PICInterface.PIC_MS = 21; // Milliseconds
2829
- PICInterface.PIC_LOCAL = 23; // the space between PIC_LOCAL and PIC_MAX_OP
2043
+ PICInterface.PIC_HYYYYY = 18;
2044
+ PICInterface.PIC_HL = 19;
2045
+ PICInterface.PIC_HDD = 20;
2046
+ PICInterface.PIC_MS = 21;
2047
+ PICInterface.PIC_LOCAL = 23;
2830
2048
  PICInterface.PIC_MAX_MSK_LEN = 100;
2831
- // JPN: Japanese date picture support
2832
- PICInterface.PIC_JY1 = PICInterface.PIC_LOCAL + 0; // the name of an era (1 byte)
2833
- PICInterface.PIC_JY2 = PICInterface.PIC_LOCAL + 1; // the name of an era (2 bytes)
2834
- PICInterface.PIC_JY4 = PICInterface.PIC_LOCAL + 2; // the name of an era (4 bytes)
2835
- PICInterface.PIC_YJ = PICInterface.PIC_LOCAL + 3; // a year of an era
2836
- PICInterface.PIC_BB = PICInterface.PIC_LOCAL + 4; // a day of the week (2, 4 or 6 bytes)
2837
- // DBCS pictures for iSeries
2838
- PICInterface.PIC_J = PICInterface.PIC_LOCAL + 5; // DBCS only (with SO/SI)
2839
- PICInterface.PIC_T = PICInterface.PIC_LOCAL + 6; // All SBCS or All DBCS (with SO/SI)
2840
- PICInterface.PIC_G = PICInterface.PIC_LOCAL + 7; // DBCS only (without SO/SI)
2841
- PICInterface.PIC_S = PICInterface.PIC_LOCAL + 8; // SBCS only
2842
- PICInterface.PIC_MAX_OP = 31; // is reserved for DLL"s picture
2049
+ PICInterface.PIC_JY1 = PICInterface.PIC_LOCAL + 0;
2050
+ PICInterface.PIC_JY2 = PICInterface.PIC_LOCAL + 1;
2051
+ PICInterface.PIC_JY4 = PICInterface.PIC_LOCAL + 2;
2052
+ PICInterface.PIC_YJ = PICInterface.PIC_LOCAL + 3;
2053
+ PICInterface.PIC_BB = PICInterface.PIC_LOCAL + 4;
2054
+ PICInterface.PIC_J = PICInterface.PIC_LOCAL + 5;
2055
+ PICInterface.PIC_T = PICInterface.PIC_LOCAL + 6;
2056
+ PICInterface.PIC_G = PICInterface.PIC_LOCAL + 7;
2057
+ PICInterface.PIC_S = PICInterface.PIC_LOCAL + 8;
2058
+ PICInterface.PIC_MAX_OP = 31;
2843
2059
  PICInterface.NULL_CHAR = -1;
2844
2060
  PICInterface.DB_STR_MAX = 255;
2845
- PICInterface.DAYSINFOURCENT = 146097; // ((365*4+1)*25-1)*4+1 */
2846
- PICInterface.DAYSINCENTURY = 36524; // (365*4+1)*25-1 */
2847
- PICInterface.DAYSINFOURYEAR = 1461; // 365*4+1 */
2061
+ PICInterface.DAYSINFOURCENT = 146097;
2062
+ PICInterface.DAYSINCENTURY = 36524;
2063
+ PICInterface.DAYSINFOURYEAR = 1461;
2848
2064
  PICInterface.DAYSINYEAR = 365;
2849
2065
  PICInterface.DAYSINMONTH = 31;
2850
- PICInterface.DATE_BUDDHIST_GAP = 543; // years above the gregorian date
2066
+ PICInterface.DATE_BUDDHIST_GAP = 543;
2851
2067
  PICInterface.DEFAULT_DATE = "693961";
2852
2068
  PICInterface.DEFAULT_TIME = "0";
2853
2069
  PICInterface.date_day_tab = [
@@ -2859,9 +2075,6 @@
2859
2075
  PICInterface.date_dow_str = [
2860
2076
  " ", "Sunday ", "Monday ", "Tuesday ", "Wednesday ", "Thursday ", "Friday ", "Saturday "
2861
2077
  ];
2862
- //public final static readonly int DEF_century = 1920;
2863
- //public final static readonly Nchar DEF_date_mode = 'E';
2864
- // vec of pictures that can be given a numeric char only
2865
2078
  PICInterface.NumDirective = [
2866
2079
  4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 16
2867
2080
  ];
@@ -2871,15 +2084,9 @@
2871
2084
  var DateUtil = /** @class */ (function () {
2872
2085
  function DateUtil() {
2873
2086
  }
2874
- /// <summary>
2875
- /// extract the vector which contains the names of the months, as specified by the
2876
- /// language CAB
2877
- /// </summary>
2878
2087
  DateUtil.getLocalMonths = function (names) {
2879
2088
  var monthLen = DATE_MONTH_LEN;
2880
- // if it's the first time then access the language CAB and take the values
2881
2089
  if (typeof DateUtil._localMonths[0] === "undefined") {
2882
- //cut the string into separate values
2883
2090
  if (names !== null) {
2884
2091
  DateUtil._localMonths[0] = PICInterface.date_month_str[0];
2885
2092
  for (var i = 1; i < DateUtil._localMonths.length; i = i + 1) {
@@ -2902,15 +2109,9 @@
2902
2109
  }
2903
2110
  return DateUtil._localMonths;
2904
2111
  };
2905
- /// <summary>
2906
- /// extract the vector which contains the names of the days, as specified by the
2907
- /// language CAB
2908
- /// </summary>
2909
2112
  DateUtil.getLocalDays = function (names) {
2910
2113
  var dowLen = DATE_DOW_LEN;
2911
- // if it's the first time then access the language CAB and take the values
2912
2114
  if (typeof DateUtil._localDays[0] === "undefined") {
2913
- //cut the string into separate values
2914
2115
  if (names !== null) {
2915
2116
  DateUtil._localDays[0] = PICInterface.date_dow_str[0];
2916
2117
  for (var i = 1; i < DateUtil._localDays.length; i = i + 1) {
@@ -4503,7 +3704,6 @@
4503
3704
  NotifyCollectionChangedAction[NotifyCollectionChangedAction["Reset"] = 4] = "Reset";
4504
3705
  })(exports.NotifyCollectionChangedAction || (exports.NotifyCollectionChangedAction = {}));
4505
3706
 
4506
- /// <summary> this interface defines the internal events codes</summary>
4507
3707
  var InternalInterface = /** @class */ (function () {
4508
3708
  function InternalInterface() {
4509
3709
  }
@@ -4778,7 +3978,6 @@
4778
3978
  InternalInterface.MG_ACT_SERVER_TERMINATION = 420;
4779
3979
  InternalInterface.MG_ACT_SUBFORM_REFRESH = 432;
4780
3980
  InternalInterface.MG_ACT_CONTEXT_MENU = 439;
4781
- InternalInterface.MG_ACT_DEFAULT_BUTTON = 459;
4782
3981
  InternalInterface.MG_ACT_NEXT_RT_WINDOW = 462;
4783
3982
  InternalInterface.MG_ACT_PREV_RT_WINDOW = 463;
4784
3983
  InternalInterface.MG_ACT_EMPTY_DATAVIEW = 521;
@@ -4812,8 +4011,8 @@
4812
4011
  InternalInterface.MG_ACT_CRELINE_ABOVE = 634;
4813
4012
  InternalInterface.MG_ACT_CONTEXT_TERMINATION = 635;
4814
4013
  InternalInterface.MG_ACT_CONTEXT_TIMEOUT_RESET = 636;
4815
- InternalInterface.MG_ACT_TOT_CNT = 637;
4816
- // NEW INTERNAL EVENTS
4014
+ InternalInterface.MG_ACT_CONTEXT_REMOVE = 647;
4015
+ InternalInterface.MG_ACT_TOT_CNT = 648;
4817
4016
  InternalInterface.MG_ACT_TASK_PREFIX = 1001;
4818
4017
  InternalInterface.MG_ACT_TASK_SUFFIX = 1002;
4819
4018
  InternalInterface.MG_ACT_REC_PREFIX = 1003;
@@ -4830,7 +4029,6 @@
4830
4029
  InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC = 1018;
4831
4030
  InternalInterface.MG_ACT_COMPUTE = 1020;
4832
4031
  InternalInterface.MG_ACT_DUMMY = 1111;
4833
- // INTERNAL EVENTS for WebClient
4834
4032
  InternalInterface.MG_ACT_CTRL_FOCUS = 2001;
4835
4033
  InternalInterface.MG_ACT_CTRL_MOUSEUP = 2002;
4836
4034
  InternalInterface.MG_ACT_CTRL_KEYDOWN = 2003;
@@ -4840,13 +4038,12 @@
4840
4038
  InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE = 2007;
4841
4039
  InternalInterface.MG_ACT_DV_TO_GUI = 2008;
4842
4040
  InternalInterface.MG_ACT_DISABLE_EVENTS = 2010;
4843
- // toggle insert is temp 539 , it should match the code in online once it will be created.
4844
4041
  InternalInterface.MG_ACT_TOGGLE_INSERT = 2011;
4845
4042
  InternalInterface.MG_ACT_INCREMENTAL_LOCATE = 2017;
4846
4043
  InternalInterface.MG_ACT_MOVE_TO_FIRST_CTRL = 2018;
4847
4044
  InternalInterface.MG_ACT_SET_EXTERNAL_VALUE = 2019;
4848
4045
  InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL = 2020;
4849
- InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER = 2021; // for paginated table, fetch records in background depending on PROP_TYPE_SERVER_READ_AHEAD
4046
+ InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER = 2021;
4850
4047
 
4851
4048
  var JSON_Utils = /** @class */ (function () {
4852
4049
  function JSON_Utils() {
@@ -4862,7 +4059,7 @@
4862
4059
  }
4863
4060
  OSEnvironment.getStackTrace = function () {
4864
4061
  var ex = new mscorelib.Exception();
4865
- ex.errorLevel++; // we need to remove the line which contains call to this method
4062
+ ex.errorLevel++;
4866
4063
  return ex.StackTrace;
4867
4064
  };
4868
4065
  return OSEnvironment;
@@ -4870,9 +4067,6 @@
4870
4067
  OSEnvironment.EolSeq = "\n";
4871
4068
  OSEnvironment.TabSeq = "\t";
4872
4069
 
4873
- /// <summary>
4874
- /// The class is responsible to maintain the Request information while sending a request to server
4875
- /// </summary>
4876
4070
  var RequestInfo = /** @class */ (function () {
4877
4071
  function RequestInfo() {
4878
4072
  this.runtimeTaskTree = new mscorelib.List();
@@ -4904,16 +4098,9 @@
4904
4098
  LogType[LogType["warning"] = 2] = "warning";
4905
4099
  LogType[LogType["error"] = 3] = "error";
4906
4100
  })(exports.LogType || (exports.LogType = {}));
4907
- /// <summary>
4908
- /// Logger class will take care of client side logging . It will check for various log levels and accordingly will write messages in log file.
4909
- /// </summary>
4910
- //@dynamic
4911
4101
  var Logger = /** @class */ (function () {
4912
4102
  function Logger() {
4913
- this.LogLevel = 0; // InternalLogLevel
4914
- /// <summary>
4915
- /// While writing the error messages in the file play the beep.
4916
- /// </summary>
4103
+ this.LogLevel = 0;
4917
4104
  this.ShouldBeep = false;
4918
4105
  }
4919
4106
  Object.defineProperty(Logger, "Instance", {
@@ -4929,26 +4116,10 @@
4929
4116
  enumerable: false,
4930
4117
  configurable: true
4931
4118
  });
4932
- /// <summary>
4933
- /// Initialize logger
4934
- /// </summary>
4935
- /// <param name="logLevel"></param>
4936
- /// <param name="internalLogSync"></param>
4937
4119
  Logger.prototype.Initialize = function (logLevel, internalLogSync, shouldBeep) {
4938
4120
  try {
4939
- // let logSync: LogSyncMode = LogSyncMode.Session;
4940
4121
  this.LogLevel = logLevel;
4941
4122
  this.ShouldBeep = shouldBeep;
4942
- // TODO: implement
4943
- // String strLogSync = internalLogSync;
4944
- // if (!string.IsNullOrEmpty(strLogSync))
4945
- // {
4946
- // if (strLogSync.StartsWith("M", StringComparison.CurrentCultureIgnoreCase))
4947
- // logSync = LogSyncMode.Message;
4948
- // else if (strLogSync.StartsWith("F", StringComparison.CurrentCultureIgnoreCase))
4949
- // logSync = LogSyncMode.Flush;
4950
- // }
4951
- //
4952
4123
  }
4953
4124
  catch (e) {
4954
4125
  this.WriteDevToLog("ClientManager.init(): " + e.Message);
@@ -4972,9 +4143,6 @@
4972
4143
  Logger.prototype.ShouldLogExtendedServerRelatedMessages = function () {
4973
4144
  return (Logger.Instance.ShouldLog(exports.Logger_LogLevels.ServerMessages) || Logger.Instance.ShouldLog(exports.Logger_LogLevels.Support) || Logger.Instance.ShouldLog(exports.Logger_LogLevels.Development)) && this.LogLevel !== exports.Logger_LogLevels.Basic;
4974
4145
  };
4975
- /// <summary></summary>
4976
- /// <param name="msg"></param>
4977
- /// <param name="openIfNecessary">open the log file if not opened yet</param>
4978
4146
  Logger.prototype.WriteToLog = function (msg, openIfNecessary, logType) {
4979
4147
  if (logType === void 0) { logType = exports.LogType.info; }
4980
4148
  if (this.LogLevel > exports.Logger_LogLevels.None || openIfNecessary) {
@@ -4991,26 +4159,16 @@
4991
4159
  }
4992
4160
  }
4993
4161
  };
4994
- /// <summary>
4995
- /// write a server access to the log
4996
- /// </summary>
4997
- /// <param name="msg">the message to write to the log</param>
4998
4162
  Logger.prototype.WriteServerToLog = function (msg) {
4999
4163
  if (this.ShouldLogServerRelatedMessages()) {
5000
4164
  this.WriteToLog(mscorelib.NString.Format("Server, Thread={0}: ", mscorelib.Thread.CurrentThread.ManagedThreadId) + msg, false, exports.LogType.info);
5001
4165
  }
5002
4166
  };
5003
- /// <summary>
5004
- /// write a server access to the log, including the content
5005
- /// </summary>
5006
- /// <param name="msg">the message to write to the log</param>
5007
4167
  Logger.prototype.WriteServerMessagesToLog = function (msg) {
5008
4168
  if (this.ShouldLogExtendedServerRelatedMessages()) {
5009
4169
  this.WriteToLog("Server#: " + msg, false, exports.LogType.info);
5010
4170
  }
5011
4171
  };
5012
- /// <summary>Write a QC message to the log</summary>
5013
- /// <param name="msg">the message to write to the log</param>
5014
4172
  Logger.prototype.WriteSupportToLog = function (msg, skipLine) {
5015
4173
  if (this.LogLevel >= exports.Logger_LogLevels.Support && this.LogLevel !== exports.Logger_LogLevels.Basic) {
5016
4174
  if (skipLine) {
@@ -5021,31 +4179,16 @@
5021
4179
  }
5022
4180
  }
5023
4181
  };
5024
- /// <summary>
5025
- /// write a performance message to the log
5026
- /// </summary>
5027
- /// <param name="msg">the message to write to the log</param>
5028
4182
  Logger.prototype.WriteGuiToLog = function (msg) {
5029
4183
  if (this.LogLevel >= exports.Logger_LogLevels.Gui && this.LogLevel !== exports.Logger_LogLevels.Basic) {
5030
4184
  this.WriteToLog(msg, false, exports.LogType.info);
5031
4185
  }
5032
4186
  };
5033
- /// <summary>
5034
- /// write a developer message to the log
5035
- /// </summary>
5036
- /// <param name="msg">the message to write to the log</param>
5037
4187
  Logger.prototype.WriteDevToLog = function (msg) {
5038
4188
  if (this.LogLevel >= exports.Logger_LogLevels.Development && this.LogLevel !== exports.Logger_LogLevels.Basic) {
5039
4189
  this.WriteToLog("DEV: " + msg, false, exports.LogType.info);
5040
4190
  }
5041
4191
  };
5042
- /// <summary>
5043
- /// Writes a basic level entry to log
5044
- /// </summary>
5045
- /// <param name="messageDirection">message direction relative to the current module (RIA client). Can be either MessageEntering or MessageLeaving</param>
5046
- /// <param name="statusCode">HTTP status code</param>
5047
- /// <param name="contentLength">length of the http message</param>
5048
- /// <param name="httpHeaders">HTTP headers</param>
5049
4192
  Logger.prototype.WriteBasicToLog = function (messageDirection, contextID, sessionCounter, clientID, serverID, responseTime, statusCode, httpHeaders, contentLength) {
5050
4193
  if (this.LogLevel === exports.Logger_LogLevels.Basic) {
5051
4194
  var text = httpHeaders;
@@ -5053,8 +4196,6 @@
5053
4196
  text = mscorelib.NString.Replace(text, "\r\n", "|");
5054
4197
  var arg_E4_0 = "RIA,{0}_{1},{2},{3},{4},{5},-,{6},{7},{8},{9},{10},{11}";
5055
4198
  var expr_3E = new Array(12);
5056
- // TODO : need to check How to handle Process class.
5057
- // expr_3E[0] = Process.GetCurrentProcess().Id;
5058
4199
  expr_3E[1] = mscorelib.Thread.CurrentThread.ManagedThreadId;
5059
4200
  expr_3E[2] = new Date().toISOString();
5060
4201
  expr_3E[3] = ((messageDirection === exports.Logger_MessageDirection.MessageLeaving) ? "MSGL" : "MSGE");
@@ -5073,37 +4214,14 @@
5073
4214
  console.log(value);
5074
4215
  }
5075
4216
  };
5076
- /// <summary>
5077
- /// Writes request information to log
5078
- /// </summary>
5079
- /// <param name="clientSession">The clientSession object to be logged</param>
5080
4217
  Logger.prototype.WriteRequestInfoToLog = function (requestInfo, extraMessageStr) {
5081
4218
  if (this.LogLevel === exports.Logger_LogLevels.RequestInfo) {
5082
- // Chrome debugger automatically recomputes logged objects.
5083
- // Hence, clone the requestInfo object to print the details at the time of logging
5084
4219
  console.log(extraMessageStr, RequestInfo.clone(requestInfo));
5085
4220
  }
5086
4221
  };
5087
- /// <summary>
5088
- /// Writes a request exception basic level entry to log
5089
- /// </summary>
5090
- /// <param name="contextID"></param>
5091
- /// <param name="sessionCounter"></param>
5092
- /// <param name="clientID"></param>
5093
- /// <param name="serverID"></param>
5094
- /// <param name="ex">the logged exception</param>
5095
4222
  Logger.prototype.WriteBasicErrorToLog = function (contextID, sessionCounter, clientID, serverID, ex) {
5096
4223
  mscorelib.Debug.Assert(this.LogLevel === exports.Logger_LogLevels.Basic);
5097
- // TODO : Need to check how to handle Process
5098
- // let value: string = NString.Format("RIA,{0}_{1},{2},{3},{4},{5},-,{6},{7},-,-,-,{8} {9}", [
5099
- // Process.GetCurrentProcess().Id, Thread.CurrentThread.ManagedThreadId, DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"), "RES", contextID, sessionCounter, clientID, serverID, ex.GetType(), ex.Message
5100
- // ]);
5101
- // NConsole.WriteLine(value);
5102
- };
5103
- /// <summary>
5104
- /// Write an error to the log
5105
- /// </summary>
5106
- /// <param name="msg">the message to write to the log</param>
4224
+ };
5107
4225
  Logger.prototype.WriteErrorToLog = function (msg) {
5108
4226
  this.WriteToLog("MagicWeb [ERROR]: " + StrUtil.getConsoleErorString(msg), true, exports.LogType.error);
5109
4227
  };
@@ -5183,9 +4301,6 @@
5183
4301
  }
5184
4302
  this.WriteToLog(stringBuilder.ToString(), true);
5185
4303
  };
5186
- /// <summary>
5187
- /// Flush the log writer.
5188
- /// </summary>
5189
4304
  Logger.prototype.Flush = function () {
5190
4305
  };
5191
4306
  return Logger;
@@ -5396,14 +4511,11 @@
5396
4511
  new DefaultMsgDetails("STR_MOBILE_TAB_CONTROL_LAYER_0", "Controls cannot be linked to layer 0 of the tab control."), new DefaultMsgDetails("STR_MOBILE_TAB_DISPLAY_LIST_ERROR", "The number of entries in the Display List property must be zero or match the number of entries in the Items List property."), new DefaultMsgDetails("RC_ERROR_ARG_TYPE_STRING_NUMBER_MISMATCH", "The number of characters in the argument type string does not match the number of total arguments"), new DefaultMsgDetails("RC_ERROR_ILLEGAL_ARG_ATTR_TYPE", "Illegal argument attribute type"), new DefaultMsgDetails("RC_ERROR_ILLEGAL_RETURN_VAL_ATTR_TYPE", "Illegal return value attribute type"), new DefaultMsgDetails("STR_ERR_WEBCLIENT_PROGRAM_RELOADED", "Changes were done at the server side. Browser will be refreshed in order to get the latest changes."), new DefaultMsgDetails("STR_ERR_EXECUTED_PROGRAM_CHANGED", "Executed program changed at the server side. Browser will be refreshed in order to get the latest changes.")
5397
4512
  ];
5398
4513
 
5399
- /// <summary> implementation of a general queue</summary>
5400
4514
  var Queue = /** @class */ (function () {
5401
- /// <summary> </summary>
5402
4515
  function Queue() {
5403
4516
  this._queueVec = null;
5404
4517
  this._queueVec = new mscorelib.List();
5405
4518
  }
5406
- /// <summary> returns the first object in the queue</summary>
5407
4519
  Queue.prototype.get = function () {
5408
4520
  var returnValue = null;
5409
4521
  if (this._queueVec.length > 0) {
@@ -5412,20 +4524,15 @@
5412
4524
  }
5413
4525
  return returnValue;
5414
4526
  };
5415
- /// <summary> add an object to the end of the queue</summary>
5416
- /// <param name="obj">the object to add
5417
4527
  Queue.prototype.put = function (obj) {
5418
4528
  this._queueVec.push(obj);
5419
4529
  };
5420
- /// <summary> remove all the objects from the queue</summary>
5421
4530
  Queue.prototype.clear = function () {
5422
4531
  this._queueVec.Clear();
5423
4532
  };
5424
- /// <summary> returns true if the queue is empty</summary>
5425
4533
  Queue.prototype.isEmpty = function () {
5426
4534
  return this._queueVec.length === 0;
5427
4535
  };
5428
- /// <summary> returns size of the queue</summary>
5429
4536
  Queue.prototype.Size = function () {
5430
4537
  return this._queueVec.length;
5431
4538
  };
@@ -5469,17 +4576,9 @@
5469
4576
  Randomizer._mul = 0.0;
5470
4577
  Randomizer._seed = 0.0;
5471
4578
 
5472
- /// <summary>
5473
- /// type checking for enum 'StorageAttribute'
5474
- /// </summary>
5475
4579
  var StorageAttributeCheck = /** @class */ (function () {
5476
4580
  function StorageAttributeCheck() {
5477
4581
  }
5478
- /// <summary>
5479
- /// is the both types belong to the same inner data types
5480
- /// </summary>
5481
- /// <param name = "type1">data type</param>
5482
- /// <param name = "type2">data type</param>
5483
4582
  StorageAttributeCheck.isTheSameType = function (type1, type2) {
5484
4583
  return type1 === type2 || (StorageAttributeCheck.isTypeNumeric(type1) && StorageAttributeCheck.isTypeNumeric(type2)) || (StorageAttributeCheck.isTypeLogical(type1) && StorageAttributeCheck.isTypeLogical(type2)) || (StorageAttributeCheck.IsTypeAlphaOrUnicode(type1) && StorageAttributeCheck.IsTypeAlphaOrUnicode(type2)) || (StorageAttributeCheck.isTypeBlob(type1) && StorageAttributeCheck.isTypeBlob(type2)) || (StorageAttributeCheck.isTypeDotNet(type1) && StorageAttributeCheck.isTypeDotNet(type2));
5485
4584
  };
@@ -5489,36 +4588,18 @@
5489
4588
  StorageAttributeCheck.isTypeAlpha = function (type) {
5490
4589
  return type === exports.StorageAttribute.ALPHA || type === exports.StorageAttribute.MEMO;
5491
4590
  };
5492
- /// <summary>
5493
- /// is the both types belong to the NUMERIC inner type
5494
- /// </summary>
5495
4591
  StorageAttributeCheck.isTypeNumeric = function (type) {
5496
4592
  return type === exports.StorageAttribute.DATE || type === exports.StorageAttribute.TIME || type === exports.StorageAttribute.NUMERIC;
5497
4593
  };
5498
- /// <summary>
5499
- /// is the both types belong to the LOGICAL inner type
5500
- /// </summary>
5501
4594
  StorageAttributeCheck.isTypeLogical = function (type) {
5502
4595
  return type === exports.StorageAttribute.BOOLEAN;
5503
4596
  };
5504
- /// <summary>
5505
- /// is the type is DOTNET
5506
- /// </summary>
5507
4597
  StorageAttributeCheck.isTypeDotNet = function (type) {
5508
4598
  return type === exports.StorageAttribute.DOTNET;
5509
4599
  };
5510
- /// <summary>
5511
- /// is the type ALPHA or UNICODE
5512
- /// </summary>
5513
- /// <param name = "type">data type</param>
5514
4600
  StorageAttributeCheck.IsTypeAlphaOrUnicode = function (type) {
5515
4601
  return type === exports.StorageAttribute.ALPHA || type === exports.StorageAttribute.UNICODE;
5516
4602
  };
5517
- /// <summary>
5518
- /// is the inner type ALPHA or UNICODE
5519
- /// </summary>
5520
- /// <param name = "type1">data type</param>
5521
- /// <param name = "type2">data type</param>
5522
4603
  StorageAttributeCheck.StorageFldAlphaOrUnicode = function (type1, type2) {
5523
4604
  return StorageAttributeCheck.IsTypeAlphaOrUnicode(type1) && StorageAttributeCheck.IsTypeAlphaOrUnicode(type2);
5524
4605
  };
@@ -5534,12 +4615,6 @@
5534
4615
  return ((type1AlphaOrUnicode && type2Blob) || (type2AlphaOrUnicode && type1Blob));
5535
4616
  }
5536
4617
  };
5537
- /// <summary>
5538
- /// Check if types are compatible or not.
5539
- /// </summary>
5540
- /// <param name="sourceAttribute"></param>
5541
- /// <param name="destinationAttribute"></param>
5542
- /// <returns></returns>
5543
4618
  StorageAttributeCheck.IsTypeCompatibile = function (sourceAttribute, destinationAttribute) {
5544
4619
  var isTypeCompatible = false;
5545
4620
  switch (sourceAttribute) {
@@ -5585,20 +4660,11 @@
5585
4660
  return StorageAttributeCheck;
5586
4661
  }());
5587
4662
 
5588
- /// <summary>
5589
- /// Helper class for synchronized execution.
5590
- /// It works by creating a promise and then waiting for the promise to be completed
5591
- /// </summary>
5592
- // @dynamic
5593
4663
  var SyncExecutionHelper = /** @class */ (function () {
5594
4664
  function SyncExecutionHelper() {
5595
- // resolver is caller when promise is fullfilled
5596
4665
  this.resolver = null;
5597
4666
  }
5598
4667
  Object.defineProperty(SyncExecutionHelper, "Instance", {
5599
- /// <summary>
5600
- /// get instance of SyncExecutionHelper
5601
- /// </summary>
5602
4668
  get: function () {
5603
4669
  if (SyncExecutionHelper._instance === null)
5604
4670
  SyncExecutionHelper._instance = new SyncExecutionHelper();
@@ -5607,9 +4673,6 @@
5607
4673
  enumerable: false,
5608
4674
  configurable: true
5609
4675
  });
5610
- /// <summary>
5611
- /// To wait, create a promise and add wait for it to complete
5612
- /// </summary>
5613
4676
  SyncExecutionHelper.prototype.Wait = function () {
5614
4677
  var _this = this;
5615
4678
  Logger.Instance.WriteDevToLog("SyncExecutionHelper.Wait()");
@@ -5617,9 +4680,6 @@
5617
4680
  _this.resolver = resolve;
5618
4681
  }).then();
5619
4682
  };
5620
- /// <summary>
5621
- /// To resume call the resolver
5622
- /// </summary>
5623
4683
  SyncExecutionHelper.prototype.Pulse = function () {
5624
4684
  var resolver = this.resolver;
5625
4685
  if (resolver != null) {
@@ -5641,13 +4701,6 @@
5641
4701
  var IDX_DOY = 3;
5642
4702
  var UtilDateJpn = /** @class */ (function () {
5643
4703
  function UtilDateJpn() {
5644
- /// <summary>
5645
- /// JPN: Japanese date picture support
5646
- /// Utility Class for Japanese date
5647
- /// </summary>
5648
- /// <author> Toshiro Nakayoshi (MSJ)
5649
- /// </author>
5650
- // ---- gengo (the name of an era) ---------------------------------------
5651
4704
  this.MaxGengo = MAX_GENGO;
5652
4705
  }
5653
4706
  UtilDateJpn.getInstance = function () {
@@ -5673,18 +4726,6 @@
5673
4726
  }
5674
4727
  return UtilDateJpn.JmonthStr[month];
5675
4728
  };
5676
- /// <summary>
5677
- /// Convert a year (A.D.) into Japanese year of an era
5678
- /// This method is modeled after "date_jpn_year_ofs" function in
5679
- /// "\mglocal\jpn\jpndate_jpn.cpp".
5680
- /// </summary>
5681
- /// <param name = "intYear:">year (A.D.)
5682
- /// </param>
5683
- /// <param name = "intDoy:">DOY
5684
- /// </param>
5685
- /// <returns> year of an era.
5686
- /// if either param is invalid, it returns 0.
5687
- /// </returns>
5688
4729
  UtilDateJpn.prototype.date_jpn_year_ofs = function (intYear, intDoy) {
5689
4730
  var result;
5690
4731
  if (intYear < 1 || intDoy < 1) {
@@ -5702,20 +4743,6 @@
5702
4743
  }
5703
4744
  return result;
5704
4745
  };
5705
- /// <summary>
5706
- /// Convert a year (A.D.) into a name of a Japanese era
5707
- /// This method is modeled after "date_jpn_yr_2_a" function in
5708
- /// "\mglocal\jpn\jpndate_jpn.cpp".
5709
- /// </summary>
5710
- /// <param name = "intYear:">year (A.D.)
5711
- /// </param>
5712
- /// <param name = "intDoy:">DOY
5713
- /// </param>
5714
- /// <param name = "isKanji:">return a full name (true) or the first letter (false).
5715
- /// </param>
5716
- /// <returns> name of an era
5717
- /// if either param is invalid, it returns "?".
5718
- /// </returns>
5719
4746
  UtilDateJpn.prototype.date_jpn_yr_2_a = function (intYear, intDoy, isKanji) {
5720
4747
  var num;
5721
4748
  if (intYear < 1 || intDoy < 1) {
@@ -5739,17 +4766,6 @@
5739
4766
  }
5740
4767
  return result;
5741
4768
  };
5742
- /// <summary>
5743
- /// Get the first year (A.D.) of a specified Japanese era
5744
- /// This method is modeled after "date_jpn_yr_4_a" function in
5745
- /// "\mglocal\jpn\jpndate_jpn.cpp".
5746
- /// </summary>
5747
- /// <param name = "ucp_str:">name of a specified Japanese era
5748
- /// </param>
5749
- /// <param name = "s_len:">length (the number of bytes) of ucp_str
5750
- /// </param>
5751
- /// <returns> year (A.D.)
5752
- /// </returns>
5753
4769
  UtilDateJpn.prototype.date_jpn_yr_4_a = function (ucp_str, s_len) {
5754
4770
  var i = this.MaxGengo - 1;
5755
4771
  if (s_len > 0) {
@@ -5788,17 +4804,6 @@
5788
4804
  }
5789
4805
  return result;
5790
4806
  };
5791
- /// <summary>
5792
- /// Get the name of an era in date string
5793
- /// </summary>
5794
- /// <param name = "strDate:">string of input strDate
5795
- /// </param>
5796
- /// <param name = "strPicture:">string of picture
5797
- /// </param>
5798
- /// <param name = "intStartPos:">start position to search
5799
- /// </param>
5800
- /// <returns> name of an era
5801
- /// </returns>
5802
4807
  UtilDateJpn.getEraNameStrInDate = function (strDate, strPicture, intStartPos) {
5803
4808
  var result = null;
5804
4809
  var intPicIdxOfs = 0;
@@ -5817,7 +4822,6 @@
5817
4822
  intLetters = 2;
5818
4823
  }
5819
4824
  else {
5820
- // If "strDate" contains DBCS, the position of "strPicture" has to skip next index.
5821
4825
  if (i < strDate.length) {
5822
4826
  if (!UtilStrByteMode.isHalfWidth(strDate[i]) && UtilStrByteMode.isHalfWidth(strPicture[i + intPicIdxOfs])) {
5823
4827
  intPicIdxOfs = intPicIdxOfs + 1;
@@ -5829,19 +4833,10 @@
5829
4833
  }
5830
4834
  }
5831
4835
  result = strDate.substr(i, intLetters);
5832
- break; // exit loop
4836
+ break;
5833
4837
  }
5834
4838
  return result;
5835
4839
  };
5836
- /// <summary>
5837
- /// Get the length of the name of an era in picture
5838
- /// </summary>
5839
- /// <param name = "strPicture">string of picture
5840
- /// </param>
5841
- /// <param name = "intStartPos">start position to search
5842
- /// </param>
5843
- /// <returns> length of the name (the number of bytes)
5844
- /// </returns>
5845
4840
  UtilDateJpn.getEraNameLenInPicture = function (strPicture, intStartPos) {
5846
4841
  var intLetters = 0;
5847
4842
  for (var i = intStartPos; i < strPicture.length; i = i + 1) {
@@ -5864,15 +4859,6 @@
5864
4859
  }
5865
4860
  return intLetters;
5866
4861
  };
5867
- /// <summary>
5868
- /// Get the start year of an era in picture
5869
- /// </summary>
5870
- /// <param name = "strDate:">string of input strDate
5871
- /// </param>
5872
- /// <param name = "strPicture:">string of picture
5873
- /// </param>
5874
- /// <returns> start year of the era
5875
- /// </returns>
5876
4862
  UtilDateJpn.prototype.getStartYearOfEra = function (strDate, strPicture) {
5877
4863
  var eraNameStrInDate = UtilDateJpn.getEraNameStrInDate(strDate, strPicture, 0);
5878
4864
  var result;
@@ -5891,13 +4877,7 @@
5891
4877
  }
5892
4878
  return result;
5893
4879
  };
5894
- /// <summary> Add extra Gengo data into the Gengo tables</summary>
5895
- /// <param name="strExtraGengo:">
5896
- /// </param>
5897
- /// <returns>
5898
- /// </returns>
5899
4880
  UtilDateJpn.prototype.addExtraGengo = function (strExtraGengo) {
5900
- // e.g. strExtraGengo = "2012/04/01,092,AaABCD;2013/04/01,091,WwWXYZ;"
5901
4881
  var strGengoInfo = strExtraGengo.split(';');
5902
4882
  for (var i = 0; i < strGengoInfo.length; i = i + 1) {
5903
4883
  if (strGengoInfo[i].length > 0) {
@@ -5905,13 +4885,13 @@
5905
4885
  if (strTok.length === 3 && strTok[0].length > 0 && strTok[1].length > 0 && strTok[2].length > 0) {
5906
4886
  var strDate = strTok[0].split('/');
5907
4887
  if (strDate.length === 3 && strDate[0].length > 0 && strDate[1].length > 0 && strDate[2].length > 0) {
5908
- UtilDateJpn.GengoStr[MAX_GENGO + i][0] = strTok[2].substr(0, 1); // symbol name (upper case): A
5909
- UtilDateJpn.GengoStr[MAX_GENGO + i][1] = strTok[2].substr(1, 1); // symbol name (lower case): a
5910
- UtilDateJpn.GengoStr[MAX_GENGO + i][2] = strTok[2].substr(2); // gengo name: ABCD
5911
- UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][0] = mscorelib.NNumber.Parse(strDate[0]); // start year: 2012
5912
- UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][1] = mscorelib.NNumber.Parse(strDate[1]); // start month: 4
5913
- UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][2] = mscorelib.NNumber.Parse(strDate[2]); // start day: 1
5914
- UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][3] = mscorelib.NNumber.Parse(strTok[1]); // days since January 1: 92
4888
+ UtilDateJpn.GengoStr[MAX_GENGO + i][0] = strTok[2].substr(0, 1);
4889
+ UtilDateJpn.GengoStr[MAX_GENGO + i][1] = strTok[2].substr(1, 1);
4890
+ UtilDateJpn.GengoStr[MAX_GENGO + i][2] = strTok[2].substr(2);
4891
+ UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][0] = mscorelib.NNumber.Parse(strDate[0]);
4892
+ UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][1] = mscorelib.NNumber.Parse(strDate[1]);
4893
+ UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][2] = mscorelib.NNumber.Parse(strDate[2]);
4894
+ UtilDateJpn.StartDayOfGengo[MAX_GENGO + i][3] = mscorelib.NNumber.Parse(strTok[1]);
5915
4895
  this.MaxGengo++;
5916
4896
  }
5917
4897
  }
@@ -5950,70 +4930,42 @@
5950
4930
  [0, 0, 0, 0]
5951
4931
  ];
5952
4932
 
5953
- /// <summary>JPN: IME support
5954
- /// Utility Class for Input Method Editor
5955
- /// </summary>
5956
- /// <author> Toshiro Nakayoshi (MSJ)
5957
- /// </author>
5958
4933
  var UtilImeJpn = /** @class */ (function () {
5959
4934
  function UtilImeJpn() {
5960
4935
  this.ImeAutoOff = false;
5961
4936
  this.StrImeRead = null;
5962
4937
  }
5963
- /// <summary> check if the IME mode is within valid range
5964
- /// </summary>
5965
- /// <param name="imeMode">(IME mode in Magic)
5966
- /// </param>
5967
- /// <returns> bool
5968
- /// </returns>
5969
4938
  UtilImeJpn.prototype.isValid = function (imeMode) {
5970
4939
  return (0 <= imeMode && imeMode <= 9) || imeMode === 15 || imeMode === 10;
5971
4940
  };
5972
- /// <summary> convert the input method editor mode
5973
- /// </summary>
5974
- /// <param name="imeMode">(IME mode in Magic)
5975
- /// </param>
5976
- /// <returns> imeConvMode (IME conversion mode in imm32.lib)
5977
- /// </returns>
5978
4941
  UtilImeJpn.imeMode2imeConvMode = function (imeMode) {
5979
4942
  var result;
5980
4943
  switch (imeMode) {
5981
- // IME_ZEN_HIRAGANA_ROMAN
5982
4944
  case 1:
5983
4945
  result = 25;
5984
4946
  break;
5985
- // IME_ZEN_HIRAGANA
5986
4947
  case 2:
5987
4948
  result = 9;
5988
4949
  break;
5989
- // IME_ZEN_KATAKANA_ROMAN
5990
4950
  case 3:
5991
4951
  result = 27;
5992
4952
  break;
5993
- // IME_ZEN_KATAKANA
5994
4953
  case 4:
5995
4954
  result = 11;
5996
4955
  break;
5997
- // IME_HAN_KATAKANA_ROMAN
5998
4956
  case 5:
5999
4957
  result = 19;
6000
4958
  break;
6001
- // IME_HAN_KATAKANA
6002
4959
  case 6:
6003
4960
  result = 3;
6004
4961
  break;
6005
- // IME_ZEN_ALPHANUMERIC
6006
4962
  case 7:
6007
4963
  result = 8;
6008
4964
  break;
6009
- // IME_HAN_ALPHANUMERIC
6010
4965
  case 8:
6011
4966
  case 9:
6012
4967
  result = 0;
6013
4968
  break;
6014
- // case 0:
6015
- // case IME_DISABLE:
6016
- // case IME_FORCE_OFF:
6017
4969
  default:
6018
4970
  result = 256;
6019
4971
  break;
@@ -6030,29 +4982,18 @@
6030
4982
  UtilImeJpn.IME_CMODE_NOCONVERSION = 256;
6031
4983
  UtilImeJpn.IME_NOT_INITIALIZED = -1;
6032
4984
  UtilImeJpn.IME_ZEN_HIRAGANA_ROMAN = 1;
6033
- UtilImeJpn.IME_FORCE_OFF = 15; // if (ImeMode property == 0 and (picture has K0 or PIC_S)) or
6034
- // (attribute is not alpha, unicode, nor blob), set IME_FORCE_OFF.
6035
- UtilImeJpn.IME_DISABLE = 10; // to completely disable IME (even not allowing to change the mode)
4985
+ UtilImeJpn.IME_FORCE_OFF = 15;
4986
+ UtilImeJpn.IME_DISABLE = 10;
6036
4987
 
6037
- /// <summary> a helper class for the parsing of the XML</summary>
6038
4988
  var XmlParser = /** @class */ (function () {
6039
- /// <summary>
6040
- ///
6041
- /// </summary>
6042
- /// <param name="data"></param>
6043
4989
  function XmlParser(data) {
6044
4990
  if (data === void 0) { data = mscorelib.NString.Empty; }
6045
4991
  this._currIndex = 0;
6046
4992
  this._xmLdata = "";
6047
- this._history = new mscorelib.List(); // In order to allow recursive parsing we save prev data
4993
+ this._history = new mscorelib.List();
6048
4994
  this.setXMLdata(data);
6049
4995
  this.setCurrIndex(0);
6050
4996
  }
6051
- /// <summary> parse a string according to a set of delimiters and return the result in a vector</summary>
6052
- /// <param name="str">the String which need be parted </param>
6053
- /// <param name="delimiter">the delimiter which part different parts of str </param>
6054
- /// <param name="isMagicXML">is needed tokenizer working on Magic XML, so the "=" sign will be delited in the end of every first token </param>
6055
- /// <returns> tmpVector dynamically array, which consist tokens in every element, every token is String </returns>
6056
4997
  XmlParser.getTokens = function (str, delimiter, isMagicXML) {
6057
4998
  if (isMagicXML === void 0) { isMagicXML = true; }
6058
4999
  var tokensVec = new mscorelib.List();
@@ -6062,22 +5003,17 @@
6062
5003
  }
6063
5004
  var strTok = str.split(delimiter.charAt(0));
6064
5005
  for (var i = 0; i < strTok.length; i = i + 1) {
6065
- // Split in C# creates a last empty string token if the source string ends with
6066
- // the delimiter or if the string is empty (as opposed to Java that will ignore it)
6067
- // therefore we have to break this loop if such case occurs.
6068
5006
  if (isMagicXML && i === strTok.length - 1 && strTok.length % 2 === 1) {
6069
5007
  break;
6070
5008
  }
6071
5009
  token = strTok[i];
6072
5010
  if (isMagicXML) {
6073
- // the 1st token in the pair comes with "=", remove it.
6074
5011
  if (i % 2 === 0) {
6075
5012
  token = token.trim();
6076
5013
  if (token.endsWith("=")) {
6077
5014
  token = token.substr(0, token.length - 1);
6078
5015
  }
6079
5016
  }
6080
- // 2nd token in the pair can be an empty string, in that case set it to " ".
6081
5017
  else if (token === "")
6082
5018
  token = " ";
6083
5019
  }
@@ -6087,11 +5023,6 @@
6087
5023
  }
6088
5024
  return tokensVec;
6089
5025
  };
6090
- /// <summary>unscape from:
6091
- /// {"&amp;",\\, \q, \o, \l, \g, \e, \\r, \\n}, to:
6092
- /// {"&", \, ", ', <, >, =, \r, \n}
6093
- /// <param name="str">String to be converted</param>
6094
- /// <returns>unescaped string</returns>
6095
5026
  XmlParser.unescape = function (str) {
6096
5027
  var unescapedString = new mscorelib.StringBuilder(str.length);
6097
5028
  for (var i = 0; i < str.length; i++) {
@@ -6128,11 +5059,6 @@
6128
5059
  }
6129
5060
  return (unescapedString.ToString());
6130
5061
  };
6131
- /// <summary>escape from:
6132
- /// {\, ", ', <, >, =, \r, \n}, to:
6133
- /// {\\, \q, \0, \l, \g, \e, \\r, \\n}
6134
- /// <param name="str">String to be converted</param>
6135
- /// <returns>escaped string</returns>
6136
5062
  XmlParser.escape = function (str) {
6137
5063
  var escapedString = new mscorelib.StringBuilder(str.length * 2);
6138
5064
  for (var i = 0; i < str.length; i++) {
@@ -6168,23 +5094,15 @@
6168
5094
  }
6169
5095
  return (escapedString.ToString());
6170
5096
  };
6171
- /// <summary>
6172
- /// here we only need to take care of "&" so that Sax parser will be able to handle url
6173
- /// </summary>
6174
- /// <param name="str"></param>
6175
- /// <returns></returns>
6176
5097
  XmlParser.escapeUrl = function (str) {
6177
5098
  return mscorelib.NString.Replace(str, "&", "&amp;");
6178
5099
  };
6179
- /// <summary>get next tag name from current index in XML string</summary>
6180
- /// <returns> next tag name </returns>
6181
5100
  XmlParser.prototype.getNextTag = function () {
6182
5101
  if (this._xmLdata.length - this._currIndex <= 1) {
6183
- return null; // end of XML string
5102
+ return null;
6184
5103
  }
6185
5104
  for (var tmpIndx = this._currIndex + 1; tmpIndx < this._xmLdata.length; tmpIndx++) {
6186
5105
  var tmpChar = this._xmLdata[tmpIndx];
6187
- // a letter starts an element and ends with " ". "/" starts an element closing and ends with '>'.
6188
5106
  if (mscorelib.NChar.IsLetter(tmpChar) || tmpChar === '/') {
6189
5107
  var endOfTag = mscorelib.NString.IndexOfAny(this._xmLdata, XmlParser.endOfNameChar, tmpIndx, this._xmLdata.length - tmpIndx);
6190
5108
  if (endOfTag === -1)
@@ -6195,34 +5113,25 @@
6195
5113
  }
6196
5114
  return null;
6197
5115
  };
6198
- /// <summary>Substring of XMLstring</summary>
6199
- /// <returns> substring of XML string -from currIndex to endContext </returns>
6200
5116
  XmlParser.prototype.getXMLsubstring = function (endContext) {
6201
5117
  return this._xmLdata.substr(this._currIndex, endContext - this._currIndex);
6202
5118
  };
6203
- /// <summary>get current element value</summary>
6204
- /// <returns> element's value </returns>
6205
5119
  XmlParser.prototype.GetCurrentElementValue = function () {
6206
5120
  this.setCurrIndex2EndOfTag();
6207
5121
  var endContext = this.getXMLdata().indexOf(XMLConstants.TAG_OPEN, this.getCurrIndex());
6208
- // read value of xml element
6209
5122
  var value = this.getXMLsubstring(endContext);
6210
5123
  this.setCurrIndex2EndOfTag();
6211
5124
  return value;
6212
5125
  };
6213
- /// <summary>set current index (on parsing time) to the end of current tag</summary>
6214
5126
  XmlParser.prototype.setCurrIndex2EndOfTag = function () {
6215
5127
  this._currIndex = this._xmLdata.indexOf(XMLConstants.TAG_CLOSE, this._currIndex) + 1;
6216
5128
  };
6217
- /// <summary>get int from string at parsing time</summary>
6218
5129
  XmlParser.getInt = function (valueStr) {
6219
5130
  return mscorelib.NNumber.Parse(valueStr.trim());
6220
5131
  };
6221
- /// <summary>get boolean from string at parsing time</summary>
6222
5132
  XmlParser.getBoolean = function (valueStr) {
6223
5133
  return valueStr[0] === '1';
6224
5134
  };
6225
- /// <summary>get/set functions 4 XMLstring & currIndex, for parser</summary>
6226
5135
  XmlParser.prototype.getCurrIndex = function () {
6227
5136
  return this._currIndex;
6228
5137
  };
@@ -6243,81 +5152,46 @@
6243
5152
  this.setCurrIndex(0);
6244
5153
  }
6245
5154
  };
6246
- /// <summary>
6247
- /// prepare the parser to read from the newXmlString
6248
- /// </summary>
6249
- /// <param name="newXmlString"></param>
6250
5155
  XmlParser.prototype.PrepareFormReadString = function (newXmlString) {
6251
5156
  this.setXMLdata(newXmlString);
6252
5157
  this.setCurrIndex(0);
6253
5158
  };
6254
- /// <summary> push the current parsing information into the history stack</summary>
6255
5159
  XmlParser.prototype.push = function () {
6256
5160
  this._history.push(this._currIndex);
6257
5161
  this._history.push(this._xmLdata);
6258
5162
  };
6259
- /// <summary> restore the previous parsing information from the history stack</summary>
6260
5163
  XmlParser.prototype.pop = function () {
6261
5164
  var count = this._history.length;
6262
5165
  this._xmLdata = this._history.get_Item(count - 1);
6263
5166
  this._currIndex = this._history.get_Item(count - 2);
6264
5167
  this._history.SetSize(count - 2);
6265
5168
  };
6266
- /// <summary>gets a table cache xml and set the xmlparser data and index accordingly</summary>
6267
5169
  XmlParser.prototype.loadTableCacheData = function (data) {
6268
5170
  this.setXMLdata(data);
6269
5171
  this.setCurrIndex(0);
6270
5172
  };
6271
- /// <summary>
6272
- /// Reads the XML from the element at the current position until the end of
6273
- /// the element, returning the contents as a string. This allows deferring the
6274
- /// processing of an element until the time is right to do so.<br/>
6275
- /// The returned string contains the element tag itself. For example:<br/>
6276
- /// - Assuming that the current element is 'element1', with 2 'innerElement' elements, the
6277
- /// resulting string will look like this:<br/>
6278
- /// <element1>
6279
- /// <innerelement/>
6280
- /// <innerelement/>
6281
- /// </element1>
6282
- ///
6283
- /// This makes the result valid for processing by this XML parser.
6284
- /// </summary>
6285
- /// <returns></returns>
6286
5173
  XmlParser.prototype.ReadToEndOfCurrentElement = function () {
6287
- // Get the current tag according to the value of _currIndex.
6288
5174
  var currentTag = this.getNextTag();
6289
5175
  var currentTagIndex = this._xmLdata.indexOf(XMLConstants.TAG_OPEN + currentTag, this.getCurrIndex());
6290
- // Find the end of the element's block in the XML.
6291
- // find next open tag
6292
5176
  var nextOpenTagIndex = this._xmLdata.indexOf(XMLConstants.TAG_OPEN, currentTagIndex + 1);
6293
5177
  if (nextOpenTagIndex === -1)
6294
5178
  nextOpenTagIndex = this._xmLdata.length;
6295
- // find a close tag BEFORE the next open tag
6296
5179
  var elementEndIndex = mscorelib.NString.IndexOf(this._xmLdata, XMLConstants.TAG_TERM, this.getCurrIndex(), nextOpenTagIndex - this.getCurrIndex());
6297
5180
  if (elementEndIndex === -1)
6298
- // close tag was not found in range - we have inner elements, look for the full close tag
6299
5181
  elementEndIndex = this._xmLdata.indexOf("/" + currentTag, this.getCurrIndex()) + currentTag.length + XMLConstants.TAG_TERM.length;
6300
5182
  else
6301
5183
  elementEndIndex = elementEndIndex + XMLConstants.TAG_TERM.length;
6302
- // Copy the element data so it can be returned.
6303
5184
  var elementBlock = this.getXMLsubstring(elementEndIndex);
6304
- // Move the parser to the end of the element block.
6305
5185
  this.setCurrIndex(elementEndIndex);
6306
5186
  return elementBlock;
6307
5187
  };
6308
5188
  XmlParser.prototype.ReadContentOfCurrentElement = function () {
6309
- // Get the current tag according to the value of _currIndex.
6310
5189
  var currentTag = this.getNextTag();
6311
- // Find the end of the element's block in the XML.
6312
5190
  var elementEndIndex = this._xmLdata.indexOf("</" + currentTag + ">", this.getCurrIndex());
6313
5191
  if (elementEndIndex === -1)
6314
- // Can't find the end of the current element - either XML is faulty or the element is empty.
6315
5192
  return mscorelib.NString.Empty;
6316
- // Move to the end of the opening tag
6317
5193
  this.setCurrIndex2EndOfTag();
6318
- // Copy the content of the element (from the end of the opening tag to the beginning of the closing tag).
6319
5194
  var elementBlock = this.getXMLsubstring(elementEndIndex);
6320
- // Move the parser to the end of the element block.
6321
5195
  this.setCurrIndex(elementEndIndex);
6322
5196
  this.setCurrIndex2EndOfTag();
6323
5197
  return elementBlock;
@@ -6328,29 +5202,9 @@
6328
5202
  }
6329
5203
  return this.ToString_1(headCharCount, tailCharCount);
6330
5204
  };
6331
- /// <summary>
6332
- /// Generates a string that visualizes the XML parser state (e.g. for debug watch list.)<br/>
6333
- /// The method will show the XML data, trimming it to 20 characters before the
6334
- /// current position (_currIndex) and up to 50 characters after the current position.
6335
- /// The current position itself will be marked with a marker that looks like:
6336
- /// |-{current index}-| <br/>
6337
- /// The marker will be placed immediately before _xmlData[_currIndex].
6338
- /// </summary>
6339
- /// <returns></returns>
6340
5205
  XmlParser.prototype.ToString_0 = function () {
6341
5206
  return this.toString(20, 50);
6342
5207
  };
6343
- /// <summary>
6344
- /// Generates a string that visualizes the XML parser state (e.g. for debug watch list.)<br/>
6345
- /// The method will show the XML data, trimming it to headCharCount characters before the
6346
- /// current position (_currIndex) and up to tailCharCount characters after the current position.
6347
- /// The current position itself will be marked with a marker that looks like:
6348
- /// |-{current index}-| <br/>
6349
- /// The marker will be placed immediately before _xmlData[_currIndex].
6350
- /// </summary>
6351
- /// <param name="headCharCount">Number of characters to show before the current position marker.</param>
6352
- /// <param name="tailCharCount">Number of characters to show after the current position marker.</param>
6353
- /// <returns></returns>
6354
5208
  XmlParser.prototype.ToString_1 = function (headCharCount, tailCharCount) {
6355
5209
  var markerPosition = Math.min(this._currIndex, this._xmLdata.length);
6356
5210
  var segmentStartIndex = Math.max(0, markerPosition - headCharCount);
@@ -6379,10 +5233,6 @@
6379
5233
  }());
6380
5234
  XmlParser.endOfNameChar = [' ', '>'];
6381
5235
 
6382
- /**
6383
- * Generated bundle index. Do not edit.
6384
- */
6385
-
6386
5236
  exports.Base64 = Base64;
6387
5237
  exports.ChoiceUtils = ChoiceUtils;
6388
5238
  exports.Constants = Constants;