Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
TextWriter.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* TextWriter.h (C) 2000-2024 */
9/* */
10/* Data writer. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_TEXTWRITER_H
13#define ARCANE_STD_TEXTWRITER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25class IDataCompressor;
26}
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane::impl
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
41class TextWriter
42{
43 class Impl;
44
45 public:
46
47 ARCANE_DEPRECATED_REASON("Y2024: This class is deprecated")
48 explicit TextWriter(const String& filename);
49 ARCANE_DEPRECATED_REASON("Y2024: This class is deprecated")
50 TextWriter();
51
52 TextWriter(const TextWriter& rhs) = delete;
53 ~TextWriter();
54 TextWriter& operator=(const TextWriter& rhs) = delete;
55
56 public:
57
58 void open(const String& filename);
59 void write(Span<const std::byte> values);
60
61 public:
62
63 String fileName() const;
64 void setDataCompressor(Ref<IDataCompressor> ds);
65 Ref<IDataCompressor> dataCompressor() const;
66 Int64 fileOffset();
67 std::ostream& stream();
68
69 public:
70
71 ARCANE_DEPRECATED_REASON("Y2023: Use write(Span<const std::byte>) instead")
72 void write(Span<const Real> values);
73 ARCANE_DEPRECATED_REASON("Y2023: Use write(Span<const std::byte>) instead")
74 void write(Span<const Int16> values);
75 ARCANE_DEPRECATED_REASON("Y2023: Use write(Span<const std::byte>) instead")
76 void write(Span<const Int32> values);
77 ARCANE_DEPRECATED_REASON("Y2023: Use write(Span<const std::byte>) instead")
78 void write(Span<const Int64> values);
79 ARCANE_DEPRECATED_REASON("Y2023: Use write(Span<const std::byte>) instead")
80 void write(Span<const Byte> values);
81
82 private:
83
84 Impl* m_p;
85
86 private:
87
88 void _binaryWrite(const void* bytes, Int64 len);
89};
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94} // End namespace Arcane::impl
95
96/*---------------------------------------------------------------------------*/
97/*---------------------------------------------------------------------------*/
98
99#endif
Declarations of types used in Arcane.
Interface of a service for compressing/decompressing data.
Reference to an instance.
View of an array of elements of type T.
Definition Span.h:635
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.