Browse Source

Add a size()

Jake Smith 13 years ago
parent
commit
a38ec74791
1 changed files with 5 additions and 1 deletions
  1. 5 1
      system/jlib/jbuff.hpp

+ 5 - 1
system/jlib/jbuff.hpp

@@ -224,9 +224,13 @@ public:
     }
     inline void write()
     {
-        size32_t sz = mb.length() - (pos + sizeof(size32_t));
+        size32_t sz = size();
         mb.writeDirect(pos, sizeof(sz), &sz);
     }
+    inline size32_t size() const
+    {
+        return mb.length() - (pos + sizeof(size32_t));
+    }
     // resets position marker and writes another size to be filled subsequently by write()
     inline void restart()
     {