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
541 542 |
# File 'docs/0_Dependencies.rb', line 541 def initialize(filename, mode) end |
Instance Attribute Details
#filename ⇒ String (readonly)
Returns the filename of the current Yuki::VD.
526 527 528 |
# File 'docs/0_Dependencies.rb', line 526 def filename @filename end |
Instance Method Details
#add_file(filename, ext_name = nil)
Add a file to the Yuki::VD
561 562 |
# File 'docs/0_Dependencies.rb', line 561 def add_file(filename, ext_name = nil) end |
#close
Close the VD
568 569 |
# File 'docs/0_Dependencies.rb', line 568 def close end |
#exists?(filename) ⇒ Boolean
Test if a file exists in the VD
551 552 |
# File 'docs/0_Dependencies.rb', line 551 def exists?(filename) end |
#get_filenames ⇒ Array<String>
Get all the filename
565 566 |
# File 'docs/0_Dependencies.rb', line 565 def get_filenames end |
#read_data(filename) ⇒ String?
Read a file data from the VD
546 547 |
# File 'docs/0_Dependencies.rb', line 546 def read_data(filename) end |
#write_data(filename, data)
Write a file with its data in the VD
556 557 |
# File 'docs/0_Dependencies.rb', line 556 def write_data(filename, data) end |