Class: OsuRuby::Database::BaseDB Abstract
- Inherits:
-
Object
- Object
- OsuRuby::Database::BaseDB
- Includes:
- Interface::AbstractClass
- Defined in:
- (osu-ruby2 0.0.2) osu-ruby2/database/file.rb
Overview
This is base of database reading. Please understand this page were meant for developers of this library. But you can try understanding this part for other references.
First of all, this database must be used with care. I only provide references or personal data fixes. I do not condone cheating in osu!, please understand. Any misconducts that is done by using this library, I nor the devs, do not give consent for doing so.
Second, for any changes that happens within osu! database file itself they may not be noted in here due to some reasons. If any of you wanted to fill out the blankness from any version range, feel free to let me know.
Please do not use :send commands to invoke those privates, because they are part of private API. They are not meant to return value, being used outside :read_file or :write_to_file function.
Data structure itself are build by peppy and his dev team.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Represents database version.
Class Method Summary collapse
-
.load(file) ⇒ BaseDB
Loads the database from the file directly.
Instance Method Summary collapse
- #determine_struct_bytes(io, item) abstract private
-
#initialize(file = nil) ⇒ BaseDB
constructor
Instantiate a simple skeleton.
- #initialize_copy(other) ⇒ Object
- #inspect ⇒ String
-
#read_file(file = nil) ⇒ Boolean
Read from source.
-
#read_structs(io, container = nil, &block) ⇒ Object
private
This allows to read an array of object to be read consecutively.
-
#version!
Enforces the database version to the library-supported one.
-
#write_structs(io, list) ⇒ Object
private
This function only removes some parts that can be considered as repetitive.
-
#write_to_file(file = nil)
Write database to destination.
Methods included from Interface::MultiplexerInterface
Constructor Details
#initialize(file = nil) ⇒ BaseDB
Instantiate a simple skeleton
Instance Attribute Details
#version ⇒ Object (readonly)
Represents database version
Class Method Details
.load(file) ⇒ BaseDB
Loads the database from the file directly
Instance Method Details
#determine_struct_bytes(io, item)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
There's no sanity check for this, as it's supposed to have a proper Hash-struct-like format. For the convention, each type always starts with :_type
key that signifies struct type itself.
This method returns an undefined value.
#initialize_copy(other) ⇒ Object
#inspect ⇒ String
#read_file ⇒ Boolean #read_file(filename) ⇒ Boolean #read_file(dotnet_io) ⇒ Boolean #read_file(io) ⇒ Boolean
Read from source
#read_structs(io, &block) ⇒ Array #read_structs(io, container, &block)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This allows to read an array of object to be read consecutively. First Int32 signifies the length of the array, after that perform the given block (must, no sanity check).
#version!
This method returns an undefined value.
Enforces the database version to the library-supported one.
#write_structs(io, list) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Do not overload this method. Instead, implement the #determine_struct_bytes, things are handled there.
This function only removes some parts that can be considered as repetitive.
#write_to_file #write_to_file(filename) #write_to_file(dotnet_io) #write_to_file(io)
This method returns an undefined value.
Write database to destination