Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::impl::StringViewInputStream Class Reference

Encapsulates an std::istream for a StringView. More...

#include <arcane/utils/ValueConvert.h>

Inheritance diagram for Arcane::impl::StringViewInputStream:
Collaboration diagram for Arcane::impl::StringViewInputStream:

Public Member Functions

 StringViewInputStream (StringView v)
std::istream & stream ()

Private Attributes

StringView m_view
std::istream m_stream

Detailed Description

Encapsulates an std::istream for a StringView.

Currently (C++20) std::istringstream uses an std::string for input, which requires an instance of this type and thus a potential allocation. This class serves to avoid this by directly using the memory pointed to by the instance of StringView passed in the constructor. The latter must remain valid throughout the use of this class.

Definition at line 42 of file ValueConvert.h.

Constructor & Destructor Documentation

◆ StringViewInputStream()

Arcane::impl::StringViewInputStream::StringViewInputStream ( StringView v)

Definition at line 48 of file ValueConvert.cc.

Member Function Documentation

◆ stream()

std::istream & Arcane::impl::StringViewInputStream::stream ( )
inline

Definition at line 51 of file ValueConvert.h.

Member Data Documentation

◆ m_stream

std::istream Arcane::impl::StringViewInputStream::m_stream
private

Definition at line 56 of file ValueConvert.h.

◆ m_view

StringView Arcane::impl::StringViewInputStream::m_view
private

Definition at line 55 of file ValueConvert.h.


The documentation for this class was generated from the following files: