Class: Ti99TextFile
- Inherits:
-
Ti99File
- Object
- NativeFileType
- Ti99File
- Ti99TextFile
- Defined in:
- lib/native_file_types/ti99/Ti99TextFile.rb
Instance Attribute Summary
Attributes inherited from NativeFileType
#aux_code, #contents, #file_system_image, #file_type, #filename, #meta_data
Instance Method Summary collapse
Methods inherited from Ti99File
file_system_file_types, #type_description
Methods inherited from NativeFileType
#<=>, #==, all_native_file_types, best_fit, code_for_tests, compatability_score, #data_without_header, file_type_matches?, #full_filename, #header_length, #initialize, is_valid_file_if, #load_address, load_address, matching_score, native_file_types_possible_on_file_system, non_matching_score, #to_hex_dump, #to_info_dump, #type_description
Methods included from SubclassTracking
Constructor Details
This class inherits a constructor from NativeFileType
Instance Method Details
#text_for_screendump ⇒ Object
33 34 35 |
# File 'lib/native_file_types/ti99/Ti99TextFile.rb', line 33 def text_for_screendump to_text.gsub("\n",0x0D.chr) end |
#to_text ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/native_file_types/ti99/Ti99TextFile.rb', line 14 def to_text s="" i=0 while i<contents.length do record_length=contents[i] i+=1 if record_length==0xff then while ((i<contents.length) && (i%256!=0)) do i+=1 end else s+=contents[i,record_length] s+="\n" i+=record_length end end s end |