FFI Class Reference
[Input/Output]
#include <FFI.h>
Detailed Description
To handle input files using free format format.FFI is a format (or protocol) for data files. This protocol is intended to simplify the comprehension of file contents. For example, mesh and field files use the FFI standard:
- Any string following a
#or%sign is interpreted as a comment. - A string between a
#and a!in the first line can be interpreted as a ``magic number", i.e., a string used to inform about the nature of the file contents. e.g., the string#MESH!informs that the current file is a Mesh data (MDF) file. - Data can be given separated by any number of blanks or a carriage return.
Public Member Functions | |
| void | Close (void) |
| Close file. | |
| FFI (const FFI &ff) | |
| Copy constructor. | |
| FFI (const string &file, const string &ident) | |
| Constructor using file name and seeking a "magic number". | |
| FFI (const string &file) | |
| Constructor using file name. | |
| FFI () | |
| Constructor using standard input. | |
| double | getD (const string &msg="0") |
| Read and return a float number. | |
| string | getE (const string &msg="0") |
| Read and return an algebraic expression. | |
| int | getI (const string &msg="0") |
| Read and return an integer number. | |
| string | getIdent () const |
| Return read identification string in file. | |
| int | getKW (const string &msg="0") |
| Read and return a keyword in the list kw. | |
| string | getS (const string &msg="0") |
| Read and return a string. | |
| void | open (const string &file, const string &ident) |
| Open file and seek a "magic number" ident. | |
| void | open (const string &file) |
| Open file. | |
| FFI & | operator= (const FFI &ff) |
| Operator =. | |
| void | setKeywords (const valarray< string > &s) |
| Set a list of keywords to scan later. | |
| ~FFI () | |
| Destructor. | |
Constructor & Destructor Documentation
| FFI | ( | const string & | file | ) |
Constructor using file name.
- Parameters:
-
[in] file Input file name
| FFI | ( | const string & | file, | |
| const string & | ident | |||
| ) |
Constructor using file name and seeking a "magic number".
- Parameters:
-
[in] file Input file name [in] ident Identification string
Member Function Documentation
| double getD | ( | const string & | msg = "0" |
) |
Read and return a float number.
- Parameters:
-
[in] msg Message to output (for interactive usage)
Referenced by NodeVect::get(), and ElementVect::get().
| string getE | ( | const string & | msg = "0" |
) |
Read and return an algebraic expression.
- Parameters:
-
[in] msg Message to output (for interactive usage)
| int getI | ( | const string & | msg = "0" |
) |
Read and return an integer number.
- Parameters:
-
[in] msg Message to output (for interactive usage)
Referenced by NodeVect::get(), and ElementVect::get().
| int getKW | ( | const string & | msg = "0" |
) |
Read and return a keyword in the list kw.
- Parameters:
-
[in] msg Message to output (for interactive usage)
Referenced by NodeVect::get(), and ElementVect::get().
| string getS | ( | const string & | msg = "0" |
) |
Read and return a string.
- Parameters:
-
[in] msg Message to output (for interactive usage)
Referenced by NodeVect::get(), and ElementVect::get().
| void open | ( | const string & | file, | |
| const string & | ident | |||
| ) |
Open file and seek a "magic number" ident.
- Parameters:
-
[in] file Input file name [in] ident Identification string
| void open | ( | const string & | file | ) |
Open file.
- Parameters:
-
file [in] Input file name
| void setKeywords | ( | const valarray< string > & | s | ) |
Set a list of keywords to scan later.
- Parameters:
-
[in] s Array of keywords to initialize
Referenced by NodeVect::get(), and ElementVect::get().