aboutsummaryrefslogtreecommitdiff
path: root/include/cru/toml
diff options
context:
space:
mode:
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);