-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
31 lines (27 loc) · 865 Bytes
/
test.cpp
File metadata and controls
31 lines (27 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "nbt_interface.hpp"
#include <iostream>
static const char* get_value(const char* val)
{
return val ? val : "NULL";
}
int main()
{
/*
DhNbtInstance instance("/home/dream_he/下载/Station.nbt");
DhNbtInstance instance1(instance);
std::cout << get_value(instance.get_key()) << "\n";
instance.child();
std::cout << get_value(instance.get_key()) << "\n";
std::cout << get_value(instance1.get_key()) << "\n";
instance.parent();
std::cout << get_value(instance.get_key()) << "\n";
std::cout << instance.get_nbt_rc() << "\n";
*/
DhNbtInstance root(DH_TYPE_Compound, NULL, false);
DhNbtInstance child((gint8)10, "key", true);
std::cout << (child.get_original_nbt()->key) << "\n";
root.prepend(child);
std::cout << root.child() << "\n";
std::cout << root.get_key() << "\n";
return 0;
}