aboutsummaryrefslogtreecommitdiff
path: root/lib/Config
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Config')
-rw-r--r--lib/Config/Exception/FileNotFoundException.pm611
-rw-r--r--lib/Config/Exception/UnimplementedMethodException.pm611
-rw-r--r--lib/Config/Exception/UnknownTypeException.pm611
-rw-r--r--lib/Config/Exception/UnsupportedTypeException.pm611
-rw-r--r--lib/Config/Parser.pm618
-rw-r--r--lib/Config/Type.pm68
6 files changed, 70 insertions, 0 deletions
diff --git a/lib/Config/Exception/FileNotFoundException.pm6 b/lib/Config/Exception/FileNotFoundException.pm6
new file mode 100644
index 0000000..74d7bc1
--- /dev/null
+++ b/lib/Config/Exception/FileNotFoundException.pm6
@@ -0,0 +1,11 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+class Config::Exception::FileNotFoundException is Exception
+{
+ method message()
+ {
+ "Could not find file"
+ }
+}
diff --git a/lib/Config/Exception/UnimplementedMethodException.pm6 b/lib/Config/Exception/UnimplementedMethodException.pm6
new file mode 100644
index 0000000..ae87db9
--- /dev/null
+++ b/lib/Config/Exception/UnimplementedMethodException.pm6
@@ -0,0 +1,11 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+class Config::Exception::UnimplementedMethodException is Exception
+{
+ method message()
+ {
+ "This method is not implemented"
+ }
+}
diff --git a/lib/Config/Exception/UnknownTypeException.pm6 b/lib/Config/Exception/UnknownTypeException.pm6
new file mode 100644
index 0000000..de58755
--- /dev/null
+++ b/lib/Config/Exception/UnknownTypeException.pm6
@@ -0,0 +1,11 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+class Config::Exception::UnknownTypeException is Exception
+{
+ method message()
+ {
+ "Could not deduce loader type."
+ }
+}
diff --git a/lib/Config/Exception/UnsupportedTypeException.pm6 b/lib/Config/Exception/UnsupportedTypeException.pm6
new file mode 100644
index 0000000..c2f6f10
--- /dev/null
+++ b/lib/Config/Exception/UnsupportedTypeException.pm6
@@ -0,0 +1,11 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+class Config::Exception::UnsupportedTypeException is Exception
+{
+ method message()
+ {
+ "No parser support for the given file. Have you imported a correct parser?"
+ }
+}
diff --git a/lib/Config/Parser.pm6 b/lib/Config/Parser.pm6
new file mode 100644
index 0000000..23effc0
--- /dev/null
+++ b/lib/Config/Parser.pm6
@@ -0,0 +1,18 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+use Config::Exception::UnimplementedMethodException;
+
+class Config::Parser
+{
+ method read(Str $path --> Hash)
+ {
+ Config::Exception::UnimplementedMethodException.new.throw();
+ }
+
+ method write(Str $path, Hash $config --> Hash)
+ {
+ Config::Exception::UnimplementedMethodException.new.throw();
+ }
+}
diff --git a/lib/Config/Type.pm6 b/lib/Config/Type.pm6
new file mode 100644
index 0000000..f348985
--- /dev/null
+++ b/lib/Config/Type.pm6
@@ -0,0 +1,8 @@
+#! /usr/bin/env false
+
+use v6.c;
+
+enum Config::Type <
+ unknown
+ yaml
+>;