Ada Programming/Input Output - eMyTextBooks

Search:  

Free online books - just read it!

See live article   •   Ada Programming/Input Output
 

Ada Programming/Input Output


Table of contents


Ada has 5 independent libraries for input/output operations. So the most important lesson to learn is choosing the right one.

Text I/O

Text I/O is probably the most used Input/Output package. All data inside the file are represented by human readable text. Text I/O provides support for line and page layout but the standard is free form text.

Direct I/O

Direct I/O is used for random access files which contain only elements of one specific type. With Direct_IO you can position the file pointer to any element of that type (random access), however you can't freely choose the element type, the element type needs to be a definite subtype.

Sequential I/O

Sequential I/O is used for sequential access files which contain only elements of one specific type. With Sequential_IO it is the other way round: you can choose between definite and indefinite element types but you have to read and write the elements one after the other.

Storage I/O

Storage I/O allows you to store one element inside a memory buffer. The element needs to be a definite subtype. Storage I/O is useful in Concurrent programming where it can be used to move elements from one task to another.

Stream I/O

Stream I/O is the most powerful input/output package which Ada provides. Stream I/O allows you to mix objects from different element types in one sequential file. In order to read/write from/to a stream each type provides a 'Read and 'Write attribute as well as an 'Input and 'Output attribute. These attributes are automatically generated for each type you declare.

The 'Read and 'Write attributes treat the elements as raw data. They are suitable for low level input/output as well as interfacing with other programming languages.

The 'Input and 'Output attribute add additional control informations to the file, like for example the 'First and 'Last attributes from an array.

In object orientated programming you can also use the 'Class'Input and 'Class'Output attributes - they will store and recover the actual object type as well.

Stream I/O is also the most flexible input/output package. All I/O attributes can be replaced with user defined functions or procedures using representation clauses and you can provide your own Stream I/O types using flexible object oriented techniques.

See also

Wikibook

  • Ada Programming
  • Ada Programming/Libraries/Ada.Direct_IO
  • Ada Programming/Libraries/Ada.Sequential_IO
  • Ada Programming/Libraries/Ada.Storage_IO
  • Ada Programming/Libraries/Ada.Streams
    • Ada Programming/Libraries/Ada.Streams.Stream_IO
  • Ada Programming/Libraries/Ada.Text_IO
    • Ada Programming/Libraries/Ada.Text_IO.Complex_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Decimal_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Enumeration_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Fixed_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Float_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Integer_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Modular_IO (nested package)
    • Ada Programming/Libraries/Ada.Text_IO.Editing
  • Ada Programming/Libraries/Ada.Float_Text_IO
  • Ada Programming/Libraries/Ada.Integer_Text_IO

Ada 95 Reference Manual

Ada 2005 Reference Manual

Ada Quality and Style Guide


Also helps finding: AdaProgrammingInputOutput, AdaProgramming, ProgrammingInput, InputOutput, sda, programing, imput, adu, programmin, nput, adas, progamming, inpu, adz, prgramming

   
 
  
Add to bookmarks
Related Articles
 
Ada Programming/Libraries/Ada.Text IO
Ada Programming
Computer programming
Top Articles
 
Ada Programming/Keywords/array
Ada Programming/Keywords/else
Ada Programming/Keywords/is
Ada Programming/Keywords/private
Ada Programming/Keywords/subtype
Cookbook:Flour
Cookbook:Ingredients
Cookbook:Recipes
Cookbook:Teaspoon
General Biology
Japanese
Mishnah
Programming:C
SA CUR Info
SA NCS:Accounting
SA NCS:Electrical Technology
SA NCS:Hospitality Studies
SA NCS:Mathematics
SA NCS:Qualification Assesment
SA NCS:Second Additional Language
South African Curriculum
Search LiveJournal blogs for Ada Programming/Input Output
 

Credit Consolidation  •  Credit Consolidation  •  Credit Consolidation  •  Advertising Agency Software •  Credit Consolidation

Copyright @ 2005 eMyTextBooks.com
This article is from Wikibooks. All text is available under the terms of the GNU Free Documentation License.