[matroska] r785 - in trunk/RbMatroska: . ebml

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: mosu
Date: 2004-09-12 13:34:24 +0400 (Sun, 12 Sep 2004)
New Revision: 785

Added:
   trunk/RbMatroska/ebml/dummy.rb
Modified:
   trunk/RbMatroska/ebml.rb
   trunk/RbMatroska/ebml/file.rb
Log:
Use a new Dummy class instead of an Element for unknown elements.

Added: trunk/RbMatroska/ebml/dummy.rb
===================================================================
--- trunk/RbMatroska/ebml/dummy.rb	2004-09-12 09:31:21 UTC (rev 784)
+++ trunk/RbMatroska/ebml/dummy.rb	2004-09-12 09:34:24 UTC (rev 785)
@@ -0,0 +1,25 @@
+#!/usr/bin/ruby
+
+#
+# Distributed under the MIT license
+# see the file COPYING for details
+# or visit http://www.opensource.org/licenses/mit-license.php
+#
+# $Id$
+#
+# A simple EBML parser based loosely on libebml and other
+# EBML implementations. It also contains classes for the global EBML
+# elements mentioned on # http://www.matroska.org/technical/specs/index.html
+#
+# Written by Moritz Bunkus <[email protected]>.
+#
+
+module Ebml
+  class Dummy < Binary
+    def to_s
+      @value ||= Array.new
+      return "[dummy id #{@id} size #{@data_size}]"
+    end
+  end                           # class Binary
+
+end                             # module Ebml


Property changes on: trunk/RbMatroska/ebml/dummy.rb
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: trunk/RbMatroska/ebml/file.rb
===================================================================
--- trunk/RbMatroska/ebml/file.rb	2004-09-12 09:31:21 UTC (rev 784)
+++ trunk/RbMatroska/ebml/file.rb	2004-09-12 09:34:24 UTC (rev 785)
@@ -116,7 +116,7 @@
     def find_class_for_id(id)
       raise Error, "IDs not mapped" unless (@id_mapping)
       return @id_mapping[id.value] if (@id_mapping.has_key?(id.value))
-      return Element
+      return Dummy
     end
   end                           # class File
 

Modified: trunk/RbMatroska/ebml.rb
===================================================================
--- trunk/RbMatroska/ebml.rb	2004-09-12 09:31:21 UTC (rev 784)
+++ trunk/RbMatroska/ebml.rb	2004-09-12 09:34:24 UTC (rev 785)
@@ -117,6 +117,7 @@
 
   require "ebml/binary"
   require "ebml/date"
+  require "ebml/dummy"
   require "ebml/float"
   require "ebml/master"
   require "ebml/sinteger"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.