Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileArchive: add type bytes #483

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/rasr_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ def _raw_read(self, size, typ):

if typ == "str":
return self.read_str(size, self.encoding)

elif typ == "bytes":
return self.read_bytes(size)
elif typ == "feat":
type_len = self.read_U32()
typ = self.read_str(type_len)
Expand All @@ -337,7 +338,6 @@ def _raw_read(self, size, typ):
data[i] = self.read_v("f", size) # size x f32
time_[i] = self.read_v("d", 2) # 2 x f64
return time_, data

elif typ in ["align", "align_raw"]:
type_len = self.read_U32()
file_typ = self.read_str(type_len)
Expand Down Expand Up @@ -408,6 +408,8 @@ def _raw_read(self, size, typ):
return alignment
else:
raise Exception("No valid alignment header found (found: %r). Wrong cache?" % typ)
else:
raise NotImplementedError(f"Archive type '{typ}' is not yet implemented")

def has_entry(self, filename):
"""
Expand Down
Loading