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 #include "../StringCompression.h"
14 
15 
16 
17 
18 
19 // fwd: FastNBT.h
20 class cParsedNBT;
21 
22 
23 
24 
25 
27 {
28 public:
29 
31  static void LoadFromSchematicFile(cBlockArea & a_BlockArea, const std::string & a_FileName);
32 
34  static void LoadFromSchematicString(cBlockArea & a_BlockArea, ContiguousByteBufferView a_SchematicData);
35 
37  static void SaveToSchematicFile(const cBlockArea & a_BlockArea, const std::string & a_FileName);
38 
40  static Compression::Result SaveToSchematicString(const cBlockArea & a_BlockArea);
41 
42 private:
43 
45  static void LoadFromSchematicNBT(cBlockArea & a_BlockArea, const cParsedNBT & a_NBT);
46 
48  static ContiguousByteBuffer SaveToSchematicNBT(const cBlockArea & a_BlockArea);
49 };
ContiguousByteBuffer
std::basic_string< std::byte > ContiguousByteBuffer
Definition: Globals.h:372
cSchematicFileSerializer::SaveToSchematicString
static Compression::Result SaveToSchematicString(const cBlockArea &a_BlockArea)
Saves the area into a string containing the .schematic file data.
Definition: SchematicFileSerializer.cpp:62
cSchematicFileSerializer
Definition: SchematicFileSerializer.h:26
cBlockArea
Definition: BlockArea.h:37
cSchematicFileSerializer::SaveToSchematicFile
static void SaveToSchematicFile(const cBlockArea &a_BlockArea, const std::string &a_FileName)
Saves the area into a .schematic file.
Definition: SchematicFileSerializer.cpp:53
cSchematicFileSerializer::LoadFromSchematicString
static void LoadFromSchematicString(cBlockArea &a_BlockArea, ContiguousByteBufferView a_SchematicData)
Loads an area from a string containing the .schematic file data.
Definition: SchematicFileSerializer.cpp:36
ContiguousByteBufferView
std::basic_string_view< std::byte > ContiguousByteBufferView
Definition: Globals.h:373
Compression::Result
Contains the result of a compression or extraction operation.
Definition: StringCompression.h:22
cSchematicFileSerializer::LoadFromSchematicNBT
static void LoadFromSchematicNBT(cBlockArea &a_BlockArea, const cParsedNBT &a_NBT)
Loads the area from a schematic file uncompressed and parsed into a NBT tree.
Definition: SchematicFileSerializer.cpp:71
cSchematicFileSerializer::LoadFromSchematicFile
static void LoadFromSchematicFile(cBlockArea &a_BlockArea, const std::string &a_FileName)
Loads an area from a .schematic file.
Definition: SchematicFileSerializer.cpp:19
cParsedNBT
Parses and contains the parsed data Also implements data accessor functions for tree traversal and va...
Definition: FastNBT.h:152
cSchematicFileSerializer::SaveToSchematicNBT
static ContiguousByteBuffer SaveToSchematicNBT(const cBlockArea &a_BlockArea)
Saves the area into a NBT representation and returns the NBT data as a string.
Definition: SchematicFileSerializer.cpp:168