Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
TextReader2.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/* TextReader2.h (C) 2000-2024 */
9/* */
10/* Data writer. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_INTERNAL_TEXTREADER2_H
13#define ARCANE_STD_INTERNAL_TEXTREADER2_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
38class TextReader2
39{
40 class Impl;
41
42 public:
43
44 explicit TextReader2(const String& filename);
45 TextReader2(const TextReader2& rhs) = delete;
46 ~TextReader2();
47 TextReader2& operator=(const TextReader2& rhs) = delete;
48
49 public:
50
51 void read(Span<std::byte> values);
52 void readIntegers(Span<Integer> values);
53
54 public:
55
56 String fileName() const;
57 void setFileOffset(Int64 v);
58 void setDataCompressor(Ref<IDataCompressor> ds);
59 Ref<IDataCompressor> dataCompressor() const;
60 std::istream& stream();
61 Int64 fileLength() const;
62
63 private:
64
65 Impl* m_p;
66
67 private:
68
69 void _binaryRead(Span<std::byte> values);
70 void _checkStream(const char* type, Int64 nb_read_value);
71};
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76} // End namespace Arcane::impl
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81#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.