Platform class This class contains type sizes Attributes: name Name of the platform: unspecified/native/win32A/win32W/win64/unix32/unix64/platformFile char_bit CHAR_BIT value short_bit SHORT_BIT value int_bit INT_BIT value
| 1108 | |
| 1109 | |
| 1110 | class Platform: |
| 1111 | """ |
| 1112 | Platform class |
| 1113 | This class contains type sizes |
| 1114 | |
| 1115 | Attributes: |
| 1116 | name Name of the platform: unspecified/native/win32A/win32W/win64/unix32/unix64/platformFile |
| 1117 | char_bit CHAR_BIT value |
| 1118 | short_bit SHORT_BIT value |
| 1119 | int_bit INT_BIT value |
| 1120 | long_bit LONG_BIT value |
| 1121 | long_long_bit LONG_LONG_BIT value |
| 1122 | pointer_bit POINTER_BIT value |
| 1123 | """ |
| 1124 | |
| 1125 | name = '' |
| 1126 | char_bit = 0 |
| 1127 | short_bit = 0 |
| 1128 | int_bit = 0 |
| 1129 | long_bit = 0 |
| 1130 | long_long_bit = 0 |
| 1131 | pointer_bit = 0 |
| 1132 | |
| 1133 | def __init__(self, platformnode): |
| 1134 | self.name = platformnode.get('name') |
| 1135 | self.char_bit = int(platformnode.get('char_bit')) |
| 1136 | self.short_bit = int(platformnode.get('short_bit')) |
| 1137 | self.int_bit = int(platformnode.get('int_bit')) |
| 1138 | self.long_bit = int(platformnode.get('long_bit')) |
| 1139 | self.long_long_bit = int(platformnode.get('long_long_bit')) |
| 1140 | self.pointer_bit = int(platformnode.get('pointer_bit')) |
| 1141 | |
| 1142 | def __repr__(self): |
| 1143 | attrs = ["name", "char_bit", "short_bit", "int_bit", |
| 1144 | "long_bit", "long_long_bit", "pointer_bit"] |
| 1145 | return "{}({})".format( |
| 1146 | "Platform", |
| 1147 | ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs)) |
| 1148 | ) |
| 1149 | |
| 1150 | |
| 1151 | class Standards: |