Class: AppleText
- Inherits:
-
NativeFileType
- Object
- NativeFileType
- AppleText
- Includes:
- ScreenDump
- Defined in:
- lib/native_file_types/apple2/AppleText.rb
Instance Attribute Summary
Attributes inherited from NativeFileType
#aux_code, #contents, #file_system_image, #file_type, #filename, #meta_data
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ScreenDump
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
Class Method Details
Instance Method Details
#text_for_screendump ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/native_file_types/apple2/AppleText.rb', line 23 def text_for_screendump if (file_system_image.file_system.to_s==:ProDos.to_s) then s="" contents.each_byte{|b| s+= ((b+128)%256).chr} return s end data_without_header.sub(/\000*$/,'') #trim of any trailing null bytes end |
#to_text ⇒ Object
17 18 19 20 21 |
# File 'lib/native_file_types/apple2/AppleText.rb', line 17 def to_text s="" contents.each_byte{|b| s+=Apple2.to_ascii(b) unless b==0} s.tr("\r","\n") end |