Logo
中文版
详情联系: neusar-support@reachauto.com
ara::per::ReadAccessor类 参考

用于读取文件数据的类 更多...

#include <read_accessor.h>

类 ara::per::ReadAccessor 继承关系图:
Inheritance graph
ara::per::ReadAccessor 的协作图:
Collaboration graph

Public 成员函数

 ReadAccessor (const std::shared_ptr< fileaccess::ReadAccessorImpl > &impl_ptr)
 construtor of ReadAccessor 更多...
 
 ReadAccessor ()=delete
 The default constructor for ReadAccessor shall not be used. 更多...
 
 ReadAccessor (ReadAccessor &&ra)=delete
 The move constructor for ReadAccessor shall not be used. 更多...
 
ReadAccessoroperator= (ReadAccessor &&ra) &=delete
 The move assignment operator for ReadAccessor shall not be used. 更多...
 
 ReadAccessor (const ReadAccessor &)=delete
 The copy constructor for ReadAccessor shall not be used. 更多...
 
ReadAccessoroperator= (const ReadAccessor &)=delete
 The copy assignment operator for ReadAccessor shall not be used. 更多...
 
 ~ReadAccessor () noexcept=default
 Destructor for ReadAccessor. 更多...
 
ara::core::Result< char > PeekChar () noexcept
 Returns the character at the current position of the file. 更多...
 
ara::core::Result< ara::core::Byte > PeekByte () const noexcept
 Returns the byte at the current position of the file. 更多...
 
ara::core::Result< char > GetChar () noexcept
 Returns the character at the current position of the file, advancing the current position 更多...
 
ara::core::Result< ara::core::Byte > GetByte () noexcept
 Returns the byte at the current position of the file, advancing the current position. 更多...
 
ara::core::Result< ara::core::String > ReadText (uint64_t n) noexcept
 Reads a number of characters into a String, starting from the current position. 更多...
 
ara::core::Result< ara::core::String > ReadText () noexcept
 Reads all remaining characters into a String, starting from the current position. 更多...
 
ara::core::Result< ara::core::Vector< ara::core::Byte > > ReadBinary () noexcept
 Reads all remaining bytes into a Vector of Byte, starting from the current position. 更多...
 
ara::core::Result< ara::core::Vector< ara::core::Byte > > ReadBinary (uint64_t n) noexcept
 Reads a number of bytes into a Vector of Byte, starting from the current position. 更多...
 
ara::core::Result< ara::core::String > ReadLine (char delimiter='\n') noexcept
 Reads a complete line of characters into a String, advancing the current position accordingly 更多...
 
uint64_t GetPosition () const noexcept
 Returns the current position relative to the beginning of the file. 更多...
 
ara::core::Result< void > SetPosition (uint64_t position) noexcept
 Sets the current position relative to the beginning of the file. 更多...
 
ara::core::Result< uint64_t > MovePosition (Origin const origin, int64_t const offset) noexcept
 Moves the current position in the file relative to the Origin. 更多...
 
bool IsEof () const noexcept
 Checks if the current position is at end of file.。 更多...
 
uint64_t GetSize () const noexcept
 Returns the current size of a file in bytes 更多...
 

详细描述

用于读取文件数据的类

Swsid
SWS_PER_00342
符合标准
Yes
非标原因
N/A
种类
class
符号
ara::per::ReadAccessor
范围
namespace ara::per
基类
N/A
分类
ara
头文件
注解
代码示例及类句柄的获取说明: 见FileStorage class相应的示例获取的proxy句柄。 auto accessor = proxy->OpenFileReadOnly(StringView("filename")); if (!accessor) { 以只读方式打开文件失败,信息为:accessor.Error().Message(); 相应处理 } auto ac = std::move(accessor).Value(); ac即为此类的指针。
模板参数
N/A@uptrace{N/A}

在文件 第 行定义.

构造及析构函数说明

◆ ReadAccessor()

ara::per::ReadAccessor::ReadAccessor ( const std::shared_ptr< fileaccess::ReadAccessorImpl > &  impl_ptr)
inline

construtor of ReadAccessor

模板参数
N/A
参数
[in]impl_ptrshared_ptr of ReadAccessorImpl class
[out]N/A
[in,out]N/A
返回
N/A
注解
construtor of ReadAccessor
异常
N/A
Swsid
N/A
符合标准
yes
非标原因
N/A
种类
function
可见
public
线程安全
no
Fireandforget
no
错误
N/A
头文件
异常安全
N/A
分类
ara
范围
namespace ara::per::ReadAccessor @uptrace{N/A}

在文件 第 行定义.