| 137 | |
| 138 | |
| 139 | bool cSchematicFileSerializer::SaveToSchematicString(const cBlockArea & a_BlockArea, AString & a_Out) |
| 140 | { |
| 141 | // Serialize into NBT data: |
| 142 | AString NBT = SaveToSchematicNBT(a_BlockArea); |
| 143 | if (NBT.empty()) |
| 144 | { |
| 145 | LOG("%s: Cannot serialize the area into an NBT representation.", __FUNCTION__); |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | // Gzip the data: |
| 150 | int res = CompressStringGZIP(NBT.data(), NBT.size(), a_Out); |
| 151 | if (res != Z_OK) |
| 152 | { |
| 153 | LOG("%s: Cannot Gzip the area data NBT representation: %d", __FUNCTION__, res); |
| 154 | return false; |
| 155 | } |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | |
| 160 |
nothing calls this directly
no test coverage detected