Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
TextReader.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/* TextReader.h (C) 2000-2024 */
9/* */
10/* Data writer. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_TEXTREADER_H
13#define ARCANE_STD_TEXTREADER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/utils/String.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25class IDataCompressor;
26}
27
28namespace Arcane::impl
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
39class TextReader
40{
41 class Impl;
42
43 public:
44
45 ARCANE_DEPRECATED_REASON("Y2024: This class is deprecated")
46 explicit TextReader(const String& filename);
47
48 TextReader(const TextReader& rhs) = delete;
49 ~TextReader();
50 TextReader& operator=(const TextReader& rhs) = delete;
51
52 public:
53
54 void read(Span<std::byte> values);
55 void readIntegers(Span<Integer> values);
56
57 public:
58
59 String fileName() const;
60 void setFileOffset(Int64 v);
61 void setDataCompressor(Ref<IDataCompressor> ds);
62 Ref<IDataCompressor> dataCompressor() const;
63 std::ifstream& stream();
64 Int64 fileLength() const;
65
66 public:
67
68 ARCANE_DEPRECATED_REASON("Y2023: Use read(Span<const std::byte>) instead")
69 void read(Span<Int16> values);
70 ARCANE_DEPRECATED_REASON("Y2023: Use read(Span<const std::byte>) instead")
71 void read(Span<Int32> values);
72 ARCANE_DEPRECATED_REASON("Y2023: Use read(Span<const std::byte>) instead")
73 void read(Span<Int64> values);
74 ARCANE_DEPRECATED_REASON("Y2023: Use read(Span<const std::byte>) instead")
75 void read(Span<Real> values);
76 ARCANE_DEPRECATED_REASON("Y2023: Use read(Span<const std::byte>) instead")
77 void read(Span<Byte> values);
78
79 private:
80
81 Impl* m_p;
82
83 private:
84
85 void _binaryRead(void* bytes, Int64 len);
86 void _checkStream(const char* type, Int64 nb_read_value);
87};
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
91
92} // End namespace Arcane::impl
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97#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.