12#ifndef ARCANE_STD_SIMPLECSVREADERWRITER_H
13#define ARCANE_STD_SIMPLECSVREADERWRITER_H
17#include "arcane/core/ISimpleTableReaderWriter.h"
19#include "arcane/utils/FatalErrorException.h"
21#include "arcane/core/Directory.h"
32class SimpleCsvReaderWriter
38 : m_simple_table_internal(simple_table_internal)
40 , m_precision_print(6)
41 , m_is_fixed_print(
false)
42 , m_scientific_notation(
false)
44 if (simple_table_internal.
isNull())
45 ARCANE_FATAL(
"The reference passed as a parameter is Null.");
48 SimpleCsvReaderWriter()
49 : m_simple_table_internal()
51 , m_precision_print(6)
52 , m_is_fixed_print(
false)
53 , m_scientific_notation(
false)
57 ~SimpleCsvReaderWriter() =
default;
64 void print()
override;
82 bool _openFile(std::ifstream& stream,
Directory directory,
const String& file);
83 void _closeFile(std::ifstream& stream);
84 void _print(std::ostream& stream);
93 bool m_is_fixed_print;
94 bool m_scientific_notation;
96 const String m_output_file_type =
"csv";
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Class managing a directory.
Class interface allowing reading a file and writing a file with or from a SimpleTableInternal.
bool isNull() const
Indicates if the counter references a non-null instance.
Reference to an instance.
void setFixed(bool fixed) override
Method allowing setting or unsetting the 'std::fixed' flag.
void setInternal(const Ref< SimpleTableInternal > &simple_table_internal) override
Method allowing setting a reference to a SimpleTableInternal.
bool isForcedToUseScientificNotation() override
Method allowing checking if the 'std::scientific' flag is active or not for writing values.
void clearInternal() override
Method allowing clearing the content of the SimpleTableInternal object.
void setForcedToUseScientificNotation(bool use_scientific) override
Method allowing setting or unsetting the 'std::scientific' flag.
bool readTable(const Directory &src, const String &file_name) override
Method allowing reading a file containing a simple table.
String fileType() override
Method allowing retrieval of the file type that will be written by the implementation....
void print() override
Method allowing writing the table to the standard output.
bool isFixed() override
Method allowing checking if the 'std::fixed' flag is active or not for writing values.
Ref< SimpleTableInternal > internal() override
Method allowing retrieval of a reference to the SimpleTableInternal object used.
bool writeTable(const Directory &dst, const String &file_name) override
Method allowing writing a simple table to a file.
void setPrecision(Integer precision) override
Method allowing modification of the print precision.
Integer precision() override
Method allowing retrieval of the precision currently used for writing values.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.