ONE - On-device Neural Engine
Loading...
Searching...
No Matches
hermes::MessageText Class Reference

Mutie-line text message. More...

#include <Message.h>

Public Member Functions

 MessageText (std::stringstream &ss)
 WARNING! Be careful. This constructor updates "ss".
 
uint32_t lines (void) const
 The number of lines.
 
const std::string & line (uint32_t n) const
 The content of a specific line.
 

Detailed Description

Mutie-line text message.

Definition at line 33 of file Message.h.

Constructor & Destructor Documentation

◆ MessageText()

hermes::MessageText::MessageText ( std::stringstream &  ss)

WARNING! Be careful. This constructor updates "ss".

Definition at line 24 of file Message.cpp.

25{
26 while (!ss.eof())
27 {
28 assert(ss.good());
29
30 std::string line;
31 std::getline(ss, line);
32
33 // Trim the last empty line (by std::endl)
34 if (ss.eof() && line.empty())
35 {
36 break;
37 }
38
39 _lines.emplace_back(line);
40 }
41}
const std::string & line(uint32_t n) const
The content of a specific line.
Definition Message.h:43

References line().

Member Function Documentation

◆ line()

const std::string & hermes::MessageText::line ( uint32_t  n) const
inline

The content of a specific line.

Definition at line 43 of file Message.h.

43{ return _lines.at(n); }

Referenced by MessageText().

◆ lines()

uint32_t hermes::MessageText::lines ( void  ) const
inline

The number of lines.

Definition at line 41 of file Message.h.

41{ return _lines.size(); }

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