diff options
author | Patrick Spek <p.spek@tyil.nl> | 2017-04-23 21:24:26 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2017-04-23 21:24:26 +0200 |
commit | 9687382b803ec0dc5a7dd55be88b53a4264215f9 (patch) | |
tree | e522d65c4555acabcc282e87e6c75a799bd3aa38 /lib/Config |
Initial commit
Diffstat (limited to 'lib/Config')
-rw-r--r-- | lib/Config/Exception/FileNotFoundException.pm6 | 11 | ||||
-rw-r--r-- | lib/Config/Exception/UnimplementedMethodException.pm6 | 11 | ||||
-rw-r--r-- | lib/Config/Exception/UnknownTypeException.pm6 | 11 | ||||
-rw-r--r-- | lib/Config/Exception/UnsupportedTypeException.pm6 | 11 | ||||
-rw-r--r-- | lib/Config/Parser.pm6 | 18 | ||||
-rw-r--r-- | lib/Config/Type.pm6 | 8 |
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 +>; |