Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDScript Documentation-System UI implementations #39849

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
403 changes: 258 additions & 145 deletions editor/doc_data.cpp

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions editor/doc_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,33 @@
#ifndef DOC_DATA_H
#define DOC_DATA_H

#include "core/io/json.h"
#include "core/io/xml_parser.h"
#include "core/map.h"
#include "core/variant.h"

struct XmlWriteStream {
enum StreamType {
FILE_STREAM,
STRING_STREAM,
};
FileAccess *fstream = nullptr;
String *sstream = nullptr;
StreamType get_stream_type() const { return type; }

XmlWriteStream(FileAccess *p_fstream) {
type = FILE_STREAM;
fstream = p_fstream;
}
XmlWriteStream(String *p_sstream) {
type = STRING_STREAM;
sstream = p_sstream;
}

private:
StreamType type = STRING_STREAM;
};

class DocData {
public:
struct ArgumentDoc {
Expand Down Expand Up @@ -116,6 +139,8 @@ class DocData {
void generate(bool p_basic_types = false);
Error load_classes(const String &p_dir);
static Error erase_classes(const String &p_dir);
static void write_class(ClassDoc &p_class, XmlWriteStream &p_ws);
static String json_from_class_doc(const ClassDoc &p_class);
Error save_classes(const String &p_default_path, const Map<String, String> &p_class_path);

Error load_compressed(const uint8_t *p_data, int p_compressed_size, int p_uncompressed_size);
Expand Down
Loading