Permalink
Browse files

[Hitomi::Serializer] a small initial implementation

  • Loading branch information...
1 parent cb75bed commit 29d9199826993f3d6eca474722b6a585b6a571dd @masak committed Jun 16, 2009
Showing with 27 additions and 0 deletions.
  1. +3 −0 lib/Hitomi/Serializer.pm
  2. +24 −0 lib/Hitomi/Stream.pm
@@ -0,0 +1,3 @@
+class Hitomi::Serializer;
+
+# stubbing this for now
View
@@ -0,0 +1,24 @@
+use v6;
+use Hitomi::Serializer;
+
+enum Hitomi::StreamEventKind <start end text xml-decl doctype start-ns end-ns
+ start-cdata end-cdata pi comment>;
+
+class Hitomi::Stream {
+ has @!events;
+ has Hitomi::Serializer $serializer;
+
+ multi method new(@events, $serializer) {
+ return self.new(:events(@events), :serializer($serializer));
+ }
+
+ # RAKUDO: We shouldn't have to provide this method. It should be handed
+ # to us by C<Object>.
+ multi method new(*%_) {
+ return self.bless(self.CREATE(), |%_);
+ }
+
+ method Str() {
+ return [~] @!events;
+ }
+}

0 comments on commit 29d9199

Please sign in to comment.