Class: Yuki::VD
Overview
Class that helps to read Virtual Directories
In reading mode, the Virtual Directories can be loaded to RAM if MAX_SIZE >= VD.size
All the filenames inside the Yuki::VD has to be downcased filename in utf-8
Note : Encryption is up to the developper and no longer supported on the basic script
Constant Summary collapse
- DEBUG_ON =
Is the debug info on ?
ARGV.include?('debug-yuki-vd')
- MAX_SIZE =
The max size of the file that can be loaded in memory
10 * 1024 * 1024
- ALLOWED_MODES =
10Mo List of allowed modes
%i[read write update]
- POINTER_SIZE =
Size of the pointer at the begin of the file
4
- UNPACK_METHOD =
Unpack method of the pointer at the begin of the file
'L'
Instance Attribute Summary collapse
-
#filename ⇒ String
readonly
The filename of the current Yuki::VD.
Instance Method Summary collapse
-
#add_file(filename, ext_name = nil)
Add a file to the Yuki::VD.
-
#close
Close the VD.
-
#exists?(filename) ⇒ Boolean
Test if a file exists in the VD.
-
#get_filenames ⇒ Array<String>
Get all the filename.
-
#initialize(filename, mode) ⇒ VD
constructor
Create a new Yuki::VD file or load it.
-
#read_data(filename) ⇒ String?
Read a file data from the VD.
-
#write_data(filename, data)
Write a file with its data in the VD.
Constructor Details
#initialize(filename, mode) ⇒ VD
Create a new Yuki::VD file or load it
524 525 |
# File 'docs/0_Dependencies.rb', line 524 def initialize(filename, mode) end |
Instance Attribute Details
#filename ⇒ String (readonly)
Returns the filename of the current Yuki::VD.
509 510 511 |
# File 'docs/0_Dependencies.rb', line 509 def filename @filename end |
Instance Method Details
#add_file(filename, ext_name = nil)
Add a file to the Yuki::VD
544 545 |
# File 'docs/0_Dependencies.rb', line 544 def add_file(filename, ext_name = nil) end |
#close
Close the VD
551 552 |
# File 'docs/0_Dependencies.rb', line 551 def close end |
#exists?(filename) ⇒ Boolean
Test if a file exists in the VD
534 535 |
# File 'docs/0_Dependencies.rb', line 534 def exists?(filename) end |
#get_filenames ⇒ Array<String>
Get all the filename
548 549 |
# File 'docs/0_Dependencies.rb', line 548 def get_filenames end |
#read_data(filename) ⇒ String?
Read a file data from the VD
529 530 |
# File 'docs/0_Dependencies.rb', line 529 def read_data(filename) end |
#write_data(filename, data)
Write a file with its data in the VD
539 540 |
# File 'docs/0_Dependencies.rb', line 539 def write_data(filename, data) end |