aboutsummaryrefslogtreecommitdiff
path: root/include/cru/toml
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-12 22:36:09 +0800
committercrupest <crupest@outlook.com>2022-01-12 22:36:09 +0800
commitc409caa8873e25699fc10ae435e8d123685f28f3 (patch)
tree16a0c0696f0e6d4c6856db0b7864652e2779b2b8 /include/cru/toml
parent7a42d92c10a4bc686244668dd0e3f903f30f2fae (diff)
downloadcru-c409caa8873e25699fc10ae435e8d123685f28f3.tar.gz
cru-c409caa8873e25699fc10ae435e8d123685f28f3.tar.bz2
cru-c409caa8873e25699fc10ae435e8d123685f28f3.zip
...
Diffstat (limited to 'include/cru/toml')
-rw-r--r--include/cru/toml/Base.hpp11
-rw-r--r--include/cru/toml/TomlDocument.hpp6
-rw-r--r--include/cru/toml/TomlParser.hpp4
3 files changed, 17 insertions, 4 deletions
diff --git a/include/cru/toml/Base.hpp b/include/cru/toml/Base.hpp
new file mode 100644
index 00000000..de1d558c
--- /dev/null
+++ b/include/cru/toml/Base.hpp
@@ -0,0 +1,11 @@
+#pragma once
+
+#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_TOML_EXPORT_API
+#define CRU_TOML_API __declspec(dllexport)
+#else
+#define CRU_TOML_API __declspec(dllimport)
+#endif
+#else
+#define CRU_TOML_API
+#endif
diff --git a/include/cru/toml/TomlDocument.hpp b/include/cru/toml/TomlDocument.hpp
index 637690f7..1e5caf71 100644
--- a/include/cru/toml/TomlDocument.hpp
+++ b/include/cru/toml/TomlDocument.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "Base.hpp"
+
#include "cru/common/Base.hpp"
#include "cru/common/String.hpp"
@@ -7,7 +9,7 @@
#include <unordered_map>
namespace cru::toml {
-class TomlSection {
+class CRU_TOML_API TomlSection {
public:
CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(TomlSection)
CRU_DEFAULT_COPY(TomlSection)
@@ -29,7 +31,7 @@ class TomlSection {
std::unordered_map<String, String> values_;
};
-class TomlDocument {
+class CRU_TOML_API TomlDocument {
public:
CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(TomlDocument)
CRU_DEFAULT_COPY(TomlDocument)
diff --git a/include/cru/toml/TomlParser.hpp b/include/cru/toml/TomlParser.hpp
index 52332506..c3091bad 100644
--- a/include/cru/toml/TomlParser.hpp
+++ b/include/cru/toml/TomlParser.hpp
@@ -7,12 +7,12 @@
namespace cru::toml {
// A very simple and tolerant TOML parser.
-class TomlParsingException : public Exception {
+class CRU_TOML_API TomlParsingException : public Exception {
public:
using Exception::Exception;
};
-class TomlParser {
+class CRU_TOML_API TomlParser {
public:
explicit TomlParser(String input);