#include <splitlines.hpp>
template<typename STRING>
class openvpn::SplitLinesType< STRING >
Definition at line 23 of file splitlines.hpp.
◆ Status
template<typename STRING >
Enumerator |
---|
S_OKAY | next line was successfully read
|
S_EOF | no further characters are available
|
S_ERROR | line was longer than allowed
|
Definition at line 129 of file splitlines.hpp.
◆ SplitLinesType()
template<typename STRING >
Initialises SplitLinesType object with pointer to str
- Parameters
-
str | Input string. |
max_line_len_arg | If not 0, specifies line length that will trigger overflow error. |
Definition at line 40 of file splitlines.hpp.
◆ line_move()
template<typename STRING >
Returns the moved current line.
Throws an exception if there is no line available currently. Throws an exception if line_overflow() returns true. Further calls to line_ref() or line_moved() will throw an exception until operator() is called again.
Definition at line 122 of file splitlines.hpp.
◆ line_overflow()
template<typename STRING >
Returns true if max_line_len is greater zero and the current line was longer than max_line_len characters.
Definition at line 85 of file splitlines.hpp.
◆ line_ref() [1/2]
template<typename STRING >
Returns reference to current line.
Throws an exception if there is no line available currently. Throws an exception if line_overflow() returns true.
Definition at line 96 of file splitlines.hpp.
◆ line_ref() [2/2]
template<typename STRING >
Returns const reference to current line.
Throws an exception if there is no line available currently. Throws an exception if line_overflow() returns true.
Definition at line 108 of file splitlines.hpp.
◆ next()
template<typename STRING >
Read the next line and move it into ln.
Does not throw an exception on overflow but instead returns S_ERROR. If nothing could be read, returns S_EOF. Since the line is moved into the argument, you can't use line_ref() or line_moved() on the object afterwards. In general calls to operator()+line_ref() and next() are not intended to be mixed.
- Parameters
-
ln | string to move the line into. |
trim | If true, remove trailing \n or \r\n |
- Returns
- Returns S_OKAY if a line was moved into ln.
Definition at line 151 of file splitlines.hpp.
◆ OPENVPN_EXCEPTION() [1/2]
template<typename STRING >
◆ OPENVPN_EXCEPTION() [2/2]
template<typename STRING >
◆ operator()()
template<typename STRING >
Read next line so that it can be accessed with line_ref or line_move.
If max_line_len is greater zero, read at most max_line_len characters.
- Parameters
-
trim | If true, remove trailing \n or \r\n |
- Returns
- Returns true if any characters were read.
Definition at line 55 of file splitlines.hpp.
◆ validate()
template<typename STRING >
◆ data
template<typename STRING >
◆ index
template<typename STRING >
◆ line
template<typename STRING >
◆ line_valid
template<typename STRING >
◆ max_line_len
template<typename STRING >
◆ overflow
template<typename STRING >
◆ size
template<typename STRING >
The documentation for this class was generated from the following file: