writeValueArray.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #pragma once
  2. #include "MASTER.h"
  3. #include "GLOBAL.h"
  4. #include "basicTypes.h"
  5. #include "fileStuff.h"
  6. #include "FileWriterInterface.h"
  7. #include "LightweightVector.h"
  8. #include "stringformat.h"
  9. inline void getBitIndexAndOffset(size_t &ind, size_t &___2865, size_t ___2085)
  10. {
  11. ind = ___2085 / 8;
  12. ___2865 = ___2085 - ind * 8;
  13. }
  14. template <typename T>
  15. inline void setBit(T &uInt8Array, size_t ___2085)
  16. {
  17. size_t ind;
  18. size_t ___2865;
  19. getBitIndexAndOffset(ind, ___2865, ___2085);
  20. uInt8Array[ind] |= 1 << ___2865;
  21. }
  22. template <typename T>
  23. inline void clearBit(T &uInt8Array, size_t ___2085)
  24. {
  25. size_t ind;
  26. size_t ___2865;
  27. getBitIndexAndOffset(ind, ___2865, ___2085);
  28. uInt8Array[ind] &= ~(1 << ___2865);
  29. }
  30. template <typename T>
  31. inline uint8_t bitValue(T const &uInt8Array, size_t ___2085)
  32. {
  33. size_t ind;
  34. size_t ___2865;
  35. getBitIndexAndOffset(ind, ___2865, ___2085);
  36. return (uInt8Array[ind] & (1 << ___2865));
  37. }
  38. template <typename T>
  39. inline bool inBitSet(T const &uInt8Array, size_t ___2085)
  40. {
  41. size_t ind;
  42. size_t ___2865;
  43. getBitIndexAndOffset(ind, ___2865, ___2085);
  44. return ((uInt8Array[ind] & (uint8_t(0x1) << ___2865)) != 0);
  45. }
  46. template <typename T>
  47. inline void addToBitSet(T &uInt8Array, size_t ___2085)
  48. {
  49. size_t ind;
  50. size_t ___2865;
  51. getBitIndexAndOffset(ind, ___2865, ___2085);
  52. uInt8Array[ind] |= (uint8_t(0x1) << ___2865);
  53. }
  54. template <typename T>
  55. inline void removeFromBitSet(T &uInt8Array, size_t ___2085)
  56. {
  57. size_t ind;
  58. size_t ___2865;
  59. getBitIndexAndOffset(ind, ___2865, ___2085);
  60. uInt8Array[ind] &= (uint8_t(0xFF) - (uint8_t(0x1) << ___2865));
  61. }
  62. namespace tecplot
  63. {
  64. namespace ___3933
  65. {
  66. ___81 const ___2745 = BAD_ANY_INDEX;
  67. static size_t const ___946 = 10;
  68. template <typename T, bool ___2025, int base>
  69. ___372 encodeAsciiValue(char *str, int ___418, T const &___4298);
  70. template <typename T, bool ___2025, int base>
  71. ___372 ___4563(FileWriterInterface &file, char const *___972, ___81 ___1251, size_t ___2797, T const *___4299, size_t ___4334 = ___946);
  72. template <typename OutType>
  73. ___372 ___4528(FileWriterInterface &file, char const *___972, ___81 ___1251, size_t ___2797, ___2479 const *___4299, size_t ___4334 = ___946 / 2);
  74. template <typename T, bool ___2025, int base>
  75. ___372 writeValue(FileWriterInterface &file, char const *___972, T const &___4298) { return ___4563<T, ___2025, base>(file, ___972, ___2745, 1, &___4298); }
  76. inline ___372 ___4544(FileWriterInterface &file, char const *___972, char const *___4298)
  77. {
  78. ___372 ___2039 = ___4226;
  79. REQUIRE(file.___2041());
  80. REQUIRE(VALID_REF(___972) && strlen(___972) < ___206);
  81. REQUIRE(VALID_REF(___4298));
  82. if (file.___2002())
  83. ___2039 = (file.fprintf("%*s %s\r\n", -___206, ___972, ___4298) > 0);
  84. else
  85. ___2039 = (file.fwrite(___4298, 1, strlen(___4298)) == strlen(___4298));
  86. ENSURE(VALID_BOOLEAN(___2039));
  87. return ___2039;
  88. }
  89. template <typename T, bool ___2025>
  90. uint64_t arrayValueSizeInFile(bool ___2002);
  91. template <typename T, bool ___2025>
  92. uint64_t arraySizeInFile(size_t ___2797, bool ___2002);
  93. template <typename T, bool ___2025>
  94. uint64_t valueSizeInFile(bool ___2002);
  95. }
  96. }