SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
gamefiles.Reader Class Reference

A little-endian struct reader that exits rather than reading past its buffer. More...

Public Member Functions

 __init__ (self, bytes buf, int pos=0)
 
bytes take (self, int n)
 
int u8 (self)
 
int i32 (self)
 
int u32 (self)
 
int i64 (self)
 
str ascii (self, int n)
 
None expect (self, str want)
 

Public Attributes

 buf
 
 pos
 

Detailed Description

A little-endian struct reader that exits rather than reading past its buffer.

Definition at line 231 of file gamefiles.py.

Constructor & Destructor Documentation

◆ __init__()

gamefiles.Reader.__init__ (   self,
bytes  buf,
int   pos = 0 
)

Definition at line 232 of file gamefiles.py.

Member Function Documentation

◆ take()

bytes gamefiles.Reader.take (   self,
int  n 
)

Definition at line 235 of file gamefiles.py.

References gamefiles.Reader.buf, and gamefiles.Reader.pos.

Referenced by gamefiles.Reader.ascii(), gamefiles.Reader.i32(), gamefiles.Reader.i64(), gamefiles.Reader.u32(), and gamefiles.Reader.u8().

Here is the caller graph for this function:

◆ u8()

int gamefiles.Reader.u8 (   self)

Definition at line 242 of file gamefiles.py.

References gamefiles.Reader.take().

Here is the call graph for this function:

◆ i32()

int gamefiles.Reader.i32 (   self)

Definition at line 245 of file gamefiles.py.

References gamefiles.Reader.take().

Here is the call graph for this function:

◆ u32()

int gamefiles.Reader.u32 (   self)

Definition at line 248 of file gamefiles.py.

References gamefiles.Reader.take().

Here is the call graph for this function:

◆ i64()

int gamefiles.Reader.i64 (   self)

Definition at line 251 of file gamefiles.py.

References gamefiles.Reader.take().

Here is the call graph for this function:

◆ ascii()

str gamefiles.Reader.ascii (   self,
int  n 
)

Definition at line 254 of file gamefiles.py.

References gamefiles.Reader.take().

Referenced by gamefiles.Reader.expect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expect()

None gamefiles.Reader.expect (   self,
str  want 
)

Definition at line 257 of file gamefiles.py.

References gamefiles.Reader.ascii().

Here is the call graph for this function:

Member Data Documentation

◆ buf

gamefiles.Reader.buf

Definition at line 233 of file gamefiles.py.

Referenced by gamefiles.Reader.take().

◆ pos

gamefiles.Reader.pos

Definition at line 233 of file gamefiles.py.

Referenced by gamefiles.Reader.take().


The documentation for this class was generated from the following file: