initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "Node.h"
|
||||
#include "InlineNode.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
struct BlockNode : public Node {
|
||||
virtual ~BlockNode() = default;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockNode.h"
|
||||
|
||||
struct CodeBlock : public BlockNode {
|
||||
std::string code;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::CodeBlock;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockNode.h"
|
||||
|
||||
struct Header : public BlockNode {
|
||||
std::string headerText;
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Header;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockNode.h"
|
||||
#include "ListItem.h"
|
||||
|
||||
struct List : public BlockNode {
|
||||
std::vector<std::unique_ptr<ListItem>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::List;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockNode.h"
|
||||
|
||||
struct ListItem : public BlockNode {
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::ListItem;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockNode.h"
|
||||
|
||||
struct Paragraph : public BlockNode {
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Paragraph;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "InlineNode.h"
|
||||
|
||||
struct Bold : public InlineNode {
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Bold;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "InlineNode.h"
|
||||
|
||||
struct InlineCode : public InlineNode {
|
||||
std::string inlineCodeString;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::InlineCode;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Node.h"
|
||||
|
||||
struct InlineNode : public Node {
|
||||
virtual ~InlineNode() = default;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "InlineNode.h"
|
||||
|
||||
struct Italic : public InlineNode {
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Italic;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "InlineNode.h"
|
||||
|
||||
struct Link : public InlineNode {
|
||||
std::string url;
|
||||
std::vector<std::unique_ptr<InlineNode>> children;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Link;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "InlineNode.h"
|
||||
|
||||
struct Text : public InlineNode {
|
||||
std::string text;
|
||||
|
||||
NodeKind getKind() const {
|
||||
return NodeKind::Text;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "NodeKind.h"
|
||||
|
||||
struct Node {
|
||||
virtual ~Node() = default;
|
||||
virtual NodeKind getKind() const = 0;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
enum class NodeKind {
|
||||
CodeBlock,
|
||||
Header,
|
||||
List,
|
||||
ListItem,
|
||||
Paragraph,
|
||||
|
||||
Bold,
|
||||
InlineCode,
|
||||
Italic,
|
||||
Link,
|
||||
Text
|
||||
};
|
||||
Reference in New Issue
Block a user