]> git.cworth.org Git - apitrace/blobdiff - trace_parser.hpp
Load the last few calls.
[apitrace] / trace_parser.hpp
index a9f11f78949213e00d0dca9b8623c6330f63d489..15b0ccb9b03f0964b5ce1c5418488e23bfb5afe7 100644 (file)
@@ -67,6 +67,8 @@ protected:
     typedef std::map<File::Offset, unsigned> CallNumOffsets;
     CallNumOffsets m_callNumOffsets;
 
+    bool m_supportsSeeking;
+
     unsigned next_call_no;
 
 public:
@@ -84,7 +86,7 @@ public:
 
     bool supportsOffsets() const
     {
-        return file-supportsOffsets();
+        return file->supportsOffsets();
     }
 
     File::Offset currentOffset()
@@ -101,8 +103,23 @@ public:
     bool structWithSignature(const File::Offset &offset) const;
     bool enumWithSignature(const File::Offset &offset) const;
     bool bitmaskWithSignature(const File::Offset &offset) const;
-    bool hasCallBeenParsed(const File::Offset &offset) const;
-    unsigned callNumForOffset(const File::Offset &offset) const;
+
+    unsigned currentCallNumber() const
+    {
+        return next_call_no;
+    }
+
+    void setCurrentCallNumber(unsigned num)
+    {
+        next_call_no = num;
+    }
+
+    int percentRead()
+    {
+        return file->percentRead();
+    }
+
+    Call *scan_call();
 
 protected:
     void parse_enter(void);
@@ -142,6 +159,45 @@ protected:
     unsigned long long read_uint(void);
 
     inline int read_byte(void);
+
+protected:
+    void scan_enter(void);
+
+    Call *scan_leave(void);
+
+    bool scan_call_details(Call *call);
+
+    void scan_arg(Call *call);
+
+    void scan_value(void);
+
+    void scan_sint();
+
+    void scan_uint();
+
+    void scan_float();
+
+    void scan_double();
+
+    void scan_string();
+
+    void scan_enum();
+
+    void scan_bitmask();
+
+    void scan_array(void);
+
+    void scan_blob(void);
+
+    void scan_struct();
+
+    void scan_opaque();
+
+    void skip_string(void);
+
+    void skip_uint(void);
+
+    inline void skip_byte(void);
 };