File

source: bluebase/pf/file.py


class PfFileHeader(page: PfPage, *, offset: int, limit: int)[source]

Bases: PfPageView, LayoutMixin

file header를 관리하는 view 클래스입니다.

Layout

Offset

Size

Name

Format

0

4

page_count

'<i'

4

4

first_free_pid

'<i'

PID: ClassVar[PfPageId] = 0

file header의 page id를 나타내는 상수.

NO_FREE_PAGE: ClassVar[PfPageId] = -1

free page가 없을 경우 사용하는 상수.

size: ClassVar[int] = 8

The total size of the layout, automatically calculated from fields.

class PfFile(fid: PfFileId, cache: PfPageCache)[source]

Bases: object

Variables:
static get_header(page: PfPage) → PfFileHeader[source]
static fetch_header(file: PfFile) → tuple[PfPage, PfFileHeader][source]
classmethod new(fid: PfFileId, cache: PfPageCache) → Self[source]
classmethod open(fid: PfFileId, cache: PfPageCache) → Self[source]
property page_count: intread-write
property first_free_pid: PfPageId | Noneread-write
validate_pid(pid: PfPageId) → None[source]
Raises:

PfInvalidPageIdError –

assignmentget_page(pid: PfPageId) → PfPage[source]
Raises:
assignmentfind_next_page(pid: PfPageId) → PfPage | None[source]
Raises:
assignmentallocate_page() → PfPage[source]
assignmentdispose_page(page: PfPage) → None[source]
Raises:
assignmentpersist() → None[source]
assignmentflush() → None[source]