Public Member Functions | |
| SimpleCsvReaderWriter (const Ref< SimpleTableInternal > &simple_table_internal) | |
| bool | writeTable (const Directory &dst, const String &file_name) override |
| Method allowing writing a simple table to a file. | |
| bool | readTable (const Directory &src, const String &file_name) override |
| Method allowing reading a file containing a simple table. | |
| void | clearInternal () override |
| Method allowing clearing the content of the SimpleTableInternal object. | |
| void | print () override |
| Method allowing writing the table to the standard output. | |
| Integer | precision () override |
| Method allowing retrieval of the precision currently used for writing values. | |
| void | setPrecision (Integer precision) override |
| Method allowing modification of the print precision. | |
| bool | isFixed () override |
| Method allowing checking if the 'std::fixed' flag is active or not for writing values. | |
| void | setFixed (bool fixed) override |
| Method allowing setting or unsetting the 'std::fixed' flag. | |
| bool | isForcedToUseScientificNotation () override |
| Method allowing checking if the 'std::scientific' flag is active or not for writing values. | |
| void | setForcedToUseScientificNotation (bool use_scientific) override |
| Method allowing setting or unsetting the 'std::scientific' flag. | |
| String | fileType () override |
| Method allowing retrieval of the file type that will be written by the implementation. ("csv" will be returned for the csv implementation). | |
| Ref< SimpleTableInternal > | internal () override |
| Method allowing retrieval of a reference to the SimpleTableInternal object used. | |
| void | setInternal (const Ref< SimpleTableInternal > &simple_table_internal) override |
| Method allowing setting a reference to a SimpleTableInternal. | |
Protected Member Functions | |
| bool | _openFile (std::ifstream &stream, Directory directory, const String &file) |
| void | _closeFile (std::ifstream &stream) |
| void | _print (std::ostream &stream) |
Protected Attributes | |
| Ref< SimpleTableInternal > | m_simple_table_internal |
| char | m_separator |
| Integer | m_precision_print |
| bool | m_is_fixed_print |
| bool | m_scientific_notation |
| const String | m_output_file_type = "csv" |
Definition at line 32 of file SimpleCsvReaderWriter.h.
|
inline |
Definition at line 37 of file SimpleCsvReaderWriter.h.
|
inline |
Definition at line 48 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 229 of file SimpleCsvReaderWriter.cc.
|
protected |
Definition at line 222 of file SimpleCsvReaderWriter.cc.
|
protected |
Definition at line 235 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing clearing the content of the SimpleTableInternal object.
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 146 of file SimpleCsvReaderWriter.cc.
Referenced by readTable().
|
inlineoverridevirtual |
Method allowing retrieval of the file type that will be written by the implementation. ("csv" will be returned for the csv implementation).
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 75 of file SimpleCsvReaderWriter.h.
Referenced by readTable(), and writeTable().
|
overridevirtual |
Method allowing retrieval of a reference to the SimpleTableInternal object used.
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 205 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing checking if the 'std::fixed' flag is active or not for writing values.
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 178 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing checking if the 'std::scientific' flag is active or not for writing values.
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 190 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing retrieval of the precision currently used for writing values.
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 161 of file SimpleCsvReaderWriter.cc.
Referenced by setPrecision().
|
overridevirtual |
Method allowing writing the table to the standard output.
The writing format is free (for the csv implementation, the writing is done the same way as in a csv file).
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 152 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing reading a file containing a simple table.
The extension will be added by the implementation.
A call to SimpleTableInternal::clear() must be performed before reading.
The elements that must be retrieved are:
The elements that must be deduced if not retrieved are:
Default deduction for m_row_sizes:
Default deduction for m_column_sizes:
| src | The source directory. |
| file_name | The file name (without extension). |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 42 of file SimpleCsvReaderWriter.cc.
References clearInternal(), fileType(), Arcane::AbstractArray< T >::size(), Arcane::String::split(), and Arcane::Array< T >::subConstView().
|
overridevirtual |
Method allowing setting or unsetting the 'std::fixed' flag.
For both the 'print()' method and the 'writetable()' method.
This flag allows 'forcing' the number of digits after the comma to the desired precision. For example, if 'setPrecision(4)' was called, and 'setFixed(true)' is called, the print of '6.1' will yield '6.1000'.
| fixed | Whether the 'std::fixed' flag should be set or not. |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 184 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing setting or unsetting the 'std::scientific' flag.
For both the 'print()' method and the 'writetable()' method.
This flag allows 'forcing' the display of values in scientific notation during writing.
| use_scientific | Whether the 'std::scientific' flag should be set or not. |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 196 of file SimpleCsvReaderWriter.cc.
|
overridevirtual |
Method allowing setting a reference to a SimpleTableInternal.
| simple_table_internal | The reference to a SimpleTableInternal. |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 211 of file SimpleCsvReaderWriter.cc.
References ARCANE_FATAL, and Arcane::RefImpl< InstanceType, RefClassType, ImplTagId >::isNull().
|
overridevirtual |
Method allowing modification of the print precision.
For both the 'print()' method and the 'writetable()' method.
| precision | The new precision. |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 167 of file SimpleCsvReaderWriter.cc.
References precision().
|
overridevirtual |
Method allowing writing a simple table to a file.
The extension will be added by the implementation.
The destination directory will be created by the implementation if it does not exist.
The SimpleTableInternal elements that must be written are:
Other SimpleTableInternal elements are not mandatory.
| dst | The destination directory. |
| file_name | The file name (without extension). |
Implements Arcane::ISimpleTableReaderWriter.
Definition at line 29 of file SimpleCsvReaderWriter.cc.
References Arcane::Directory::file(), and fileType().
|
protected |
Definition at line 93 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 96 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 92 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 94 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 90 of file SimpleCsvReaderWriter.h.
|
protected |
Definition at line 88 of file SimpleCsvReaderWriter.h.