Cuberite
A lightweight, fast and extensible game server for Minecraft
SchematicFileSerializer.h
Go to the documentation of this file.
1 
2 // SchematicFileSerializer.h
3 
4 // Declares the cSchematicFileSerializer class representing the interface to load and save cBlockArea to a .schematic file
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "../BlockArea.h"
13 
14 
15 
16 
17 
18 // fwd: FastNBT.h
19 class cParsedNBT;
20 
21 
22 
23 
24 
26 {
27 public:
28 
30  static bool LoadFromSchematicFile(cBlockArea & a_BlockArea, const AString & a_FileName);
31 
33  static bool LoadFromSchematicString(cBlockArea & a_BlockArea, const AString & a_SchematicData);
34 
36  static bool SaveToSchematicFile(const cBlockArea & a_BlockArea, const AString & a_FileName);
37 
40  static bool SaveToSchematicString(const cBlockArea & a_BlockArea, AString & a_Out);
41 
42 private:
45  static bool LoadFromSchematicNBT(cBlockArea & a_BlockArea, cParsedNBT & a_NBT);
46 
49  static AString SaveToSchematicNBT(const cBlockArea & a_BlockArea);
50 };
51 
52 
53 
54 
static AString SaveToSchematicNBT(const cBlockArea &a_BlockArea)
Saves the area into a NBT representation and returns the NBT data as a string.
static bool SaveToSchematicString(const cBlockArea &a_BlockArea, AString &a_Out)
Saves the area into a string containing the .schematic file data.
Parses and contains the parsed data Also implements data accessor functions for tree traversal and va...
Definition: FastNBT.h:152
static bool LoadFromSchematicFile(cBlockArea &a_BlockArea, const AString &a_FileName)
Loads an area from a .schematic file.
static bool SaveToSchematicFile(const cBlockArea &a_BlockArea, const AString &a_FileName)
Saves the area into a .schematic file.
static bool LoadFromSchematicString(cBlockArea &a_BlockArea, const AString &a_SchematicData)
Loads an area from a string containing the .schematic file data.
std::string AString
Definition: StringUtils.h:13
static bool LoadFromSchematicNBT(cBlockArea &a_BlockArea, cParsedNBT &a_NBT)
Loads the area from a schematic file uncompressed and parsed into a NBT tree.